stephen / airsonos

:musical_note: AirPlay to Sonos
MIT License
2.1k stars 255 forks source link

Crashes when playing on Iphone #352

Open Mavrick69 opened 7 years ago

Mavrick69 commented 7 years ago

Im very new to all this so please remember that..

I have made the previous changed to helper.js and it now works from my mac, but on the iphone when i select a sonos i get the below error when it starts to play

/usr/local/lib/node_modules/airsonos/node_modules/nodetunes/lib/rtspmethods.js:233 debug('uncaptured SET_PARAMETER method: %s', req.content.toString().trim()); ^

TypeError: Cannot read property 'toString' of undefined at setParameter (/usr/local/lib/node_modules/airsonos/node_modules/nodetunes/lib/rtspmethods.js:233:63) at RtspServer. (/usr/local/lib/node_modules/airsonos/node_modules/nodetunes/lib/rtsp.js:60:7) at emitTwo (events.js:106:13) at ServerParser.emit (events.js:191:7) at ServerParser._emitMessage (/usr/local/lib/node_modules/airsonos/node_modules/httplike/lib/server-parser.js:28:8) at ServerParser.Parser._write (/usr/local/lib/node_modules/airsonos/node_modules/httplike/lib/parser.js:91:14) at doWrite (_stream_writable.js:334:12) at writeOrBuffer (_stream_writable.js:320:5) at ServerParser.Writable.write (_stream_writable.js:247:11) at Socket.ondata (_stream_readable.js:555:20) at emitOne (events.js:96:13) at Socket.emit (events.js:188:7) at readableAddChunk (_stream_readable.js:176:18) at Socket.Readable.push (_stream_readable.js:134:10) at TCP.onread (net.js:548:20)

Mavrick69 commented 7 years ago

the above was from the automator so not sure if thats any good. the below is from the terminal window.

Searching for Sonos devices on network...

Kitchen (@ 192.168.0.35:1400, RINCON_949F3E724E5201400:0) Living Room (@ 192.168.0.36:1400, RINCON_949F3E22BCE401400:0)

Search complete. Set up 2 device tunnels. /usr/local/lib/node_modules/airsonos/node_modules/nodetunes/lib/rtspmethods.js:233 debug('uncaptured SET_PARAMETER method: %s', req.content.toString().trim()); ^

TypeError: Cannot read property 'toString' of undefined at setParameter (/usr/local/lib/node_modules/airsonos/node_modules/nodetunes/lib/rtspmethods.js:233:63) at RtspServer. (/usr/local/lib/node_modules/airsonos/node_modules/nodetunes/lib/rtsp.js:60:7) at emitTwo (events.js:106:13) at ServerParser.emit (events.js:191:7) at ServerParser._emitMessage (/usr/local/lib/node_modules/airsonos/node_modules/httplike/lib/server-parser.js:28:8) at ServerParser.Parser._write (/usr/local/lib/node_modules/airsonos/node_modules/httplike/lib/parser.js:91:14) at doWrite (_stream_writable.js:334:12) at writeOrBuffer (_stream_writable.js:320:5) at ServerParser.Writable.write (_stream_writable.js:247:11) at Socket.ondata (_stream_readable.js:555:20) at emitOne (events.js:96:13) at Socket.emit (events.js:188:7) at readableAddChunk (_stream_readable.js:176:18) at Socket.Readable.push (_stream_readable.js:134:10) at TCP.onread (net.js:548:20)

kdaveid commented 7 years ago

Hi there! First off, I this project still maintained? Second, I have the same issue. Node 5.8.0 NPM 3.7.3. Yesterday I updated Sonos Controller to 7.1. Any advice greatly appreciated. Thanks for OSS!

COngstad commented 7 years ago

I ran into the same issue and modified line 233 in the file /usr/local/lib/node_modules/airsonos/node_modules/nodetunes/lib/rtspmethods.js to the following

/debug('uncaptured SET_PARAMETER method: %s', req.content.getHeader('Content-Type')); / debug('uncaptured SET_PARAMETER method: ');

Mavrick69 commented 7 years ago

ok I can open the file and edit it, but i cant save it. "/usr/local/lib/node_modules/airsonos/node_modules/nodetunes/lib/rtspmethods.js" E212: Can't open file for writing

how do i fix this one ?

Mavrick69 commented 7 years ago

aha had to use sudo vim

ok it works, but i do get this now...

Searching for Sonos devices on network...

Living Room (@ 192.168.0.36:1400, RINCON_949F3E22BCE401400:0) Kitchen (@ 192.168.0.35:1400, RINCON_949F3E724E5201400:0)

Search complete. Set up 2 device tunnels. strange error flushing buffer ...

Nice error message.....