I’m using playSound as part of the Squeezebox binding to play mp3 based notifications like… “The garage door is still open”.
I’m noticing that after the mp3 is played if a song was playing it resumes at the right time in the track but a COMPLETELY random track in the currently playlist on the squeezebox.
Anyone know if this is a known issue or have a fix for it?
Is this happening when you are playing a playlist containing local music files (versus a streaming source like Pandora, Spotify, etc.)?
There may be an issue with the order in which the player state is being restored after the notification completes. I’ll take a look at this. Unfortunately, I’ve found the LMS to be a bit (for lack of a better word) squirrelly when restoring the player state after the notification completes.
So, the way the LMS seems to work… Say you have shuffle by song enabled (haven’t tested shuffle by album yet) and you’re on track index 20 of a playlist (i.e. that’s the playlist index of the currently playing song). Disabling and reenabling shuffle mode seems to place the currently playing song at playlist index 0.
I’m going to test a change that restores the index to 0 when shuffle mode is enabled.
Edit: Well, that didn’t work. Adding an item (i.e. the notification) to the playlist and playing it invalidates the above behavior.
When playing a playlist of local music, another possibility is to try using the playlist save, playlist clear, and playlist resume commands. I’ve never used those before, and it likely would involve a bit more rework. I’ll take a look at that when I get a little more time.
Right. The notification goes at the end of the playlist, then the last item in the playlist is played. When the notification is complete the player stops, after which the state is restored. If the notification is not at the end, the next song after the notification will start playing immediately, which is not desirable, nor is it easy to detect.
Of course, there may be a completely different way to do this using the LMS CLI, but I haven’t found it yet…
@mhilbush, just upgraded to 2.3.0 today and if my squeezebox is playing a list of random songs then when it resumes after a speak notification it is still not resuming the same track…
Did you think you had resolved this?
Hi This is somehow offtopic, but I don’t want to rise another one unnecessarily. @mhilbush is this possible from binding to clear the current playlist of particular squeezebox player?
The API has a playlist clear function. The binding might be able to implement this as a Thing action that could be called from a rule.
<playerid> playlist clear
The "playlist clear" command removes any song that is on the playlist. The player is stopped.
Examples:
Request: "04:20:00:12:23:45 playlist clear<LF>"
Response: "04:20:00:12:23:45 playlist clear<LF>"
Hi Mark,
I’ve going back to this after some time and I don’t understand how can I implement this.
My problem is that I use squeezebox player in my hallway also as a Doorbell.
The problem is that while something is played on my hallway player (PiCoreplayer) (e.g. some internet radio) someone can trigger a doorbell.
When it happens, in theory I would expect, that the current played song will be paused, as next a doorbell sound should be added into the playlist, then played, after that removed from playlist and finally the player should continue playing song that was paused in the first place. Perhaps there is much more going one in the background, like setting the volume for notification sound.
My long lasting problem with this is that very often the doorbell sound is not being removed from the playlist (so the playlist is mixing and building up with several doorbell sounds).
This results in indesired and annoying issues. For example when nothing was played at the time when toorble was triggered but there was something already on the playlist, after playing a doorbell sound the player does not go back to STOP state and instead plays next song, and often with volume that was set up for a notification volume. So for this appliance squeezebox is not very appropriate and vastly not reliable.
However as a half solution I was thinking about to force clearing the playlist from a rule, after doorbell sound is played. Right now I only send additional STOP command in order to make sure nothing will be played after doorbell sound with max volume (as it is level of volume for notifications).
Thanks for your help and time.