Bug 396083

Summary: Media Player widget doesn't update correctly
Product: [Plasma] plasmashell Reporter: elman <elman>
Component: Media Player widgetAssignee: Kai Uwe Broulik <kde>
Status: RESOLVED DOWNSTREAM    
Severity: normal CC: kde, kdelibs-bugs-null, plasma-bugs-null
Priority: NOR    
Version First Reported In: 5.13.2   
Target Milestone: 1.0   
Platform: Manjaro   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:
Attachments: spotify

Description elman 2018-07-02 10:24:00 UTC
Created attachment 113708 [details]
spotify

Media Player widget doesn't update song progress in the background. When a song is playing for like 1 minute and I click on widget it only then starts progress bar. And when I close widget, progress bar stops. When I open widget it continues where it stopped when closing.
Comment 1 Kai Uwe Broulik 2018-07-04 07:38:59 UTC
That is intentional to save energy. When opening the popup, it queries the current position from the player, which doesn't seem to work here. I have never experience this behavior. Can you try to reproduce with a different player?
Comment 2 elman 2018-07-04 08:55:25 UTC
YouTube in Firefox via Plasma Integration plugin and Deadbeef with mpris2 plugin work fine. So it must be an issue with Spotify - I use flatpak version. 

I believe widget in 5.12 worked also for Spotify, but I'm not 100 % sure.

Also I noticed that widget doesn't show album art from Spotify. This definitely worked in 5.12 widget.
Comment 3 Kai Uwe Broulik 2018-07-04 09:08:59 UTC
Hm, I just had the slider stuck, but after plasmashell restart it worked. Definitely something wonky there, perhaps related to Bug 394562

Can you check the output of qdbus org.mpris.MediaPlayer2.THEPLAYER /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Metadata (with THEPLAYER being e.g spotify or something, check with qdbus | grep mpris), there should be a "mpris:artUrl" in there, if not, that's the player's fault.
Comment 4 elman 2018-07-04 12:49:11 UTC
Sure.

~> qdbus org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Metadata
mpris:artUrl: https://open.spotify.com/image/42bc52195b896337bbc2fccbb838d5b903efc1ab
mpris:length: 355613000
mpris:trackid: spotify:track:1c3eluqs0Cl9b4Zswqn9c5
xesam:album: Orthodox / Mortal Memories
xesam:albumArtist: Krabathor
xesam:artist: Krabathor
xesam:autoRating: 0.01
xesam:discNumber: 1
xesam:title: Slavery - Bonus Track
xesam:trackNumber: 15
xesam:url: https://open.spotify.com/track/1c3eluqs0Cl9b4Zswqn9c5

So there is an URL for cover and yet cover is not displayed. Also progress bar is stuck at 0:00. When I switched next song, cover is still not displayed, but progress bar starts when I open widget and behaves like I described in bug.

However I just found out, that when I turn on VPN, which only has connection via proxy, spotify goes to offline mode and widget starts showing covers. I have  automatic proxy configuration. So this whole cover problem seems to be on my side and related to proxy.

I guess we should forget about covers for now and focus on progress bar.
Comment 5 Kai Uwe Broulik 2018-07-04 13:18:14 UTC
Alright, thanks for your investigation.

What's the output of
$ qdbus org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Rate

Should be 1 or at least greater than zero. This is what tells it how fast the track is being played so it can update the slider accordingly on its own.

Also please
$ qdbus org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Position

Check if that changes as the track advances, and finally

$ qdbus org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.CanSeek

Whether we can actually seek at all
Comment 6 elman 2018-07-05 05:58:59 UTC
Spotify flatpak
org.mpris.MediaPlayer2.Player.Rate = 1
org.mpris.MediaPlayer2.Player.Position = 0 (always)
org.mpris.MediaPlayer2.Player.CanSeek = false

I also checked DeaDBeeF
org.mpris.MediaPlayer2.Player.Rate = 1
org.mpris.MediaPlayer2.Player.Position = long int that changes
org.mpris.MediaPlayer2.Player.CanSeek = true

So it looks like spotify must be fixed, right?
Comment 7 Kai Uwe Broulik 2018-07-05 06:20:20 UTC
Yes, looks like a Spotify bug. Please file a bug report with them, closing this bug now. Thanks a lot for your patience and help!