SUMMARY I have a Bluetooth headset that has media buttons (play/pause, next, previous and volume up and down). All buttons work, but there's a problem when pressing the play/pause button: It only works every second time. That is, I press the button -> music stops; I press again -> nothing happens; I press again -> music resumes; I press again -> nothing happens. I found out (using xev) that my headset alternates sending X86AudioPlay and XF86AudioPause on every press. When XF86AudioPause is sent, nothing happens. One can say "Yeah, on the Global Shortcuts it's configured to only listen to Media Play, so you should add Media Pause to it too". Well, were it been that simple I wouldn't have written this bug report :D When I replace the shortcut to be Media Pause (or add it as a global alternative), the shortcut is saved, but nothing happens. That is, the bug still occurs. When it's added as an alternative, only every second press pauses/resumes the player. When replacing it with Media Play, the play/pause button doesn't work at all. When using xdotool to emulate the keypress it doesn't work either. I fiddled with the shortcuts a little bit and I found out this problem doesn't only apply to the media player. Any shortcut I set the trigger to be Media Pause (XF86AudioPause) doesn't work. Example: I create a custom shortcut (e.g. open konsole) and set it's trigger to be Media Pause. It listens to the key press, I can configure the shortcut properly, but the shortcut itself doesn't work. When I do the same thing with Media Play (XF86AudioPlay), the shortcut works as intended (e.g. konsole is opened). STEPS TO REPRODUCE 1. Set a shortcut's trigger to be Media Pause (either an existing or a new shortcut) 2. Press the Media Pause button (or emulate it with xdotool) OBSERVED RESULT Nothing happens EXPECTED RESULT The shortcut executes its assigned action SOFTWARE/OS VERSIONS Linux: Arch Linux (Linux Version 4.20.3) KDE Plasma Version: 5.14.5 KDE Frameworks Version: 5.54.0 Qt Version: 5.12.0
I am also experiencing this issue on my Sony WH1000XM2 headphones. The play/pause button works great in Gnome but works every other time in KDE.
I'm experiencing the same issue on Arch Linux (Plasma 5.16.5, Frameworks 5.62.0, Qt 5.13.1, Kernel 5.3.5). According to evtest my bluetooth headphones emit KEY_PLAYCD and KEY_PAUSECD and the music just pauses/resumes with the KEY_PLAYCD events and nothing happens with the KEY_PAUSECD ones.
Created attachment 123818 [details] KDE Shortcuts screenshot Same problem with my laptop keyboard, Keys are correctly detected by xev and KDE Settings but they do not work
My bad in my case it was due to a chrome plugin intercepting the Media events...
I experience the same issue with: Operating System: Kubuntu 19.10 KDE Plasma Version: 5.17.5 KDE Frameworks Version: 5.66.0 Qt Version: 5.12.4 Kernel Version: 5.3.0-26-generic OS Type: 64-bit Processors: 8 × Intel® Core™ i7-8550U CPU @ 1.80GHz Memory: 15,4 GiB of RAM And the Sony WH-1000XM3 Everything works great with my phone
Same problem on my notebook under Neon 5.18.5 and Kubuntu 20.04.
(In reply to lucas.olvr.campos from comment #6) > Same problem on my notebook under Neon 5.18.5 and Kubuntu 20.04. Like MILAS Robin said, it's a Chrome problem. Disabling native Chromium/Chrome media handling in chrome://flags/#hardware-media-key-handling solves the issue.
I confirm having the same issue: both my headsets alternatively send AudioPlay/AudioPause events, but only AudioPlays are ever handled by plasma. This has nothing to do with chromium, the issue is the same for every player.
As a workaround, you can install xdotool and xbindkeys (https://wiki.archlinux.org/index.php/Xbindkeys) and append to your ~/.xbindkeysrc file the following: "xdotool key --clearmodifiers XF86AudioPlay" c:209 which will map the XF86AudioPause event (code 209) to an xdotool call issuing a XF86AudioPlay key. Reload xbindkeys with xbindkeys --poll-rc .
dupe of https://bugs.kde.org/show_bug.cgi?id=426147
(In reply to andrea from comment #9) > As a workaround, you can install xdotool and xbindkeys > (https://wiki.archlinux.org/index.php/Xbindkeys) and append to your > ~/.xbindkeysrc file the following: > > "xdotool key --clearmodifiers XF86AudioPlay" > c:209 > > which will map the XF86AudioPause event (code 209) to an xdotool call > issuing a XF86AudioPlay key. Reload xbindkeys with xbindkeys --poll-rc . I can confirm andrea's workaround fixes the problem in Ubuntu 20.04 running KDE. Just installed the packages recommended, made a new ~/.xbindkeysrc file with just the contents andrea mentioned and everything works now! thank you andrea!
*** Bug 426147 has been marked as a duplicate of this bug. ***
Is this still a problem? Pause is bound to pause now https://invent.kde.org/plasma/plasma-workspace/-/blob/master/dataengines/mpris2/multiplexedservice.cpp#L128 Since https://invent.kde.org/plasma/plasma-workspace/-/commit/866c7ed17ef74100828ff3394614e894708bbc1c
In my system (Arch, Plasma 5.21) the new shortcut indeed appears on system settings, but issuing `xdotool key XF86AudioPause` Still doesn't pause the stream, while XF86AudioPlay does. If I bind the "pause" action to another key, it works as expected.
Thanks for the info!
A possibly relevant merge request was started @ https://invent.kde.org/frameworks/kwindowsystem/-/merge_requests/15
Git commit 53daf6bff454bf8c0a2cb18a57587de5d9e93887 by David Redondo. Committed on 08/03/2021 at 11:22. Pushed by davidre into branch 'master'. Add MediaPause key to mapping We were missing it. M +1 -0 src/platforms/xcb/kkeyserver.cpp https://invent.kde.org/frameworks/kwindowsystem/commit/53daf6bff454bf8c0a2cb18a57587de5d9e93887
I just updated to 5.21 and I can confirm everything works as expected now without any workaround. Thank you!