Playback not resuming after announcement

Posted on
Mon May 02, 2016 8:17 pm
rapamatic offline
Posts: 166
Joined: Aug 03, 2015
Location: Glencoe, IL

Playback not resuming after announcement

I am running the latest plugin, indigo, and sonos firmware.

When I play an announcement on either standalone devices or devices in groups, they do not resume playback. If the device that plays an announcement is part of a group, the other speakers in that group continue playing, but that speaker does not re-join the group after the announcement. If the device was playing music standalone, it also does not resume playing the music... interestingly, the queue is restored for the device, but it does not play, and in fact appears in the stopped state, vs paused (I can see the queue, but there is no play button in the sonos controller apps...)

Here are some log files from when I play an announcement. Any ideas?

Code: Select all
May 2, 2016, 9:12:42 PM
  Trigger                         Back Door Motion
  Sonos                           Announcement: FILE [approaching_back_door.mp3], Volume: 40
  Sonos                           remove zone from group: Sonos: Kitchen
  Sonos                           remove zone from group: Sonos: Basement
  Sonos                           remove zone from group: Sonos: Patio
  Sonos                           ZonePlayer: Sonos: Kitchen, Stop
  Sonos                           ZonePlayer: Sonos: Kitchen, Current Volume: 40, New Volume: 40
  Sonos                           ZonePlayer: Sonos: Basement, Current Volume: 40, New Volume: 40
  Sonos                           ZonePlayer: Sonos: Patio, Current Volume: 32, New Volume: 40
  Sonos                           Announcement Length: 3.8134
  Sonos                           ZonePlayer: Sonos: Kitchen, Play
  Sonos                           remove zone from group: Sonos: Kitchen
  Sonos                           remove zone from group: Sonos: Basement
  Sonos                           remove zone from group: Sonos: Patio
  Sonos                           ZonePlayer: Sonos: Kitchen, Clear Queue
  Sonos                           ZonePlayer: Sonos: Basement, Clear Queue
  Sonos                           ZonePlayer: Sonos: Patio, Clear Queue

May 2, 2016, 9:13:12 PM
  Sonos                           ZonePlayer: Sonos: Library, Cannot Save Queue for Slave
  Trigger                         Back Door Motion
  Sonos                           Announcement: FILE [approaching_back_door.mp3], Volume: 40
  Sonos                           remove zone from group: Sonos: Kitchen
  Sonos                           remove zone from group: Sonos: Basement
  Sonos                           remove zone from group: Sonos: Patio
  Sonos                           ZonePlayer: Sonos: Kitchen, Stop
  Sonos                           ZonePlayer: Sonos: Kitchen, Current Volume: 40, New Volume: 40
  Sonos                           ZonePlayer: Sonos: Basement, Current Volume: 40, New Volume: 40
  Sonos                           ZonePlayer: Sonos: Patio, Current Volume: 32, New Volume: 40
  Sonos                           Announcement Length: 3.8134
  Sonos                           ZonePlayer: Sonos: Kitchen, Play
  Sonos                           remove zone from group: Sonos: Kitchen
  Sonos                           remove zone from group: Sonos: Basement
  Sonos                           remove zone from group: Sonos: Patio
  Sonos                           ZonePlayer: Sonos: Kitchen, Clear Queue
  Sonos                           ZonePlayer: Sonos: Basement, Clear Queue
  Sonos                           ZonePlayer: Sonos: Patio, Clear Queue

Posted on
Tue Aug 16, 2016 3:53 am
MarcoGT offline
Posts: 566
Joined: Sep 11, 2014
Location: Germany

Re: Playback not resuming after announcement

I have a similar problem, sometimes after MP3 annoucement, it does not resume, but this does not always happen.
I have only one Play:1 so I cannot say how it works with group/ungroup.

Posted on
Tue Aug 16, 2016 7:03 am
rapamatic offline
Posts: 166
Joined: Aug 03, 2015
Location: Glencoe, IL

Re: Playback not resuming after announcement

Nick - there has been a lot of discussion on the SoCo repository about scripts for notifications, taking snapshots, etc. and it appears they may be getting ready to push out a new release that incorporates some of these changes. Maybe it would be a good idea to check that out and maybe it will solve some of the announcement problems?

From what I can see, your announcement code doesn't take a snapshot right before the announcement, but relies on the status of the sonos players being actively and properly monitored by the plugin. When that gets messed up (due to either an issue with the code, or network issues (as I think is the case in my situation), then the app doesn't have accurate state information, and that's why playback doesn't resume, or speakers that were paused start playing after an announcement. Maybe changing the code to take snapshots immediately before the announcement? I just don't know how much of a delay this would introduce....

Posted on
Tue Aug 16, 2016 11:19 am
nlagaros offline
Posts: 1585
Joined: Dec 20, 2010

Re: Playback not resuming after announcement

Thanks for taking the time to comment. I'm very familiar with SoCo. I actually use their libraries with enhancements to subscribe to ZonePlayer updates. I've also contributed to the codebase. Some of the code they have likely originated from my plugin.

There is a significant amount of logic required to maintain state of the ZonePlayers when dealing with announcements - this is one of the side projects that community has recently been talking about. It will likely not be part of the main codebase. The issue is that I am doing unusual things to update the Indigo device for each ZonePlayer that is part of a group. Selective states have to be replicated to properly indicate what is going on.

Snapshots are a very expensive operation. I've gone through several iterations over the past five years to make the code as lightweight as possible. In fact I do snapshots to preserve the queues - which I think is pretty cool - when their condition changes. Therefore the queue can be properly restored after an announcement for a slave ZonePlayer. The Sonos app does not do this all the time when grouping/ungrouping. I've taken the time to find a couple more bugs that should help reduce the number of issues with the group announcement. Please give the latest release a shot and see if there are improvements. I'm sorry this has been painful for you and many -- the logic is pretty complex (well not really, but it is.. ha!).

I've also recently added logic to resubscribe to ZonePlayer events when there are network outages. I'm going to take it a step further in a future release to make it even more bullet proof.

Anyways.. I continue to search for errors/bugs in the code and think that is the best approach to getting this right.

rapamatic wrote:
Nick - there has been a lot of discussion on the SoCo repository about scripts for notifications, taking snapshots, etc. and it appears they may be getting ready to push out a new release that incorporates some of these changes. Maybe it would be a good idea to check that out and maybe it will solve some of the announcement problems?

From what I can see, your announcement code doesn't take a snapshot right before the announcement, but relies on the status of the sonos players being actively and properly monitored by the plugin. When that gets messed up (due to either an issue with the code, or network issues (as I think is the case in my situation), then the app doesn't have accurate state information, and that's why playback doesn't resume, or speakers that were paused start playing after an announcement. Maybe changing the code to take snapshots immediately before the announcement? I just don't know how much of a delay this would introduce....

Posted on
Tue Aug 16, 2016 11:20 am
nlagaros offline
Posts: 1585
Joined: Dec 20, 2010

Re: Playback not resuming after announcement

I posted an update (v0.9.9) that may help. Please give it a shot.

MarcoGT wrote:
I have a similar problem, sometimes after MP3 annoucement, it does not resume, but this does not always happen.
I have only one Play:1 so I cannot say how it works with group/ungroup.

Posted on
Tue Aug 16, 2016 11:26 am
rapamatic offline
Posts: 166
Joined: Aug 03, 2015
Location: Glencoe, IL

Re: Playback not resuming after announcement

Sounds good - I'll update my code later today and let you know how it goes. Glad to have you back working on this - I had tried taking a look at the code and my brain turned to jello!

I've been contemplating whether it makes sense to have a simplified plugin just for announcements, that removes some of the overhead from album art, monitoring status, etc... Based on your comments though, it sounds like snapshots are too costly, and any announcement-only plugin would be very slow since it has to record snapshots before playing an announcement... Is that the right way to think about this?

-Ray

Posted on
Tue Aug 16, 2016 11:56 am
nlagaros offline
Posts: 1585
Joined: Dec 20, 2010

Re: Playback not resuming after announcement

I actually do isolate the Group Announcement action and stop everything else that goes on to run it. I think the toughest part of dealing with the plugin has been all the lower level networking required to get updates from the ZonePlayers. I had been constrained by Python 2.5 for the longest time and was able to update to 2.6 when Matt & Jay updated Indigo. That helped a lot. If everyone was running the latest version of MacOS and Indigo, life would be just a little simpler.

Anyways .. no need for me to ramble. If we can't work out the issue over the next update or two, I'm happy for you to try to rip the plugin apart. I'll help as much as I can. My biggest fault with this over the years has been lack of documentation. Every time I sit down to start, I end up working on the code - typical hack that I am. That I can use much help with.

rapamatic wrote:
Sounds good - I'll update my code later today and let you know how it goes. Glad to have you back working on this - I had tried taking a look at the code and my brain turned to jello!

I've been contemplating whether it makes sense to have a simplified plugin just for announcements, that removes some of the overhead from album art, monitoring status, etc... Based on your comments though, it sounds like snapshots are too costly, and any announcement-only plugin would be very slow since it has to record snapshots before playing an announcement... Is that the right way to think about this?

-Ray

Posted on
Tue Aug 16, 2016 11:24 pm
MarcoGT offline
Posts: 566
Joined: Sep 11, 2014
Location: Germany

Re: Playback not resuming after announcement

nlagaros wrote:
I posted an update (v0.9.9) that may help. Please give it a shot.


Thanks a lot, I will give it a try next weekend if I have time :)

Posted on
Mon Mar 12, 2018 2:01 pm
Christian777 offline
Posts: 3
Joined: Mar 08, 2018

Re: Playback not resuming after announcement

MarcoGT wrote:
I have a similar problem, sometimes after MP3 annoucement, it does not resume, but this does not always happen.
I have only one Play:1 so I cannot say how it works with group/ungroup.


Hi, Im having a similar problem! it does resume after the announcement but it plays a different song because it stops instead of pausing, any suggestions?
Last edited by Christian777 on Mon Mar 12, 2018 2:10 pm, edited 1 time in total.

Posted on
Mon Mar 12, 2018 2:05 pm
nlagaros offline
Posts: 1585
Joined: Dec 20, 2010

Re: Playback not resuming after announcement

Are you on the most current version of the plugin? Can you do some testing with debugging turned on?

Christian777 wrote:
MarcoGT wrote:
I have a similar problem, sometimes after MP3 annoucement, it does not resume, but this does not always happen.
I have only one Play:1 so I cannot say how it works with group/ungroup.


Hi, Im having the same problem! it does not resume after the announcement any suggestions?

Posted on
Wed Mar 14, 2018 1:19 pm
pmgendon offline
Posts: 35
Joined: Apr 20, 2015

Re: Playback not resuming after announcement

I'm using plugin version 1.0.10 and I'm having a similar issue

Code: Select all
   Sonos                           ZonePlayer: Sonos - playbar - salon, Current Volume: 34, New Volume: 30
   Sonos                           Announcement Length: 1.752
   Sonos                           ZonePlayer: Sonos - playbar - salon, Play
   Sonos                           remove zone from group: Sonos - playbar - salon
   Sonos                           ZonePlayer: Sonos - playbar - salon, Clear Queue
   Sonos Error                     Error in plugin execution ExecuteAction:

Traceback (most recent call last):
  File "plugin.py", line 198, in actionZP_announcementMP3
  File "/Library/Application Support/Perceptive Automation/Indigo 7/Plugins/Sonos.indigoPlugin/Contents/Server Plugin/Sonos.py", line 2054, in actionAnnouncement
UnboundLocalError: local variable 'l2p' referenced before assignment

   Sonos Error                     UPNP Error: No Such Object
   Sonos Error                     Offending Command -> zoneIP: 192.168.1.202, soapRoot: /MediaRenderer, soapBranch: /AVTransport, soapAction: Play

Posted on
Wed Mar 14, 2018 3:42 pm
nlagaros offline
Posts: 1585
Joined: Dec 20, 2010

Re: Playback not resuming after announcement

pmgendon wrote:
I'm using plugin version 1.0.10 and I'm having a similar issue

Code: Select all
   Sonos                           ZonePlayer: Sonos - playbar - salon, Current Volume: 34, New Volume: 30
   Sonos                           Announcement Length: 1.752
   Sonos                           ZonePlayer: Sonos - playbar - salon, Play
   Sonos                           remove zone from group: Sonos - playbar - salon
   Sonos                           ZonePlayer: Sonos - playbar - salon, Clear Queue
   Sonos Error                     Error in plugin execution ExecuteAction:

Traceback (most recent call last):
  File "plugin.py", line 198, in actionZP_announcementMP3
  File "/Library/Application Support/Perceptive Automation/Indigo 7/Plugins/Sonos.indigoPlugin/Contents/Server Plugin/Sonos.py", line 2054, in actionAnnouncement
UnboundLocalError: local variable 'l2p' referenced before assignment

   Sonos Error                     UPNP Error: No Such Object
   Sonos Error                     Offending Command -> zoneIP: 192.168.1.202, soapRoot: /MediaRenderer, soapBranch: /AVTransport, soapAction: Play

Posted on
Wed Mar 14, 2018 3:43 pm
nlagaros offline
Posts: 1585
Joined: Dec 20, 2010

Re: Playback not resuming after announcement

What exact source were you playing before the announcement? Would help to do this again with debugging turned on? Thx.



nlagaros wrote:
pmgendon wrote:
I'm using plugin version 1.0.10 and I'm having a similar issue

Code: Select all
   Sonos                           ZonePlayer: Sonos - playbar - salon, Current Volume: 34, New Volume: 30
   Sonos                           Announcement Length: 1.752
   Sonos                           ZonePlayer: Sonos - playbar - salon, Play
   Sonos                           remove zone from group: Sonos - playbar - salon
   Sonos                           ZonePlayer: Sonos - playbar - salon, Clear Queue
   Sonos Error                     Error in plugin execution ExecuteAction:

Traceback (most recent call last):
  File "plugin.py", line 198, in actionZP_announcementMP3
  File "/Library/Application Support/Perceptive Automation/Indigo 7/Plugins/Sonos.indigoPlugin/Contents/Server Plugin/Sonos.py", line 2054, in actionAnnouncement
UnboundLocalError: local variable 'l2p' referenced before assignment

   Sonos Error                     UPNP Error: No Such Object
   Sonos Error                     Offending Command -> zoneIP: 192.168.1.202, soapRoot: /MediaRenderer, soapBranch: /AVTransport, soapAction: Play

Posted on
Wed Mar 14, 2018 8:25 pm
pmgendon offline
Posts: 35
Joined: Apr 20, 2015

Re: Playback not resuming after announcement

nlagaros wrote:
What exact source were you playing before the announcement? Would help to do this again with debugging turned on? Thx.



nlagaros wrote:
pmgendon wrote:
I'm using plugin version 1.0.10 and I'm having a similar issue

Code: Select all
   Sonos                           ZonePlayer: Sonos - playbar - salon, Current Volume: 34, New Volume: 30
   Sonos                           Announcement Length: 1.752
   Sonos                           ZonePlayer: Sonos - playbar - salon, Play
   Sonos                           remove zone from group: Sonos - playbar - salon
   Sonos                           ZonePlayer: Sonos - playbar - salon, Clear Queue
   Sonos Error                     Error in plugin execution ExecuteAction:

Traceback (most recent call last):
  File "plugin.py", line 198, in actionZP_announcementMP3
  File "/Library/Application Support/Perceptive Automation/Indigo 7/Plugins/Sonos.indigoPlugin/Contents/Server Plugin/Sonos.py", line 2054, in actionAnnouncement
UnboundLocalError: local variable 'l2p' referenced before assignment

   Sonos Error                     UPNP Error: No Such Object
   Sonos Error                     Offending Command -> zoneIP: 192.168.1.202, soapRoot: /MediaRenderer, soapBranch: /AVTransport, soapAction: Play


I was playing Spotify, directly from the Spotify client. I fried my insteon modem while testing some other issues. I’ll try with debug on when I’ll receive the replacement unit.

Cheers,

pm

Posted on
Thu Mar 15, 2018 7:36 am
nlagaros offline
Posts: 1585
Joined: Dec 20, 2010

Re: Playback not resuming after announcement

Spotify is a source I have not done any work on. I do not have Spotify Premium to test with. If anyone is willing to loan me credentials for a few days, I can try to add support.

Who is online

Users browsing this forum: No registered users and 2 guests