TL;DR: There is a bug in gnome that have been fixed in 3.3.
But you can temporary fix this issue with: pkill gsd-media-keys
-
We check logs
journalctl -f
=>
Jan 16 14:37:43 gregoire gsd-media-keys[2670]: Error calling method GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: The name org.mpris.MediaPlayer2.chromium.instance8878 was not provided by any .service files
It looks like it comming from dbus
-
Check dbus logs
dbus-monitor
Then use your media keys
=>
signal time=1579184803.311666 sender=:1.21 -> destination=:1.56 serial=82274 path=/org/gnome/Shell; interface=org.gnome.Shell; member=AcceleratorActivated uint32 1713 array [ dict entry( string "device-id" variant uint32 3 ) dict entry( string "timestamp" variant uint32 222074642 ) dict entry( string "action-mode" variant uint32 1 ) ] method call time=1579184803.313383 sender=:1.56 -> destination=org.mpris.MediaPlayer2.chromium.instance8878 serial=586 path=/org/mpris/MediaPlayer2; interface=org.mpris.MediaPlayer2.Player; member=PlayPause error time=1579184803.313423 sender=org.freedesktop.DBus -> destination=:1.56 error_name=org.freedesktop.DBus.Error.ServiceUnknown reply_serial=586 string "The name org.mpris.MediaPlayer2.chromium.instance8878 was not provided by any .service files"
It looks like a processus
sender=:1.21
receive the event (media key pressed), and sent it to another processusdestination=:1.56
Then this processus
sender=:1.56
sent thePlayPause
event to another processusorg.mpris.MediaPlayer2.chromium.instance8878
But according to the error, this processus does not exists.
-
Try if Spotify understand the event correctly
The following command should Play/Pause Spotify
dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.PlayPause
-
Who is
sender=:1.21
andsender=:1.56
I looks like the first sender is doing right its job, but second does some bullshit.
d-feet
is a useful GUI software to get who it is (and try few things).Just type
1.21
or1.56
in the Session Bus > search to know how it is- 1.21 is
gnome-shell
. Legit, gnome-shell handles my MediaKeys - 1.56 is
/usr/lib/gnome-settings-daemon/gsd-media-keys
So it looks like we have found our culprit !
- 1.21 is
-
restart
gsd-media-keys
Let's try to retry this little daemon that should forward Media Keys press to the right processus
ps aux | grep gsd-media-keys pkill gsd-media-keys ps aux | grep gsd-media-keys # The process should have a new PID
Some resources:
- https://gitlab.gnome.org/GNOME/gnome-settings-daemon/issues/45
- https://github.com/jreese/spotify-gnome/blob/master/bin/spotify#L48
qdbusviewer
software- Thanks to https://github.com/paxal for his precious help !!!