polybar-scripts icon indicating copy to clipboard operation
polybar-scripts copied to clipboard

Player-mpris-tail: Not updating while playing music with spotifyd

Open p0da opened this issue 4 years ago • 13 comments

First off thanks for the great script, unfortunately Im currently having an issue where the entire label is frozen in the state that it starts in when Im playing music with spotifyd. Running "player-mpris-tail.py status" provides updated info but the label itself doesn't update when ran in polybar.

p0da avatar Mar 05 '20 08:03 p0da

@Cybolic Any comments?

x70b1 avatar Mar 05 '20 11:03 x70b1

I don't use spotifyd myself, but since this is not the first issue we've had with it, I'll try it out and see what I can find.

Cybolic avatar Mar 05 '20 15:03 Cybolic

From what I can see, this is a known issue with spotifyd: https://github.com/Spotifyd/spotifyd/issues/455 https://github.com/Spotifyd/spotifyd/issues/457

I tried seeing if I can work around it anyway, but I'm having a lot of trouble just using spotifyd in the first place. It's not showing up on my list of MPRIS clients (not through this script, nor in playerctl or even in Qt DBus Viewer) - isn't it supposed to list itself as one or is there another way of controlling it?

Cybolic avatar Mar 07 '20 18:03 Cybolic

The behavior of spotifyd are somewhat similar with what I've experienced in musikcube. It is the only player on my system that I couldn't control properly with any kind of MPRIS control implementation including KDE Plasma Media Controller and player-mpris-tail. I can control it with playerctl and that's it, playerctl can't follow the metadata change from musikcube properly. It sometimes works, but most of time it just stops following the changes and only works after ending playerctl and start following the metadata again. Looks like this issue can only be fixed by the developers. Nothing we can do about it.

rockyprabowo avatar Mar 08 '20 11:03 rockyprabowo

Okay, that was my fault - my installed version was without MPRIS support :P However, spotifyd doesn't even seem to properly implement DBus Introspection and doesn't have any properties on it until something is playing; it honestly does a pretty terrible job at MPRIS support.

In short, I'm not sure it's really worth trying to hack around a broken player, as the only way I can see this done is specifically detecting spotifyd and having different code paths for it.

This is possibly of course (though still not trivial), but the solution should really be to fix things on spotifyd's side.

Cybolic avatar Mar 08 '20 14:03 Cybolic

I totally agree with that. If spotify doesn't work propperly with MPRIS it doesn't make much sense to work around.

I will keep track of the issues mentioned above. Until then I would leave this issue open. Then everyone will see that spotify is broken. Spotify problems pop up from time to time in our polybar-scripts bug tracker.

x70b1 avatar Mar 08 '20 15:03 x70b1

Just to clarify, this is a problem with spotifyd, not spotify.

rehanzo avatar Apr 07 '20 18:04 rehanzo

I also had issues with spotifyd on my own scripts, mainly was that whenever I requested the song metadata it would block on reading for well over 20secs, whenever I had a dbus module on powerline it would completely freeze the daemon and lag my terminal :v

Could a solution be to have an option to also request the metadata anyway after set interval? I can look into that

It seems to me that spotifyd isn't the only app having trouble using mpris, whenever I play a video on discord it will keep the player status as stopped until I restart it, but again that's an issue with the app, not the script, so may be out of scope

ghost avatar May 18 '21 18:05 ghost

Spotifyd/spotifyd/issues/457 is probably solved now. It would be cool if someone would like to analyse the current situation here.

x70b1 avatar Mar 11 '22 14:03 x70b1

Tested it, and it does not seem to work on my end. Issue still persists.

rehanzo avatar Mar 11 '22 16:03 rehanzo

I guess the changes are not released with spotifyd. Building the latest spotifyd from sources is probably required.

x70b1 avatar Mar 11 '22 16:03 x70b1

I had built it from source. I made another mistake. It seems like it is working perfectly now.

rehanzo avatar Mar 11 '22 17:03 rehanzo

Thats are great news. As soon as a new spotifyd version is released we can close this issue.

x70b1 avatar Mar 11 '22 17:03 x70b1