-
-
Notifications
You must be signed in to change notification settings - Fork 205
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MPRIS signal PropertiesChanged is not triggered #89
Comments
Hey, thanks for the report. On my machine the following message is sent when the track changes:
This seems to be sufficient for the Gnome Shell notification window. Do you have any details on what is missing or incorrect? |
Ah, I think I found out why: the DBus message sending is triggered asynchronously for the stopped track and playback of the new track. By the time the DBus messages are formatted, the track is already playing, which results in 2 PropertiesChanged messages for the new track. This triggers the check in your scrobbler. I'll work on a fix. |
You're right, I think I conflated the two issues the submitter to my bug had. In the ticket the signal is shown clearly in the log. |
as sending out PropertiesChanged events was triggered asynchronously by a message queue, retrieving the metadata during message formatting is too late. this resulted in two PropertiesChanged messages announcing the new track as playing. this should prevent such a scenario. as discussed in #89
Hey @mariusor. I have reworked the MPRIS behavior a little. Could you check if this fixes it? |
@hrkfdn I could, and I will, give me some time t. original reporter |
now I'm getting
|
Same here. :) So there still the same behaviour. The track information is loaded properly from the Signal payload, yet the scrobbler doesn't consider it valid for a scrobble. It's probably something on my side, and I'll do a debug session later today. The only thing that there's still not spec compliant for ncspot is that the PropertiesChanged signal is not advertised when doing introspection. It's possible - but not very probable - that this also might be an issue. Thanx for taking the time to look into this. |
ncspot should now issue a Does it maybe update the track metadata somehow else? |
The already loaded message comes from the fact that the scrobbler tries to do some heuristics to determine for if the current PropertiesChanged message was submitted multiple times by a faulty player. I have a long standing improvement planned for it to add these types of heuristics on a per player basis, but for now it's all done in the same piece of logic and looks like some of them are trampling over normal behaviour. |
Got it, thanks. If there isn't anything else that needs fixing on ncspot's side regarding this, could you close the issue? If not, let me know :) |
Yes definitely. I'll probably dedicate more time to make it work properly on my side with ncspot, as I have been looking for a spotify replacement for a long time. (I have an open ticket for spotifyd - another rust project to connect to the spotify API, for a similar issue with the PropertiesChanged signal :D) I'm not sure if we can close this or not, I would say yes and I'll open a new tickcet if I get more ideas for improvement. |
Cool, I'll close it for now then. If you spot anything else, please let me now! |
So, the problem was triggered by the mpris scrobbler not reading the I relaxed the dbus length reading on my side, so I think everything should work properly from now on. [1] https://www.freedesktop.org/wiki/Specifications/mpris-spec/metadata/#index2h4 |
Oh, nice catch, thanks! I have adjusted the types as per specification. |
as sending out PropertiesChanged events was triggered asynchronously by a message queue, retrieving the metadata during message formatting is too late. this resulted in two PropertiesChanged messages announcing the new track as playing. this should prevent such a scenario. as discussed in hrkfdn#89
Hi,
I am the developer behind a generic scrobbling daemon for linux, called
mpris-scrobbler
and I had a bug report from a user involving ncspot[1].The issue boiled down to ncspot's MPRIS implementation not triggering the
/org/mpris/MediaPlayer2/org.freedesktop.DBus.Properties/PropertiesChanged
when track or play status change.I'm not sure if this is a problem of the underlying library or the player must enable this signal specifically, but it would be great if someone could give it a look.
Thank you.
[1] mariusor/mpris-scrobbler#66
The text was updated successfully, but these errors were encountered: