Spotifyd / spotifyd

A spotify daemon
https://spotifyd.rs
GNU General Public License v3.0
9.78k stars 447 forks source link

Shuffle takes only part of playlist #788

Open Myp3a opened 3 years ago

Myp3a commented 3 years ago

Description When shuffle is enabled, only part of playlist is shuffled. Something like top 50 songs are always shuffled and a half of second 50. Everything below 100 songs is ignored. Occurs on Liked Songs and custom public playlists.

To Reproduce

  1. Go to any playlist longer than 100 songs
  2. Enable shuffle
  3. See that not all songs are shuffled

Expected behavior Entire playlist should be shuffled

Versions (please complete the following information):

robinvd commented 3 years ago

so any song after the 50th is never played?

mikkelrask commented 3 years ago

This is a general Spotify problem, I don't think it has anything to do with the daemon.

Myp3a commented 3 years ago

so any song after the 50th is never played?

Yes. Playback stops after playing shuffled queue

This is a general Spotify problem, I don't think it has anything to do with the daemon.

It might be, but full desktop client works fine. So I believe that some workaround is possible

mikkelrask commented 3 years ago

I experince it in any spotify player (including the original app) i have tried so far. 🤷

Myp3a commented 3 years ago

I experince it in any spotify player (including the original app) i have tried so far. 🤷

Just tried it again with my Android phone and Windows app. Works fine in both ways, however, queue isn't preserved. Seems like new client receiving current track and playlist data, then restoring playback state and shuffling playlist again

Semmu commented 3 years ago

Spotify actually has 2 shuffle modes, both limited to around 80 tracks IIRC.

I'm not sure about the exact number but this is what I've read and my experience also confirms this behaviour.

JojiiOfficial commented 3 years ago

@Semmu Is there a reason for that? This kinda sounds like a bad shuffle algorithm to me. If i shuffle a playlist, I want to hear every song once in a while.

Myp3a commented 3 years ago

Spotify actually has 2 shuffle modes, both limited to around 80 tracks IIRC.

* When you open a playlist and click on "shuffle play", it selects random 80 tracks from the whole playlist and arranges them randomly, then plays.

* If you click on a track in the playlist, play it, **then** enable shuffling, only the close context (again, around 80 tracks) of that particular song get selected, shuffled, and played.

I'm not sure about the exact number but this is what I've read and my experience also confirms this behaviour.

Most of the time I click on a track or on a shuffle button in liked songs. I skip a lot of tracks, definitely more than 100, and listen for more than 6 hours. Still, my playlist is shuffled. It goes on and on, don't really know, what happens at the end - probably it ends, because all songs become played or skipped.

However, I downloaded all my music - if tracks aren't cached, they really shuffle in groups of ~80 per shuffle activate

Semmu commented 3 years ago

@Semmu Is there a reason for that? This kinda sounds like a bad shuffle algorithm to me. If i shuffle a playlist, I want to hear every song once in a while.

@JojiiOfficial I don't know the reason for this, but I guess it is a limitation of how Spotify works, as it seems to have a limit on the queue size to be precise. And this issue is very old, I found some reports from 2016 and it is still not fixed. I'm not sure how other users (like @Myp3a ) could experience different behaviour, but I guess it also depends on the client itself, and wether you downloaded the tracks or not, etc.

Some reports I found:

Spotify says they fixed this issue, but they did not, and you can see users still complaining after all these years... (It is ridiculous in my opinion.)

So I guess this issue reported here is not caused by spotifyd, but rather Spotify itself.

testbughub commented 3 years ago

I've noticed this issue myself. It works fine in the Android app, but spotifyd only takes a portion and shuffles. I usually only play on one playlist (with 1500+ tracks), and will only play a handful of songs, unless I manually select something further down the list.

stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

georgefst commented 2 years ago

Still an issue.

Semmu commented 2 years ago

I have a couple of theories about how Spotify works but did not test them extensively yet.

I think the shuffling behavior is affected whether you have repeat enabled or not. If you do, then Spotify is only going to select a number of tracks initially and then repeat them, but if you have repeat disabled, then it will always grab some new truly random tracks from the playlist to append to the queue. The downside of this is that you can't have a very long playlist on repeat because you need to choose between endless music (repeat enabled) or playing the whole playlist (repeat disabled)...

I also discovered that when you have some playlist in shuffle playing and you switch devices, then it seems to truncate the queue and from that point on you are only going to listen to a select few tracks again, like it forgot the original playlist you were playing and only the queue got transferred to the new device.

Also, shuffle works differently if you open a playlist and click on a track and then enable shuffle (which selects and shuffles only the close neighbors of the track on the playlist), vs. when you click on the "shuffle play" button on the playlist page (true shuffle from the whole playlist)...


A LOT of inconsistencies in Spotify in general... 😒

georgefst commented 2 years ago

Now that the stale bot is finally dead (https://github.com/Spotifyd/spotifyd/pull/1061), could we please get this reopened?

eladyn commented 2 years ago

@Semmu thanks for sharing your findings! Do those apply to Spotify in general (also official clients) or is this specifically the behaviour of spotifyd?

Semmu commented 2 years ago

@eladyn I haven't done proper testing yet, but my guess is that the behavior is independent of the client.

Semmu commented 1 year ago

This may actually be a librespot issue: https://github.com/librespot-org/librespot/issues/442