feross / simple-peer

📡 Simple WebRTC video, voice, and data channels
MIT License
7.36k stars 972 forks source link

Raspberry Pi 3B WRTC=electron-webrtc, test/basic.js fails #295

Closed Stupid-Git closed 6 years ago

Stupid-Git commented 6 years ago

I thought I would have a look at using "electron-webrtc" over node-wrtc on the Raspberry Pi because building the libwebrtc for arm was a pain. My platform: RPi 3B, node -v => 8.9.4, npm -v => 5.6.0

Below is the output for running the basic.js test:

pi@raspberrypi:~/github/feross/simple-peer$ WRTC=electron-webrtc node test/basic.js TAP version 13 # get config # detect WebRTC support ok 1 builtin webrtc support # create peer without options ok 2 Skip no-option test in Node.js, since the wrtc option is required # data send/receive text events.js:183 throw er; // Unhandled 'error' event ^

Error: electron-eval error: Electron process exited with code 2 at ChildProcess. (/home/pi/github/feross/simple-peer/node_modules/electron-eval/lib/index.js:174:22) at emitTwo (events.js:126:13) at ChildProcess.emit (events.js:214:7) at maybeClose (internal/child_process.js:925:16) at Socket.stream.socket.on (internal/child_process.js:346:11) at emitOne (events.js:116:13) at Socket.emit (events.js:211:7) at Pipe._handle.close [as _onclose] (net.js:554:12) pi@raspberrypi:~/github/feross/simple-peer$ (Note: $npm run test-node-electron-webrtc gives same result)

Looking at node_modules/electron-eval/lib/index.js we can see that _this5.closing is not set 170: this.child.on('close', function (code) { 171: if (_this5.closing) return; 172: var err = 'electron-eval error: Electron process exited with code ' + code; 173: if (exitStderr) err += '.\nStderr:\n' + exitStderr; 174: _this5.error(new Error(err)); 175: });

I got the same bad result for 'master' and tag 'v9.0.0'

A possibly similar issue is here

https://github.com/webtorrent/webtorrent/issues/1075

Also 1) $ WRTC=wrtc node test/basic.js does pass. 2) On a Debian 9 64bit VM, ...simple-peer$ WRTC=wrtc node test/basic.js - runs to completion ...simple-peer$ WRTC=electron-webrtc node test/basic.js - freezes after "ok 30 peer2 destroyed"

t-mullen commented 6 years ago

Try getting electron-eval to work on a Raspberry PI first.

https://github.com/mappum/electron-eval

If you have the same issues when using it by itself, I'd open an issue in that repository. We aren't able to help you here since we didn't author either library, but I'd definitely be interested in seeing WebRTC on PI.