michaelherger / Spotty-Plugin

A Spotify plugin for the Lyrion Music Server (fka. Logitech Media Server) and Squeezebox compatible players
119 stars 20 forks source link

Playback stops before end of the track #76

Closed davinci-klod closed 12 months ago

davinci-klod commented 1 year ago

Hi,

Really appreciate this spotify plugin for LMS :-)

I'm essentialy using Spotty through the official Spotifiy app. I have some troubles to deal with, one is the following :

When I play a song which I've had looked for in the searchbar, the playback stop everytime before the end of this track. This problem not happens when i'm listening to multiples tracks, in a playlist for example. However, this problem occurs for the last track of this playlist. I'm using LMS on a Docker Container. I was running it on a RPI 3 in the past but changing the hardware did not solve this problem.

Could you help me with this issue please ? Thanks :-)

michaelherger commented 1 year ago

Is this a recent issue? Spotify's server seem to behave poorly recently. See eg. https://github.com/michaelherger/Spotty-Plugin/issues/75.

Otherwise: is there any trace in your server.log file (see Settings/Informatin)?

davinci-klod commented 1 year ago

Hi Michael,

Actually It's been a while I'm facing to this problem (since I use LMS with Spotify - about 1 year ago). Before I switch to a container install, I've had many other issue (possibly linked to my previous RPI install) which made a normal use of Spotty not possible. Now I've switched, this problem's remained (plus the fact the pause button is bugged and jump the play of the track, but I'll open another topic for that issue).

Here's my configuration : Capture d’écran 2023-01-17 à 06 48 19

Note I have to enable the "Watch Spotty Connect" option, either I can't see all the squeezelite on Spotify.

Here's my server.log :

server.log.zip

I have tested to play a song at 06 am 55 and the error still occurs, but It's not making an error on the server log file. Note that when I'm listening to a playlist, even if the succession of the tracks is done well when listening (no cut or bugged transition), when you look at the Spotify playback controller (of the official app), you can see that it goes to the next track in advance of listening to the current title. The transition to the next track is done at about the same time as listening to a single track stops before the end of the reading (I don't know if it's related)

I have no extra setting enabled about mix on Spotify :

Capture d’écran 2023-01-17 à 07 02 48

And finally, what's happens visually :

https://user-images.githubusercontent.com/60784639/212822563-df6caa7c-8d56-4382-a746-2b8efca3c29e.mov

Thanks for your help !

michaelherger commented 1 year ago

First of all: unfortunately I never got Spotty to work really reliably in Connect mode. That's a known issue. Playback stopping, progress bar getting slightly out of sync, premature track changes are all known symptoms of an overly complicated system. The problem here is that we have to sync two systems which both believe they were in control of the playback: LMS and Spotify. Eg. change the volume in LMS -> sync up to Spotty, which in turn would tell LMS again to sync. Similar behavior I have to deal with when it comes to playback control. I always have to somehow figure out whether a signal needs to be acted on or ignored. And this juggling with two masters is unreliable at times.

Most likely you're running the Docker container in bridge mode networking. In this case Docker creates its own network and only exposes some ports to the host. Connect player discovery uses broadcasts, which won't work in this configuration. That's why you have to "surveiller la connexion". You could use host mode networking instead (which comes with a bunch of other issues).

michaelherger commented 12 months ago

Please see #82.