AudioNet / node-core-audio

Bindings for PortAudio giving JavaScript access to sound card samples (mostly unmaintained)
MIT License
330 stars 68 forks source link

Error in NodeCoreAudio.node on Raspberry Pi #21

Closed gemaedp closed 10 years ago

gemaedp commented 10 years ago

Hello I tried install node-core-audio on a Raspberry Pi with O.S. Raspbian, but it failed. Initially I could not compile because libportaudio.a was not compatible with raspbian:

ERROR: /usr/bin/ld:/home/pi/NodeCoreAudio/node_modules/node-core-audio/gyp/lib/libportaudio.a: file format not recognized; treating as linker script

make: *\ [Release/obj.target/NodeCoreAudio.node] Error 1 make: Leaving directory /home/pi/NodeCoreAudio/node_modules/node-core-audio/build' gyp ERR! build error gyp ERR! stack Error:make` failed with exit code: 2 gyp ERR! stack at ChildProcess.onExit (/opt/node/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:267:23) gyp ERR! stack at ChildProcess.EventEmitter.emit (events.js:98:17) gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:789:12) gyp ERR! System Linux 3.6.11+ gyp ERR! command "node" "/opt/node/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild" gyp ERR! cwd /home/pi/NodeCoreAudio/node_modules/node-core-audio gyp ERR! node -v v0.10.17 gyp ERR! node-gyp -v v0.10.9 gyp ERR! not ok npm ERR! weird error 1 npm ERR! not ok code 0 .........

But I after could compile installing portaudio19-dev of architecture armhf from the raspbian repository. I copied /usr/lib/arm-linux-gnueabihf/libportaudio.a to node-core-audio-master/gyp/lib and all fine. But when i try to run a test file(simpletest.js, secondtest.js) I got an error, for example if I run : node simpletest.js

this is the result:

{ inputChannels: 1, outputChannels: 2 } About to create the audio engine Caught exception: Error: /home/pi/NodeCoreAudio/newCoreAudio/node-core-audio-master/build/Release/NodeCoreAudio.node: undefined symbol: snd_pcm_open Child process exited with exit code 0 Child process exited with exit code 0 Child Process STDOUT: v0.10.17

Child Process STDOUT: /opt/node/bin/node

.......

I'm getting this error with NodeCoreAudio.node and I dont't understand what that means: snd_pcm_open

It's possible to run this library in a Raspberry Pi and to capture audio from a audio card USB?

ZECTBynmo commented 10 years ago

Wow cool! I've never tried this on Rasberry Pi, but hopefully we can get it to work!

That error seems like it might be because you're missing libasound, try linking that and see what happens. http://www.qnx.com/developers/docs/6.5.0/index.jsp?topic=%2Fcom.qnx.doc.neutrino_audio%2Flibs%2Fsnd_pcm_open.html

oscmejia commented 10 years ago

Hey Mike, this sounds interesting hah?? Quick question, what is the output of the module, when it captures audio, does it output a audio buffer? Can this module stream audio in real time to a mobile device? if so, what would be the strategy to ready it and play back?

Thanks.

ZECTBynmo commented 10 years ago

Your audio callbacks get called with an input buffer, and return an output buffer. You can do whatever you want in the middle, so you could certainly stream the buffers to another PC, but for now that's outside the scope of node-core-audio.

ZECTBynmo commented 10 years ago

Closing this for now. Please create a new issue if you're still having problems. Thanks!