Bug 418288 - Keyboard multimedia keys are unstable
Summary: Keyboard multimedia keys are unstable
Status: CONFIRMED
Alias: None
Product: plasma-mediacenter
Classification: Plasma
Component: MediaController (show other bugs)
Version: unspecified
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: Sinny Kumari
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-02-28 13:32 UTC by Yurii Kolesnykov
Modified: 2025-02-15 20:01 UTC (History)
14 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Yurii Kolesnykov 2020-02-28 13:32:08 UTC
SUMMARY
After a couple of hours of uptime multimedia keys stop working

STEPS TO REPRODUCE
1. Use system for a couple of hours while listening the music.
2. Try to use multimedia keys to play/pause.

OBSERVED RESULT
Playback control keys on keyboard stops working. But using plasmoid pop-up to play/pause still works.

EXPECTED RESULT
Multimedia keys should be stable and not break.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: ArchLinux rolling as of 2020-02-28.
(available in About System)
KDE Plasma Version: 5.18.2
KDE Frameworks Version: 5.67.0
Qt Version: 5.15

ADDITIONAL INFORMATION
My music player is Deezer from AUR, a repackaged win32 build to mostly native Linux app with use of electron6.
Comment 1 rolodophone 2021-02-15 11:52:03 UTC
I think I have a similar issue. The multimedia keys do not work at all for me, however if I add the media controller widget and then remove it again, the keys start working.

Operating System: Manjaro Linux
KDE Plasma Version: 5.20.5
KDE Frameworks Version: 5.78.0
Qt Version: 5.15.2
Kernel Version: 5.4.89-1-MANJARO
OS Type: 64-bit
Processors: 4 × AMD Ryzen 3 1200 Quad-Core Processor
Memory: 15.6 GiB of RAM
Graphics Processor: GeForce GTX 970/PCIe/SSE2
Comment 2 Carlo 2022-09-02 09:29:10 UTC
This still happens to me. Both in X11 and Wayland.
It's freaking annoying and i see it as a 15-minutes-bug, tbh
Comment 3 Andres Pasquel 2022-09-06 21:14:05 UTC
I think I'm having the same bug. My media buttons play/pause next and previous worked normally and then stop working completely. Very annoying.
Comment 4 Orlando Rodriguez 2022-12-05 00:05:44 UTC
Same bug here. They randomly can work or not. I have detected that the media keys usually stop working when a notification is active. After closing the notification they start to work again. There are other cases when they stop to work (when I am watching youtube videos), but in this case, I don´t have a way to replicate the issue.
Comment 5 Matt 2022-12-06 10:17:59 UTC
Still an issue. One thing not yet mentioned is that removing the "Media Player" widget, then adding it again seems to temporarily fix the issue, so I would guess it's on issue with that applet? I will test not having Media Player widget at all in the task bar.
Comment 6 Myc 2022-12-21 06:43:14 UTC
I have also encountered this issue on KDE Fedora .  I use a dedicated media keys keyboard and wondered if something was wrong with it until I tried the workaround of disabling the applet and enabling it again.
I use KDEConnect and control media playing on a HTPC from my kde desktop as well as strawberry to play music, lastly with the occasional video on the local machine.
Operating System: Fedora Linux 35
KDE Plasma Version: 5.25.4
KDE Frameworks Version: 5.96.0
Qt Version: 5.15.2
Comment 7 Orlando Rodriguez 2023-01-14 08:09:24 UTC
After trying several things, I have noticed that this behavior happens everytime a notification comes and the notification is active. Once the notification is closed manually or automatically (by default 5 seconds), media buttons start to work again.

I replicated the issue several times using spotify (which by default send a notification every time a song is changed) so, I just change a song and try to use my volume buttons in that exact moment when the notification is launched.

In my case, the problem I see is related to the notification widget and the audio widget. I haven´t had any luck with the media widget.
Comment 8 Orlando Rodriguez 2023-01-14 09:14:18 UTC
Well, Just to add...after watching youtube videos for some minutes and the keys stop to work again, definitely, the media widget also has soemthing to do here. After removing it and add it again the problem stops for a longer time. This issue is very annoying in KDE, I hope this gets a better attention, because I have not found any workaround to fix it.
Comment 9 Orlando Rodriguez 2023-01-18 02:02:54 UTC
Update: After juggling with configurations, I noticed that the issue is related to the option: "Keep popup open during progress" in the notification settings. I just disabled that option and it looks like my issues with the volume are gone (in both cases, with Spotify and with youtube videos).
Comment 10 Andrey Babkin 2023-01-18 13:05:59 UTC
The same on Kubuntu, media player control button (play/pause) just stops working occasionally. Checked media control button functionality with xev, play/pause media button press is being detected by the system (keycode 172 (keysym 0x1008ff14, XF86AudioPlay)).  Also no luck with adding or removing the media control widget to  the tray or Task manager panel. "Shortcuts->Media Controller->Play/Pause media playback" is set to "Media play" (tried to reassign it to some other combination with no luck). Orlando's solution with notification settings also didn't work out for me. 

Looking forward for this issue to be resolved as the ability to play/pause  videos   running in the background   is critical for me.  I often follow tutorials on youtube etc and need to stop them while being focused on other windows.
Comment 11 Fushan Wen 2023-01-18 14:19:02 UTC
I never remembered ever seeing the bug, so I probably can't help here, and I strongly suspect the bug is in the media player, not the applet.
Comment 12 Myc 2023-02-01 23:53:48 UTC
This is happening multiple times a day.  It is highly annoying to have to stop what I'm doing to do the work around every couple hours.  I'm on 37 now and it's still a problem.
Operating System: Fedora Linux 37
KDE Plasma Version: 5.26.5
KDE Frameworks Version: 5.102.0
Qt Version: 5.15.8
Kernel Version: 6.1.8-200.fc37.x86_64 (64-bit)
Comment 13 Andrey Babkin 2023-02-02 05:24:05 UTC
UPD: For my situation I think I've found the root cause of the issue - most likely this was happening due to plasma integration plugin installed in chrome (https://chrome.google.com/webstore/detail/plasma-integration/cimiefiiaegbelhefglklhhakcgmhkai). After I removed this plugin, the play/pause button on my keyboard started to work. Then in some time I reinstalled this plugin  and as it was suggested in one of the comments on chrome marketplace,  I disabled chrome's hardware media handling (chrome://flags/#hardware-media-key-handling). After this done I have never encountered any issues with media controls . I hope this helps.
Comment 14 Matt 2023-02-02 05:38:39 UTC
(In reply to Andrey Babkin from comment #13)
> UPD: For my situation I think I've found the root cause of the issue - most likely this was happening due to plasma integration plugin installed in chrome

This seems likely. This line appears to be responsible for passing through media control events: https://github.com/KDE/plasma-browser-integration/blob/master/extension/extension-mpris.js#L164. If it fails, the browser will not see that media control event AIUI. I set a breakpoint on that line and not until did the music change.

FYI, there is an option to merely turn off media integration in the addon itself
Comment 15 Myc 2023-02-10 08:37:34 UTC
(In reply to Andrey Babkin from comment #13)
> UPD: For my situation I think I've found the root cause of the issue - most
> likely this was happening due to plasma integration plugin installed in
> chrome
> (https://chrome.google.com/webstore/detail/plasma-integration/
> cimiefiiaegbelhefglklhhakcgmhkai). After I removed this plugin, the
> play/pause button on my keyboard started to work. Then in some time I
> reinstalled this plugin  and as it was suggested in one of the comments on
> chrome marketplace,  I disabled chrome's hardware media handling
> (chrome://flags/#hardware-media-key-handling). After this done I have never
> encountered any issues with media controls . I hope this helps.

That is interesting that it could be induced by that as well.  I've found it happens most when I have a video playing on my HTPC and I play a quick video on my fedora machine.  I guess it gets confused and then just stops working.  I use Firefox and do not have the plasma integration installed.  It was causing a host of other problems so I removed it a while ago.
Comment 16 Myc 2023-03-12 06:59:40 UTC
This has required the workaround 15 times today.  It's been over three years, is a fix ever going to be implemented?
Comment 17 David G. 2023-08-20 15:58:15 UTC
I am also having this issue, and I've been having it for what feels like ages. If it could get some attention, it would be very much appreciated.
Comment 18 Jason 2023-09-03 23:12:55 UTC
I too can report having this issue for what feels like years.  Because of the randomness, I have never been able to figure out what is happening, and just thought I was going insane.  Now that I have found a workaround (disabling the chrome flag #hardware-media-key-handling)  my overall life frustration level has dropped.   LifeTip: Randomly dropping key-presses is a good way to agitate a human over a long period of time.  If there is any debugging info devs need I'd be glad to help.
Comment 19 Jan Klos 2023-09-18 10:21:12 UTC
I have been suffering from this bug for years and do not even have Chrome installed.
Comment 20 Lynn 2023-12-11 16:09:23 UTC
I have to agree with Fushan Wen. The media player widget is just an interface for MPRIS, nothing more. 
Most likely what is happening is that by removing/adding the media player widget you are changing which application the MPRIS passes the media keys to. 
There are many bug reports for this issue in regards to MPRIS on other bugtrackers. It isn't really a KDE issue, so this bug isn't something that can be fixed by KDE developers.
Comment 21 Jan Klos 2023-12-11 16:39:30 UTC
(In reply to Lynn from comment #20)
> Most likely what is happening is that by removing/adding the media player
> widget you are changing which application the MPRIS passes the media keys
> to. 

Absolutely not. the case (at least not what I am experiencing). The media keys stop working after some time REGARDLESS whether there are other media-type applications registering.

> There are many bug reports for this issue in regards to MPRIS on other
> bugtrackers. It isn't really a KDE issue, so this bug isn't something that
> can be fixed by KDE developers.

I only have this issue in KDE Plasma, which is my main environment. Never experienced it in Gnome, although I admittedly use them much less often.
Comment 22 Lynn 2023-12-11 16:45:44 UTC
(In reply to Jan Klos from comment #21)
Looking into it a bit more, the issue is definitely with the way KDE selects which player to send the MPRIS commands to. 
https://invent.kde.org/plasma/plasma-workspace/-/tree/master/libkmpris?ref_type=heads
It looks as if this has been overhauled in Plasma 6, as this directory isn't in my 5.27.10 source code on my computer. Hopefully so.