GNOME Bugzilla – Bug 789738
Evince interfering with media player keys
Last modified: 2018-04-25 13:00:23 UTC
Overview: When Evince (Documents Viewer) is running, playback control using media keys is lost on laptop. Strangely, this only occurs with third-party software (tested with Clementine, Lollypop and Spotify); playback control remains possible with gnome-music. Steps to reproduce (e.g. using Lollypop): 1) Launch Lollypop; 2) Play some music; 3) Press Play/Pause key on laptop keyboard; 4) Launch Evince; 5) Press Play/Pause key on laptop keyboard. Expected Results: Music stops/starts. Actual Results: When Evince is running, nothing happens when Play/Pause (or any media key) is pressed. Build Date & Hardware: 2017-10-31 on Arch Linux running Gnome 3.26.2
I am experiencing the same issues. I am running Arch with Gnome 2.26.2 and Evince 3.26.0.
Does this happen only with Evince or with any other Gnome 3-application? Say, Documents.
Everything's fine with Documents. AFAIK it's only an issue with Evince.
Please, may you try with some other applications.
At the moment, playback works with all those applications running at the same time: - Calendar - Disks - Documents - Firefox - Games - Geary - Gedit - JabRef - Libreoffice Writer - MEGASync - Nautilus - Pulseeffects - Recipes - Settings - Sound Recorder - System Monitor - Tilix - To Do - Transmission - Weather - Web (Epiphany) Then, as soon as I launch Evince, the issue appears. However, as I said, playback is still possible whith gnome-music.
Sorry, forgot to mention: I am using Lollypop right now.
Thanks for the additional information. Another question: when this happens, does Evince has the focus? or does this also happen when Evince is running in background?
This happens both when Evince is focused and running in background.
It happens whether Evince is in focus or running in background. I am trying to control Spotify and not Lollypop btw. It does not even work when Spotify is in focus, I first have to quit Evince. Then I can use the media keys again. Keys affected are: Play/Pause, Next and Previous.
I'm experiencing the same issue with Evince and any player which is not Totem. Spotify, Clementine and VLC (so far) lose the media keys bindings (Play/Pause, Next, Previous) as soon Evince is opened. It happens either with Evince in foreground or in background, and even if the player is the focused window. I'm using ArchLinux with Gnome 3.26.2 and Evince 3.26. It seems that the problem started with the upgrade to Gnome 3.26 as I've been using this installation for the last year without experiencing the issue. I don't know if it is the same bug, but something similar already happened over the last years: https://bugzilla.redhat.com/show_bug.cgi?id=1398812 https://bugs.launchpad.net/ubuntu/+source/evince/+bug/263779
Please, may you run gsd-media-keys with G_MESSAGES_DEBUG=all and then run the applications involved. The definition to run the service is in: /etc/xdg/autostart/org.gnome.SettingsDaemon.MediaKeys.desktop
Lollypop alone: http://pastebin.com/qRUFdsNN (Start gsd-media-keys; launch Lollypop; play a song; press "Play/Pause" on keyboard; wait 10 s; press "Play/Pause" on keyboard again; wait 10 s; stop gsd-media-keys.) Lollypop + Evince: http://pastebin.com/6LjYWaXd (Start gsd-media-keys; launch Lollypop; play a song; press "Play/Pause" on keyboard; wait 10 s; launch Evince; press "Play/Pause" on keyboard again; wait 10 s; stop gsd-media-keys.) Music (gnome-music) alone: http://pastebin.com/4ErdnaSC (Start gsd-media-keys; launch Music; play a song; press "Play/Pause" on keyboard; wait 10 s; press "Play/Pause" on keyboard again; wait 10 s; stop gsd-media-keys.) Music (gnome-music) + Evince: http://pastebin.com/S1vWtx5s (Start gsd-media-keys; launch Music; play a song; press "Play/Pause" on keyboard; wait 10 s; launch Evince; press "Play/Pause" on keyboard again; wait 10 s; stop gsd-media-keys.) Hope this helps.
Thanks for the input. Please, may you attach the output as text files. In the future, the content could be lost or remove by pastebin and there will be lack of context in the report.
Created attachment 363654 [details] Output of G_MESSAGES_DEBUG=all gsd-media-keys for Lollypop alone Start gsd-media-keys; launch Lollypop; play a song; press "Play/Pause" on keyboard; wait 10 s; press "Play/Pause" on keyboard again; wait 10 s; stop gsd-media-keys.
Created attachment 363655 [details] Output of G_MESSAGES_DEBUG=all gsd-media-keys for Lollypop + Evince Start gsd-media-keys; launch Lollypop; play a song; press "Play/Pause" on keyboard; wait 10 s; launch Evince; press "Play/Pause" on keyboard again; wait 10 s; stop gsd-media-keys.
Created attachment 363656 [details] Output of G_MESSAGES_DEBUG=all gsd-media-keys for Music (gnome-music) alone Start gsd-media-keys; launch Music; play a song; press "Play/Pause" on keyboard; wait 10 s; press "Play/Pause" on keyboard again; wait 10 s; stop gsd-media-keys.
Created attachment 363657 [details] Output of G_MESSAGES_DEBUG=all gsd-media-keys for Music (gnome-music) + Evince Start gsd-media-keys; launch Music; play a song; press "Play/Pause" on keyboard; wait 10 s; launch Evince; press "Play/Pause" on keyboard again; wait 10 s; stop gsd-media-keys.
Downgrading to 3.20.1 resolved the issue for me, so the regression happened somewhere between 3.20.1 and 3.26.0, I suppose.
I downgraded to 3.24.1-1 on Archlinux and it solved the issue, so I think the window within the regression happened is restricted between 3.24 and 3.26.
Please, try reverting the patch in https://git.gnome.org/browse/evince/commit/?id=532583427f534b83b51488f34e5552882b042801
Otherwise, if you feel comfortable with git and have a little of patience, you can try to bisect it.
*** Bug 790855 has been marked as a duplicate of this bug. ***
(In reply to Germán Poo-Caamaño from comment #20) > Please, try reverting the patch in > https://git.gnome.org/browse/evince/commit/ > ?id=532583427f534b83b51488f34e5552882b042801 I haven't tried to revert the commit, but looking at its description, it would affect only the "Next/Previous" shortcuts. The issue we have is more in general with all the media keys, as also the "Play/Pause" shortcut is involved.
I've done some testing with the versions, for me 3.25.4 works 3.25.91 doesn't. So the issue seems to be introduced in 3.25.91.
I found the commit that introduced this. Reverting the change made in 0d981170c808f39f55288200b7af25aa28949094 resolves this issue (https://bugzilla.gnome.org/show_bug.cgi?id=786262).
Created attachment 367373 [details] [review] shell: Fix media-player keys not working gsd-media-keys doesn't have a .service file itself, but responds to the org.gnome.SettingsDaemon.MediaKeys name nonetheless. This however seems to mean that signals emitted by gsd-media-keys will not have the expected sender name. Seeing as the signals come from a proxy we created ourselves with a well-known name, there's really no need to filter any further. This fixes pressed media player keys not doing anything with more recent versions of gnome-settings-daemon (3.24).
(In reply to Bastien Nocera from comment #26) > Created attachment 367373 [details] [review] [review] > shell: Fix media-player keys not working > > gsd-media-keys doesn't have a .service file itself, but responds to the > org.gnome.SettingsDaemon.MediaKeys name nonetheless. This however seems > to mean that signals emitted by gsd-media-keys will not have the > expected sender name. Seeing as the signals come from a proxy we created > ourselves with a well-known name, there's really no need to filter any > further. > > This fixes pressed media player keys not doing anything with more recent > versions of gnome-settings-daemon (3.24). I tried your patch. Now the media keys works inside evince, which it didn't before. However it did not fix the issue with not being able to control media players while evince is running (tested it with spotify).
(In reply to john.viklund from comment #27) > (In reply to Bastien Nocera from comment #26) > > Created attachment 367373 [details] [review] [review] [review] > > shell: Fix media-player keys not working > > > > gsd-media-keys doesn't have a .service file itself, but responds to the > > org.gnome.SettingsDaemon.MediaKeys name nonetheless. This however seems > > to mean that signals emitted by gsd-media-keys will not have the > > expected sender name. Seeing as the signals come from a proxy we created > > ourselves with a well-known name, there's really no need to filter any > > further. > > > > This fixes pressed media player keys not doing anything with more recent > > versions of gnome-settings-daemon (3.24). > > I tried your patch. Now the media keys works inside evince, which it didn't > before. > However it did not fix the issue with not being able to control media > players while evince is running (tested it with spotify). I can't see spotify's code, but I'll assume that it uses the MPRIS API, rather than gnome-settings-daemon's media-keys API. We currently only send keys to MPRIS clients if there's no client using our own media-keys API. And before any comments, this has been the case since MPRIS support was added, 4 years ago, so nothing that would have recently broken. It's also when I requested a new property in MPRIS to allow us to be a bit more clever about this: https://lists.freedesktop.org/archives/mpris/2013q4/000064.html So, there are 2 ways about this: - Make gnome-settings-daemon prioritise MPRIS clients, or at least try to handle them based on start time (if not focus time). That's doable, though a little bit complicated - Make evince only grab media player keys when in presentation mode, but that would break the ability to start presentations when evince is running
(In reply to Bastien Nocera from comment #28) > So, there are 2 ways about this: > - Make gnome-settings-daemon prioritise MPRIS clients, or at least try to > handle them based on start time (if not focus time). That's doable, though a > little bit complicated I filed https://bugzilla.gnome.org/show_bug.cgi?id=792875 for this. It's simple, but should do the job.
Attachment 367373 [details] pushed as 4d2301d - shell: Fix media-player keys not working for master Also pushed to gnome-3-24 and gnome-3-26
Thanks, but now media keys don't work anymore (at least on my side). :) I will file a bug report upstream.
Nevermind, this must be unrelated.
*** Bug 795517 has been marked as a duplicate of this bug. ***
*** Bug 617615 has been marked as a duplicate of this bug. ***