-
-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Alexa and homebridge-zp #81
Comments
Note that the message is issued by homebridge itself, handling an otherwise uncaught exception.
That would appear to be a bug. What version of homebridge-zp are you on? And of node? And of homebridge? Best post the message homebridge-zp issues at startup.
It looks like homebridge-zp is handling the event from the zoneplayer for the next song. It probably contains some unexpected content that causes homebridge-zp to choke. It’s a ridiculously deep stack trace, due to recursive XML parsing (the XML response contains a string, which contains XML).
The alternative is for nodejs to crash on an uncaught exception. This way, homebridge-zp can cancel the subscriptions and homebridge can save persisted accessories. It’s probably a good idea to exit with a non-zero state in this case. |
Sorry for the delay. I understand the need to cancel the subscriptions and to be honest I'm thankful for it. I had so many problems with superfluous subscriptions that only disappeared completely when I had to turn off the main fuse of my apartment (huh?). But is another story. Meanwhile I made some tests with playlists. When I select the music source in the Sonos Controller with the mouse, for example from the iTunes library, homebridge-zp shows the change from one song to the next in the log. But if I choose a song via Amazon Music - My Music - Playlists, that doesn't happen. It also doesn't happen when I use Amazon Music - Radio Stations as my source. In the log it looks like this. I used a 70s party list, not because I want to hear this crap, but because the songs are short. Testing can be hell sometimes :-D
At this point I switched to my Amazon playlist:
And now to the Amazon Radio:
And back to the iTunes library:
Between "Disco Stomp" and "Learning to fly" I heard three songs via Amazon which don't show up in the log. Meanwhile the Sonos controller works as expected showing song name, interpret, and media art for all played music. I also tested with Sonos playlists and TuneIn radio with no unexpected logging. I always use pretty new versions of node LTS and homebridge. Actually this is: Is there a better way for me to debug this? Stefan |
That confirms my suspicion that homebridge-zp chokes while reading the song info.
Can you patch homebridge-zp/lib/ZpAccessory.js Line 576 in 4fb531c
and commenting homebridge-zp/lib/ZpAccessory.js Line 618 in 4fb531c
And run |
Here is what I have so far: Adjusting the volume via Sonos controller on my Mac:
"Alexa, play funk music."
Next song starts:
The second song has two log lines which the first song does not have. All following songs have these two lines too. But I'm a bit overwhelmed with the amount of information. I guess it's easier for you to read and rate that. Stefan |
Welcome to my world. And for these messages the XML sent by the ZonePlayer has already been converted to JSON...
The I'm right in the middle of refactoring homebridge-zp to use the dynamic platform accessory model (see #1), so it might be a while before I can fix this. |
Take your time. My javascript knowledge is too low to understand your entire code, but it was sufficient to add a small if condition to the correct place. This little patch solves my problem for now. I'm looking forward to your new code. |
Works with homebridge-zp v1.0.0. Thanks |
Hi Erik,
I have a strange behavior with homebridge-zp and Amazon's Alexa. Every time I play music on my SONOS system using my Echo Dot ("Alexa, play funk music in the living room") homebridge-zp stops the Homebridge. For instance:
"Alexa, play funk music in the living room."
Music is starting. The homebridge log shows normal operation.
The songs ends. The next song from Alexa's funk playlist is started automatically. This causes:
Homebridge doesn't crash but is stopped ("Got SIGTERM") and must be restarted manually as there is no reason for systemctl for restart it. While the music is playing further on, homebridge starts and goes to normal operation. Right until the song ends and the next is started. Bang. This behavior can be reproduced on my setup easily.
This never happens with the first song of the playlist, but with all following. If I restart homebridge while the music is playing, it will be stopped with the beginning of the next song.
At the same time the Sonos controller runs smoothly and shows the song's title, interpret and media art, one after the other while the play list is being played.
This is how I configured homebridge-zp:
I own a Sonos Playbar and two Play:1s that form a group. I have no other Sonos devices. Any idea?
Gruß,
Stefan
The text was updated successfully, but these errors were encountered: