plietar / librespot

Open Source Spotify client library
MIT License
1.14k stars 185 forks source link

Support for spotify Radio #184

Open arigit opened 7 years ago

arigit commented 7 years ago

Since forever I've noticed that when playing spotify Radio (launching it from an official spotify android client or from a linux client), librespot will play about ten songs and then it will restart from the first song, instead of continuing to pull new songs to play from the "dynamic playlist".

This indeed seems to be a librespot problem with dynamic playlists (that keep adding content forever). If one plays the media locally, then the client continues adding new content to the dynamic playlist and never repeats a song.

There is a long issue thread in spotify's support site, people complaining that their SpotifyConnect speakers will behave as described above. However, recently spotify people advised that this is not an issue with the Spotify Client, but an issue with very old firmware in the SpotifyConnect / speakers i.e. librespot.

Here's the thread.

https://community.spotify.com/t5/Ongoing-Issues/Radio-not-loading-more-songs-when-using-Spotify-Connect/idc-p/1673495#M42870

Hereby the request to have librespot support spotify's dynamic playlists including Radio

sashahilton00 commented 7 years ago

I'm not sure radio support has been implemented yet. I assume this is happening because librespot just receives the seed track list and doesn't listen/poll for updates to the song radio?

arigit commented 7 years ago

Radio works, the problem is that it only plays 10 songs and then restarts. Same as older spotifyConnect clients apparently, lots of people complained in that thread. Looks like librespot is expected to "refresh the list" when it's reaching the end, radio is a special kind of playlist - dynamic playlist that never ends. The current behavior is a bit annoying. It's been like this from the beginning and I thought it was time to raise it. Coudn't find previous references so here we are.

plietar commented 7 years ago

The way Connect works is the remote sends a "Context URI" and a short list of tracks from that context. If the receiver supports that context type, it can just use it to get the track list, otherwise it falls back to that list sent by the client. Librespot doesn't support contexts at all, so it will always use that list. This is why radios and eg long playlists only play a few tracks in a loop

arigit commented 7 years ago

I see, thanks. Is there any chance we could get that in librespot? It's a fairly common use case, very useful, and librespot has been uber stable for some time (at least on my raspberry). It would be great to have this feature

jsopenrb commented 7 years ago

I suppose the same thing goes for playing similar tracks when an album ends and daily mixes. This is very desirable to have.

airdrummingfool commented 7 years ago

This is why radios and eg long playlists only play a few tracks in a loop

I'm not sure what a "long" playlist is, but I've tested playlists as long as 100 tracks and Librespot plays them fine.

However, I notice the 10-track-loop constantly on Radio and Daily Mixes, and would love to have context working correctly to support those features. As a bonus, I bet it would also add support for showing (in Spotify clients) which playlist/track is currently playing (such as the speaker icon next to the playlist name, the track highlighted green in the list of songs for the playlist, etc).

Playing on another device (top) vs playing on Librespot (bottom): image

I believe issue #21 is related to this feature request.

infinity85 commented 7 years ago

Aaah... this issue explains why my Onkyo Audio Receiver (2012 lineup) has this behavior since Spotify introduced Radio and Mix Tapes features some months ago. So it is actually because these older devices and librespot rely on some kind of fallback.

I'd love to see this "dynamic" feature introduced in librespot :)

sashahilton00 commented 7 years ago

might be worth adding the feature request tag to this

arigit commented 7 years ago

Yes very old spotify firmware in speakers has the same problem as librespot, it's unable to play more than a dozen songs from a dynamic list (dynamic lists include Spotify Radios and Daily Mixes), and then it starts repeating the same few songs instead of loading new ones. Still hoping that librespot will get support for this.
@sashahilton00 I couldn't find the way to add a Feature Request tag. Looks like only the project owner can.