[GH-ISSUE #31] Shuffle buttons don't work on some clients. #20

Closed
opened 2026-02-27 19:28:21 +03:00 by kerem · 8 comments
Owner

Originally created by @sashahilton00 on GitHub (Jan 29, 2018).
Original GitHub issue: https://github.com/librespot-org/librespot/issues/31

Issue by mfeif
Wednesday May 11, 2016 at 18:05 GMT
Originally opened as https://github.com/plietar/librespot/issues/82


When using librespot, I've noticed that I can't engage shuffle mode (or if it was previously engaged, I can't disengage it). This happens on Android clients, but not on the client on my Mac.

From the console on the machine running librespot, I see this:

This works:

DEBUG:librespot::spirc: kMessageTypeShuffle "Matt\u{2019}s MBP" 1076ca47615d400613f2e0ba4aec7d48bf1e1fc1 9 0

These don't:

DEBUG:librespot::spirc: kMessageTypeShuffle "XT1053" e74c24f49d31184d2f2c53e504287b7b82836758 9 0
DEBUG:librespot::spirc: kMessageTypeShuffle "Nexus 7" 09edc29adab512c4fcbb7b3975af126d7cad45c8 4 0

By "works" I should say that there is no feedback in the client. And it doesn't seem to "work" in that turning on shuffle in the android client doesn't show the state change in the Mac client.

It may also happen with the repeat feature.

This reminds me of a situation with a previous build, where the status of the player couldn't keep track of the time... when launching a client, it would start the playback time at 0:00, no matter what the actual playing was. Perhaps it's related? Something about parsing a heartbeat/status chunk?

Thanks

Originally created by @sashahilton00 on GitHub (Jan 29, 2018). Original GitHub issue: https://github.com/librespot-org/librespot/issues/31 <a href="https://github.com/mfeif"><img src="https://avatars0.githubusercontent.com/u/160125?v=4" align="left" width="96" height="96" hspace="10"></img></a> **Issue by [mfeif](https://github.com/mfeif)** _Wednesday May 11, 2016 at 18:05 GMT_ _Originally opened as https://github.com/plietar/librespot/issues/82_ ---- When using librespot, I've noticed that I can't engage shuffle mode (or if it was previously engaged, I can't disengage it). This happens on Android clients, but not on the client on my Mac. From the console on the machine running librespot, I see this: This works: ``` DEBUG:librespot::spirc: kMessageTypeShuffle "Matt\u{2019}s MBP" 1076ca47615d400613f2e0ba4aec7d48bf1e1fc1 9 0 ``` These don't: ``` DEBUG:librespot::spirc: kMessageTypeShuffle "XT1053" e74c24f49d31184d2f2c53e504287b7b82836758 9 0 DEBUG:librespot::spirc: kMessageTypeShuffle "Nexus 7" 09edc29adab512c4fcbb7b3975af126d7cad45c8 4 0 ``` By "works" I should say that there is no feedback in the client. And it doesn't seem to "work" in that turning on shuffle in the android client doesn't show the state change in the Mac client. It may also happen with the repeat feature. This reminds me of a situation with a previous build, where the status of the player couldn't keep track of the time... when launching a client, it would start the playback time at 0:00, no matter what the actual playing was. Perhaps it's related? Something about parsing a heartbeat/status chunk? Thanks
kerem 2026-02-27 19:28:21 +03:00
Author
Owner

@sashahilton00 commented on GitHub (Jan 29, 2018):

Comment by plietar
Wednesday May 11, 2016 at 18:38 GMT


The playback time issue was caused by some stupid unit conversion mistake, and fixed by b8b0f9c36e

Shuffle and repeat are not implemented at all IIRC

<!-- gh-comment-id:361258451 --> @sashahilton00 commented on GitHub (Jan 29, 2018): <a href="https://github.com/plietar"><img src="https://avatars0.githubusercontent.com/u/1489775?v=4" align="left" width="48" height="48" hspace="10"></img></a> **Comment by [plietar](https://github.com/plietar)** _Wednesday May 11, 2016 at 18:38 GMT_ ---- The playback time issue was caused by some stupid unit conversion mistake, and fixed by b8b0f9c36e6612f6fcb71a61ae4411556869c8f1 Shuffle and repeat are not implemented at all IIRC
Author
Owner

@sashahilton00 commented on GitHub (Jan 29, 2018):

Comment by xthursdayx
Saturday May 27, 2017 at 16:42 GMT


I'm finding that shuffle won't work when playing from Spotify on a Macbook Air using librespot with the Moode audio player OS on a Raspberry Pi. Have there been any updates on this? Thanks!

<!-- gh-comment-id:361258472 --> @sashahilton00 commented on GitHub (Jan 29, 2018): <a href="https://github.com/xthursdayx"><img src="https://avatars0.githubusercontent.com/u/18044308?v=4" align="left" width="48" height="48" hspace="10"></img></a> **Comment by [xthursdayx](https://github.com/xthursdayx)** _Saturday May 27, 2017 at 16:42 GMT_ ---- I'm finding that shuffle won't work when playing from Spotify on a Macbook Air using librespot with the Moode audio player OS on a Raspberry Pi. Have there been any updates on this? Thanks!
Author
Owner

@sashahilton00 commented on GitHub (Jan 29, 2018):

Comment by Bebowi
Sunday Sep 17, 2017 at 15:47 GMT


When I enable shuffle mode due to Spotify Clients on Mac and iPhone there is no effect to Librespot. Starting the next track leads to an automated disabling of this mode in all cases.

<!-- gh-comment-id:361258502 --> @sashahilton00 commented on GitHub (Jan 29, 2018): <a href="https://github.com/Bebowi"><img src="https://avatars3.githubusercontent.com/u/21242387?v=4" align="left" width="48" height="48" hspace="10"></img></a> **Comment by [Bebowi](https://github.com/Bebowi)** _Sunday Sep 17, 2017 at 15:47 GMT_ ---- When I enable shuffle mode due to Spotify Clients on Mac and iPhone there is no effect to Librespot. Starting the next track leads to an automated disabling of this mode in all cases.
Author
Owner

@sashahilton00 commented on GitHub (Jan 29, 2018):

Comment by kayue
Monday Sep 18, 2017 at 02:52 GMT


@Bebowi Because it has not been implemented yet. :(

<!-- gh-comment-id:361258517 --> @sashahilton00 commented on GitHub (Jan 29, 2018): <a href="https://github.com/kayue"><img src="https://avatars0.githubusercontent.com/u/193112?v=4" align="left" width="48" height="48" hspace="10"></img></a> **Comment by [kayue](https://github.com/kayue)** _Monday Sep 18, 2017 at 02:52 GMT_ ---- @Bebowi Because it has not been implemented yet. :(
Author
Owner

@sashahilton00 commented on GitHub (Jan 29, 2018):

Comment by mickvdv
Wednesday Oct 25, 2017 at 15:59 GMT


When will this be implemented?

<!-- gh-comment-id:361258541 --> @sashahilton00 commented on GitHub (Jan 29, 2018): <a href="https://github.com/mickvdv"><img src="https://avatars1.githubusercontent.com/u/1532028?v=4" align="left" width="48" height="48" hspace="10"></img></a> **Comment by [mickvdv](https://github.com/mickvdv)** _Wednesday Oct 25, 2017 at 15:59 GMT_ ---- When will this be implemented?
Author
Owner

@sashahilton00 commented on GitHub (Jan 29, 2018):

Comment by nicokimmel
Wednesday Dec 06, 2017 at 18:24 GMT


Is there any way to get shuffle working? I want this feature so bad. Im using SpotOn (spotify alarm clock) and without shuffle its not that nice.

<!-- gh-comment-id:361258559 --> @sashahilton00 commented on GitHub (Jan 29, 2018): <a href="https://github.com/nicokimmel"><img src="https://avatars3.githubusercontent.com/u/31391271?v=4" align="left" width="48" height="48" hspace="10"></img></a> **Comment by [nicokimmel](https://github.com/nicokimmel)** _Wednesday Dec 06, 2017 at 18:24 GMT_ ---- Is there any way to get shuffle working? I want this feature so bad. Im using SpotOn (spotify alarm clock) and without shuffle its not that nice.
Author
Owner

@sashahilton00 commented on GitHub (Jan 29, 2018):

Comment by djmaze
Wednesday Dec 06, 2017 at 18:32 GMT


It works for me when I start playing on a local device (Android or desktop) and then switch output to the librespot device while playing.

<!-- gh-comment-id:361258582 --> @sashahilton00 commented on GitHub (Jan 29, 2018): <a href="https://github.com/djmaze"><img src="https://avatars3.githubusercontent.com/u/7229?v=4" align="left" width="48" height="48" hspace="10"></img></a> **Comment by [djmaze](https://github.com/djmaze)** _Wednesday Dec 06, 2017 at 18:32 GMT_ ---- It works for me when I start playing on a local device (Android or desktop) and then switch output to the librespot device while playing.
Author
Owner

@sashahilton00 commented on GitHub (Jan 29, 2018):

Comment by kingosticks
Wednesday Dec 06, 2017 at 19:04 GMT


That 'works' because the official client just hands librespot the already shuffled track list. Librespot doesn't really have to do anything in that case.

You can see my naive (and very incorrect) implementation of shuffle and repeat at https://github.com/plietar/librespot/compare/master...kingosticks:master. I got stuck trying to implement shuffle properly and I've some questions for anyone familiar with how it (spirc?) is supposed to work regarding this.

The incorrect aspect of what I did is that mime treats 'queued' tracks like any other track in the list. This is wrong as 'queued' tracks should keep their positions and it's only the remaining tracks that need to be shuffled. That's a simple enough improvement to do.

My problem is how do you restore the original track order when the user disables shuffle? You don't know what that original order was. Are you meant to use the context uri state to reload the track list (assuming you also fix librespot to keep that state). And then what do you do with any 'queued' tracks that are still present, just insert them at the front? I could probably answer the latter question with some more experiments but the context uri thing is a total guess.

<!-- gh-comment-id:361258602 --> @sashahilton00 commented on GitHub (Jan 29, 2018): <a href="https://github.com/kingosticks"><img src="https://avatars2.githubusercontent.com/u/934824?v=4" align="left" width="48" height="48" hspace="10"></img></a> **Comment by [kingosticks](https://github.com/kingosticks)** _Wednesday Dec 06, 2017 at 19:04 GMT_ ---- That 'works' because the official client just hands librespot the already shuffled track list. Librespot doesn't really have to do anything in that case. You can see my naive (and very incorrect) implementation of shuffle and repeat at https://github.com/plietar/librespot/compare/master...kingosticks:master. I got stuck trying to implement shuffle properly and I've some questions for anyone familiar with how it (spirc?) is supposed to work regarding this. The incorrect aspect of what I did is that mime treats 'queued' tracks like any other track in the list. This is wrong as 'queued' tracks should keep their positions and it's only the remaining tracks that need to be shuffled. That's a simple enough improvement to do. My problem is how do you restore the original track order when the user disables shuffle? You don't know what that original order was. Are you meant to use the context uri state to reload the track list (assuming you also fix librespot to keep that state). And then what do you do with any 'queued' tracks that are still present, just insert them at the front? I could probably answer the latter question with some more experiments but the context uri thing is a total guess.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/librespot#20
No description provided.