mirror of
https://github.com/devgianlu/go-librespot.git
synced 2026-04-26 05:15:49 +03:00
[GH-ISSUE #104] "Pause" doesn't appear to send the correct paused state #70
Labels
No labels
bug
enhancement
pull-request
spotify-side
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/go-librespot#70
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @aykevl on GitHub (Sep 30, 2024).
Original GitHub issue: https://github.com/devgianlu/go-librespot/issues/104
So here's a minor issue I'm having.
When you press "pause" in Spotify Android (when connected to go-librespot), it pauses as expected. But when you wait a few seconds (10 or so) and resume, you can see it jumps for a very short time to the time it would have been had the player not been paused. This only happens for a split second, presumably because go-librespot sends an updated position when resuming.
When testing the same thing when connected to open.spotify.com (playing on open.spotify.com, controlled from Spotify Android), this does not happen. So it appears that open.spotify.com sends something different.
I looked at the message it sends to the API and it sends the following request when the web player is being paused:
method: PUT
URL: https://gew4-spclient.spotify.com/track-playback/v1/devices/aeab3d432a2699430b795a799b2dc54f7faa94e4/state
Body:
sub_statelooks like PlayerState but for the rest I couldn't find an appropriate protobuf.Also, there are a ton of fields I don't know the meaning of (such as
seq_numandstate_machine_id).I guess I could try sending this as JSON, to see whether it works at all. If so, I could try to find (or reverse engineer) the protobuf.
@devgianlu do you maybe have any ideas?
@aykevl commented on GitHub (Oct 1, 2024):
I tested librespot, and it doesn't have this issue. So I guess I should investigate how they do this.
@aykevl commented on GitHub (Oct 1, 2024):
Didn't investigate librespot too deeply, but did find that go-librespot doesn't set the PlaybackSpeed to 0 when paused. Fixing that, the weird paused behavior is gone in Spotify Android.
@devgianlu commented on GitHub (Oct 1, 2024):
The API they use on the web player is very different from the one in the desktop players, sometimes it is very confusing. To look at the desktop stuff you can use something like Telerik Fiddler from a Windows machine.
Keep in mind that librespot uses a much older version (10+ years) of the Spotify internal API and may do things very differently or not do them at all.
@aykevl commented on GitHub (Oct 1, 2024):
Good to know!
Unfortunately I'm making things difficult for myself and am running a linux/arm64 (Asahi Linux) system. The Spotify desktop application doesn't work here. I could reboot into MacOS and sniff the network from there I guess...
Yeah I'm aware. But it can maybe give an idea of what kind of action needs to take place.
@devgianlu commented on GitHub (Oct 1, 2024):
Yeah definitely 😄. I have a Windows VM that allows me to do these tests in a constrained environment, but I guess that wound't work for you because of arm64...
Anyway, #106 seems to work for me.
@aykevl commented on GitHub (Oct 1, 2024):
It would in theory, I can run linux arm64 VMs just fine. But Windows arm64 VMs just don't work for reasons I don't understand (I spent many hours trying to get it to work).
I do have a Windows ARM VM on MacOS though, which I sometimes use when I need to test something on Windows.