wonderinventions / node-webrtc Goto Github PK
View Code? Open in Web Editor NEWThis project forked from node-webrtc/node-webrtc
node-webrtc is a Node.js Native Addon that provides bindings to WebRTC M98
License: Other
This project forked from node-webrtc/node-webrtc
node-webrtc is a Node.js Native Addon that provides bindings to WebRTC M98
License: Other
I'm having some issues around rebuilding for electron and loading the native binary.
Any chance you've tried this or could build a binary for electron?
For reference, getting this stack:
FATAL ERROR: HandleScope::HandleScope Entering the V8 API without proper locking in place
1: 0x102b11c15 node::Abort() [(redacted)/.nvm/versions/node/v20.5.1/bin/node]
2: 0x102b11d01 node::OnFatalError(char const*, char const*) [(redacted)/.nvm/versions/node/v20.5.1/bin/node]
3: 0x102cc2e95 v8::HandleScope::HandleScope(v8::Isolate*) [(redacted)/.nvm/versions/node/v20.5.1/bin/node]
4: 0x102ac7e88 napi_open_handle_scope [(redacted)/nvm/versions/node/v20.5.1/bin/node]
5: 0x14b5da11d node_webrtc::AsyncContextReleaser::GetDefault() [(redacted)/node_modules/@roamhq/wrtc-darwin-x64/wrtc.node]
6: 0x14b593088 node_webrtc::AsyncObjectWrap<node_webrtc::RTCPeerConnection>::AsyncObjectWrap(char const*, Napi::CallbackInfo const&) [(redacted)/node_modules/@roamhq/wrtc-darwin-x64/wrtc.node]
7: 0x14b58343f node_webrtc::AsyncObjectWrapWithLoop<node_webrtc::RTCPeerConnection>::AsyncObjectWrapWithLoop(char const*, node_webrtc::RTCPeerConnection&, Napi::CallbackInfo const&) [(redacted)/node_modules/@roamhq/wrtc-darwin-x64/wrtc.node]
8: 0x14b582b5f node_webrtc::RTCPeerConnection::RTCPeerConnection(Napi::CallbackInfo const&) [(redacted)/node_modules/@roamhq/wrtc-darwin-x64/wrtc.node]
9: 0x14b5a5dba napi_value__* Napi::details::WrapCallback<Napi::ObjectWrap<node_webrtc::RTCPeerConnection>::ConstructorCallbackWrapper(napi_env__*, napi_callback_info__*)::'lambda0'()>(Napi::ObjectWrap<node_webrtc::RTCPeerConnection>::ConstructorCallbackWrapper(napi_env__*, napi_callback_info__*)::'lambda0'()) [(redacted)/node_modules/@roamhq/wrtc-darwin-x64/wrtc.node]
10: 0x14b5a54a9 Napi::ObjectWrap<node_webrtc::RTCPeerConnection>::ConstructorCallbackWrapper(napi_env__*, napi_callback_info__*) [(redacted)/node_modules/@roamhq/wrtc-darwin-x64/wrtc.node]
11: 0x102aca1e0 v8impl::(anonymous namespace)::FunctionCallbackWrapper::Invoke(v8::FunctionCallbackInfo<v8::Value> const&) [(redacted)/.nvm/versions/node/v20.5.1/bin/node]
12: 0x102d29683 v8::internal::MaybeHandle<v8::internal::Object> v8::internal::(anonymous namespace)::HandleApiCallHelper<true>(v8::internal::Isolate*, v8::internal::Handle<v8::internal::HeapObject>, v8::internal::Handle<v8::internal::FunctionTemplateInfo>, v8::internal::Handle<v8::internal::Object>, unsigned long*, int) [(redacted)/.nvm/versions/node/v20.5.1/bin/node]
13: 0x102d2914a v8::internal::Builtin_HandleApiCall(int, unsigned long*, v8::internal::Isolate*) [(redacted)/.nvm/versions/node/v20.5.1/bin/node]
14: 0x1036d5eb6 Builtins_CEntry_Return1_ArgvOnStack_BuiltinExit [(redacted)/.nvm/versions/node/v20.5.1/bin/node]
While using programmatic audio from non-standard api, ondata event in RTCAudioSink is never fired.
It is working in original source where this was forked from.
let sink= new RTCAudioSink(track);
sink.ondata= (data)=> {...}; //never fired
MacOS x64, node 18 lts, tested both installed from npm and local build
Looks like the compatability section in the readme needs an update. It is at least missing information on arm64 support for MacOS and Microsoft Windows.
It might be out of date overall.
https://github.com/WonderInventions/node-webrtc#supported-platforms
This is a tracking issue.
Installation of the package results in the following error:
➤ YN0007: │ @roamhq/wrtc@npm:0.7.3 must be built because it never has been before or the last one failed
➤ YN0009: │ @roamhq/wrtc@npm:0.7.3 couldn't be built successfully (exit code 127, logs can be found here: /see-below)
The build log looks as follows:
# This file contains the result of Yarn building a package (@roamhq/wrtc@npm:0.7.3)
# Script name: postinstall
command not found: patch-package
Installing the patch-package
package does not resolve the issue on my end. I believe this only happens when there are no prebuilt binaries available.
I think including patch-package
in dependencies
would resolve the issue. (or reconsidering whether patch-package
is necessary at all)
Arch Linux, kernel version: 6.8.7
CPU architecture: x64
npm version: 10.5.2
yarn version: 4.0.2
node version: 21.7.3
Hi Guys,
I am creating a docker image for a project that I am working on, and the docker file gets built correctly. However, when it goes to run, it spits out an error saying that it can't find the binary. Something is not working correctly
Dockerfile:
FROM --platform=linux/amd64 node:20-bullseye
WORKDIR /root
COPY package.json /root/package.json
COPY package-lock.json /root/package-lock.json
RUN apt-get update
RUN apt install -y cmake build-essential python-is-python3 pkg-config clang gn ninja-build
RUN apt-get install ffmpeg -y
RUN npm install --location=global @nestjs/cli
RUN npm install --location=global patch-package
RUN npm install
COPY . /root/
CMD nest start
Output when run:
nestjs-1 |
nestjs-1 | /root/node_modules/@roamhq/wrtc/lib/binding.js:24
nestjs-1 | throw new Error(`Could not find wrtc binary on any of the paths: ${paths_to_try}`);
nestjs-1 | ^
nestjs-1 | Error: Could not find wrtc binary on any of the paths: ../build-linux-x64/wrtc.node,../build-linux-x64/Debug/wrtc.node,../build-linux-x64/Release/wrtc.node,@roamhq/wrtc-linux-x64
nestjs-1 | at Object.<anonymous> (/root/node_modules/@roamhq/wrtc/lib/binding.js:24:9)
nestjs-1 | at Module._compile (node:internal/modules/cjs/loader:1358:14)
nestjs-1 | at Object.Module._extensions..js (node:internal/modules/cjs/loader:1416:10)
nestjs-1 | at Module.load (node:internal/modules/cjs/loader:1208:32)
nestjs-1 | at Function.Module._load (node:internal/modules/cjs/loader:1024:12)
nestjs-1 | at Module.require (node:internal/modules/cjs/loader:1233:19)
nestjs-1 | at require (node:internal/modules/helpers:179:18)
nestjs-1 | at Object.<anonymous> (/root/node_modules/@roamhq/wrtc/lib/index.js:23:5)
nestjs-1 | at Module._compile (node:internal/modules/cjs/loader:1358:14)
nestjs-1 | at Object.Module._extensions..js (node:internal/modules/cjs/loader:1416:10)
Any help would be much appreciated. I would also like to note that I have it working outside of Docker.
I'm unable to get it to work on Linux amd64, it segfaults when it exits.
reproducable code
import wrtc from "@roamhq/wrtc";
const conn = new wrtc.RTCPeerConnection();
conn.close();
that you can test with docker
docker run -v $PWD:/src node:18 /bin/sh -c 'cd /src && npm ci && node ./index.js'
here goes the gdb trace from inside docker
#0 0x0000000000d70503 in v8::HandleScope::HandleScope(v8::Isolate*) ()
#1 0x0000000000b59ee3 in node::ThreadPoolWork::ScheduleWork()::{lambda(uv_work_s*, int)#2}::_FUN(uv_work_s*, int) ()
#2 0x000000000166cb2d in uv__work_done (handle=0x532e650 <default_loop_struct+176>)
at ../deps/uv/src/threadpool.c:318
#3 0x0000000001671316 in uv__async_io (loop=0x532e5a0 <default_loop_struct>, w=<optimized out>,
events=<optimized out>) at ../deps/uv/src/unix/async.c:163
#4 0x0000000001683854 in uv__io_poll (loop=loop@entry=0x532e5a0 <default_loop_struct>,
timeout=<optimized out>) at ../deps/uv/src/unix/epoll.c:374
#5 0x0000000001671c7e in uv_run (loop=0x532e5a0 <default_loop_struct>, mode=UV_RUN_ONCE)
at ../deps/uv/src/unix/core.c:406
#6 0x0000000000b190e0 in node::Environment::CleanupHandles() ()
#7 0x0000000000b191ac in node::Environment::RunCleanup() ()
#8 0x0000000000ad4f4a in node::FreeEnvironment(node::Environment*) ()
#9 0x0000000000bdb7ad in node::NodeMainInstance::Run() ()
#10 0x0000000000b4dab8 in node::LoadSnapshotDataAndRun(node::SnapshotData const**, node::InitializationResult const*) ()
#11 0x0000000000b5161f in node::Start(int, char**) ()
it is probably the same issue as in node-webrtc#636; I was unable to build on linux (some missing linked symbols at loadtime) so it'll be hard for me to contribute but tell me if you need more info.
Hello @roamhq
I get this is probably not in your roadmap, so I'm sorry for bringing it up, but because I'm targeting a Docker image that can run on Apple Silicon using at least Node LTS, would it be a bad idea if for you to build for the linux/arm64 target for v18 and up?
In the meantime I'll try a cross-compile! 🥹
I totally get if you folks are simply too busy to reply or if anything else makes this impossible for you, and no worries at all, that's OK!--just thank you for making this wonderful updated library and for reading this far.
Since the last merge , the audio is completely broken with noises sound.
I just tried on my side to compile everything with the first solution presented to resolve ondata never fired
, it fixes , runtime is ok .
This may be unrelated to your project @duvallj but I just found I needed to try to build on CentOS 9 because:
Trying path /home/pro/BrowserBox/node_modules/@roamhq/wrtc-linux-x64/wrtc.node
Error: /lib64/libstdc++.so.6: version `GLIBCXX_3.4.30' not found (required by /home/pro/BrowserBox/node_modules/@roamhq/wrtc-linux-x64/wrtc.node)
at Module._extensions..node (node:internal/modules/cjs/loader:1473:18)
at Module.load (node:internal/modules/cjs/loader:1207:32)
at Module._load (node:internal/modules/cjs/loader:1023:12)
at Module.require (node:internal/modules/cjs/loader:1235:19)
at require (node:internal/modules/helpers:176:18)
at Object.<anonymous> (/home/pro/BrowserBox/node_modules/@roamhq/wrtc/lib/binding.js:18:22)
at Module._compile (node:internal/modules/cjs/loader:1376:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1435:10)
at Module.load (node:internal/modules/cjs/loader:1207:32)
at Module._load (node:internal/modules/cjs/loader:1023:12) {
code: 'ERR_DLOPEN_FAILED'
}
Uncaught:
Error: Could not find wrtc binary on any of the paths: ../build/wrtc.node,../build/Debug/wrtc.node,../build/Release/wrtc.node,./node_modules/@roamhq/wrtc-linux-x64,./node_modules/@roamhq/wrtc-linux-x64/wrtc.node
at Object.<anonymous> (/home/pro/BrowserBox/node_modules/@roamhq/wrtc/lib/binding.js:28:9)
I added some error output to binding.js to catch the issue. If search for versions I see:
[pro@vultr BrowserBox]$ strings /usr/lib64/libstdc++.so.6 | grep 'GLIBCXX_3.4'
GLIBCXX_3.4
GLIBCXX_3.4.1
GLIBCXX_3.4.2
GLIBCXX_3.4.3
GLIBCXX_3.4.4
GLIBCXX_3.4.5
GLIBCXX_3.4.6
GLIBCXX_3.4.7
GLIBCXX_3.4.8
GLIBCXX_3.4.9
GLIBCXX_3.4.10
GLIBCXX_3.4.11
GLIBCXX_3.4.12
GLIBCXX_3.4.13
GLIBCXX_3.4.14
GLIBCXX_3.4.15
GLIBCXX_3.4.16
GLIBCXX_3.4.17
GLIBCXX_3.4.18
GLIBCXX_3.4.19
GLIBCXX_3.4.20
GLIBCXX_3.4.21
GLIBCXX_3.4.22
GLIBCXX_3.4.23
GLIBCXX_3.4.24
GLIBCXX_3.4.25
GLIBCXX_3.4.26
GLIBCXX_3.4.27
GLIBCXX_3.4.28
GLIBCXX_3.4.29
So my latest CentOS 9 does not have the latest 3.4.30 libstdc++
I know it's not your problem, but do you know anything about this or how to fix it simply? (without a rebuild)?
Hello, would it be possible to remove this restriction that the bits per sample is exactly 16? More specially I'm hoping to use this library with a system that requires a value of 8 bits per sample.
Hey, thank you for maintaining this project. However, I have a few questions.
The LICENSE document's copyright notices have not been updated with the recent changes. Is this project under the same license?
Is it necessarily M94 which is around 3 years old by now or does it work with later versions too?
Thank you for your time.
Regards,
Rishikeshan.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.