librespot-org / librespot-java

The most up-to-date open source Spotify client
Apache License 2.0
379 stars 93 forks source link

Playback-time continues even when stopped/paused #350

Open funtax opened 3 years ago

funtax commented 3 years ago

When I connect to my device within Spotify on Window, the playback-time starts/continues even when in pause-state. It happens always, when I connect while in pause state, or when pausing in between.

Once the track is continued, the playback-time is updated with the real playback-time, but once I pause the playback, the timer continues within Spotify.

Is this a common issue or just happening to me?

funtax commented 3 years ago

This does not happen with the Spotify-app on Android, so maybe it's a bug in the Spotify-application for Windows. But there this bug does not happen if I select another SpotifyConnect-enabled device.

Can anyone reproduce/check if the timer is always counting with the current dev-branch?

mitschwimmer commented 3 years ago

I tested with the linux desktop client and there is no issue. Playback-time is pausing on the desktop once I pause on the mobile device.

devgianlu commented 3 years ago

Just tested with librespot-java on 77a558475d860bd5c672bc58dac7baeb17e219c6 and the Windows desktop client on 1.1.58.820.g2ae50076 and I cannot reproduce it either. What are your versions?

funtax commented 3 years ago

My Windows client is on 1.1.58.820.g2ae50076-a and I am using the latest xyz.gianlu.librespot:librespot-player:1.5.6-SNAPSHOT:thin.

I will try to find the reason for this or otherwise interpret it as a temporary Spotify-bug ;-)

devgianlu commented 3 years ago

Now I see it. Do you have the new UI?

funtax commented 3 years ago

It looks this way: image

devgianlu commented 3 years ago

Yep, that's the new UI. I've been looking at this issue for a while, but I cannot figure out what's causing it.

aumann commented 2 years ago

I've seen strange issues with reported progress, too, and hope that the observations are helpful for diagnosis.

Background: I'm developing a small browser app which uses the regular Spotify Web API. This web app is controlling a librespot-java player running on a Raspberry (v1.6.1 from https://github.com/spocon/spocon).

I am displaying progress in the Web UI by regularly polling status from the Spotify WebAPI (https://api.spotify.com/v1/me/player). I've seen the following two issues:

Negative timestamps

I am not sure how to reproduce, but this has happened at least twice now.

The progress/timestamp of the currently playing episode is reported to be negative, for example -42858640 [ms], that is minus 11h something. While the track is playing, the timestamp "correctly" increases toward 0, that is after 10 seconds the value is 10000 more positive.

The timestamps stay incorrect/negative across episode/track changes.

Note that the negative timestamps even persist across power-offs of the Raspberry. I just found, though, that closing the player instance via its own API (POST /instance/close) seems to have fixed the issue - I've only tried this once so far, though.

Increasing time stamps when paused

This is probably the same issue as described above: after pausing (an episode of a show), the reported state is paused but the timestamp keeps increasing between successive calls to the Spotify Web API

instinctualjealousy commented 1 year ago

This is an issue for me when using spotify-qt with librespot-java. There's also a web remote here that reacts the same way with librespot-java. The Rust version of librespot did not have this issue from what I can tell, but it has another issue that was non-negotiable for me here (still not fixed) which is why I moved to the more supported Java version, even with the higher RAM requirement. Just throwing my hat in this ring.