mots wrote: 
> 
> If I do something like "resume living room music", rhasspy will detect
> that and try to continue playback on the relevant player. However, it
> will also send a "request recognized" sound to the squeezebox using
> aforementioned rhasspy plugin that uses this LMS plugin.
> This will end up in a race condition where the announce sound is what's
> happening while the play command comes in and so nothing really happens.
> The notification sound finishes playing and after that, the music still
> won't play.
> I think to fix this, we'd need a queue for API requests coming in while
> the notification sound is playing. When we restore the play queue, we
> could then work off the command queue.
> 
since LMS can only process one http GET at a time, it will queue in any
case. However, the plugin will return from the call as soon as the
announcement starts to play (otherwise, it would block the server)
See also the previous posts on this page for related info.

I suspect the race condition is
- rhasspy sends "announce" command
- plugin saves player state (paused) and returns
- rhasspy sends "play" command
- plugin finished announcement and restored player state (paused)

to test: 
- check in which order the "announce" and "play" calls are sent by
rhasspy
- check in which order the "announce" and "play" calls are received /
processed by LMS
- switch the plugin's log level to debug, and check the log for:

Code:
--------------------
    Plugins::LMSannounce::Plugin::playlistStoppedCallback (267) 
playlistStoppedCallback: playerid=XXX tmppls=tempplaylist_XXX 
time=180.657458284378 power=1 mode=pause
--------------------



'Various SW' (https://www.nexus0.net/pub/sw/): Web Interface | TUI |
Playlist Editor / Generator | Music Classification | Similar Music |
Announce | EventTrigger | DB Optimizer | Image Enhancer | Chiptunes |
LMSlib2go | ...
'Various HowTos' (https://www.nexus0.net/pub/documents/LMS/): build a
self-contained LMS | Bluetooth/ALSA | Control LMS with any device | ...
------------------------------------------------------------------------
Roland0's Profile: http://forums.slimdevices.com/member.php?userid=56808
View this thread: http://forums.slimdevices.com/showthread.php?t=109096

_______________________________________________
plugins mailing list
plugins@lists.slimdevices.com
http://lists.slimdevices.com/mailman/listinfo/plugins

Reply via email to