stephen / airsonos

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

Invalid key length error which selecting paired Sonos speaker #371

Closed jsnhff closed 7 years ago

jsnhff commented 7 years ago

Hi Stephen,

Love that you did this hack, thank you so much : )

I just successfully installed airsonos and it paired with my speaker! I know this because the speaker, named Kitchen, appears in my mac preferences as an audio output device. The trouble happens when I select Kitchen as my audio output device. As soon as I do, I get this error in terminal:

` ~§ airsonos Searching for Sonos devices on network...

Kitchen (@ 10.0.1.6:1400, RINCON_5CAAFD7AD50401400:0)

Search complete. Set up 1 device tunnel. crypto.js:241 this._handle.initiv(cipher, toBuf(key), toBuf(iv));

Error: Invalid key length at new Decipheriv (crypto.js:241:16) at Object.Decipheriv (crypto.js:238:12) at Object.decryptAudioData (/usr/local/lib/node_modules/airsonos/node_modules/nodetunes/lib/helper.js:141:25) at RtpServer. (/usr/local/lib/node_modules/airsonos/node_modules/nodetunes/lib/rtp.js:32:23) at emitTwo (events.js:106:13) at Socket.emit (events.js:191:7) at UDP.onMessage [as onmessage] (dgram.js:547:8)`

Perhaps sonos changed their key lengths for newer models? Can you help me trouble shoot this, I'm a junior level hacker.

Happy to send you some beer money, jsnhff

jsnhff commented 7 years ago

Fix is here: https://github.com/stephen/airsonos/issues/316#issuecomment-255663049