openairplay / node_airtunes

node.js AirTunes v2 implementation: stream wirelessly to Apple audio devices.
BSD 2-Clause "Simplified" License
273 stars 84 forks source link

Socket is already bound error #48

Open ajkessel opened 5 years ago

ajkessel commented 5 years ago

I'm unable to build the latest release here on Debian ( per #45 ), but I was able to build Rotvig's patched version which appears to address the build issues at https://github.com/Rotvig/node_airtunes . Whenever I try one of the example scripts, however, I get this error:

adding device: 192.168.98.161:5000
dgram.js:165
    throw new ERR_SOCKET_ALREADY_BOUND();
    ^

Error [ERR_SOCKET_ALREADY_BOUND]: Socket is already bound
    at Socket.bind (dgram.js:165:11)
    at /mnt/md0/home/adam/node_modules/airtunes/lib/udp_servers.js:130:23
    at next (/mnt/md0/home/adam/node_modules/async/dist/async.js:5223:28)
    at Socket.<anonymous> (/mnt/md0/home/adam/node_modules/airtunes/lib/udp_servers.js:116:11)
    at Object.onceWrapper (events.js:273:13)
    at Socket.emit (events.js:182:13)
    at state.handle.lookup (dgram.js:243:14)
    at process._tickCallback (internal/process/next_tick.js:63:19)
    at Function.Module.runMain (internal/modules/cjs/loader.js:745:11)
    at startup (internal/bootstrap/node.js:283:19)

Any suggestions for troubleshooting?

FrancisHGR commented 5 years ago

In my opinion, this happens to me if the same process is already running - meaning if arecord is already recording and I'd like to start a second process. Check the use of your processes I'd propose.

jens62 commented 3 years ago

It happened to me when running pulseaudio parallel. I stopped pulseaudio with systemctl --user stop pulseaudio.socket and then node_aitunes worked.