Bug 451270 - Media hotkeys don't do anything until plasmashell is restarted once
Summary: Media hotkeys don't do anything until plasmashell is restarted once
Status: RESOLVED FIXED
Alias: None
Product: plasmashell
Classification: Plasma
Component: Media Player (show other bugs)
Version: 5.24.3
Platform: Ubuntu Linux
: NOR normal
Target Milestone: 1.0
Assignee: Plasma Bugs List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-03-08 05:23 UTC by Miguel Guthridge
Modified: 2024-03-14 14:12 UTC (History)
10 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Miguel Guthridge 2022-03-08 05:23:55 UTC
SUMMARY
When I press the media hotkeys, they don't control my media playback. I have verified that they are assigned correctly in the settings window, and have even unassigned then reassigned them, but even though the system registers the shortcut, my media doesn't pause. I have tested this with Vivaldi media controls, KDE Connect, Elisa and VLC.

STEPS TO REPRODUCE
1. Press the media play-pause key on your keyboard
2. Observe that nothing happens

OBSERVED RESULT
Nothing happens

EXPECTED RESULT
Media will pause or resume

SOFTWARE/OS VERSIONS
Operating System: Kubuntu 21.10
KDE Plasma Version: 5.24.2
KDE Frameworks Version: 5.91.0
Qt Version: 5.15.2
Kernel Version: 5.13.0-30-generic (64-bit)
Graphics Platform: X11
Processors: 12 × Intel® Core™ i7-10750H CPU @ 2.60GHz
Memory: 15.4 GiB of RAM
Graphics Processor: Mesa Intel® UHD Graphics
Comment 1 Jan Klos 2022-03-12 11:37:50 UTC
Same problem here since 5.24.0. For me, the keys DO WORK for some time after reboot/login to KDE, but then just stop working (media prev/next and play/pause - volume controls always work without problems). This is specific to keyboard media keys only, clicking actual buttons in Media Player Controls in tray works well.
Comment 2 Jan Klos 2022-03-12 11:39:24 UTC
I forgot to add I'm running Arch. This is not distro-specific.
Comment 3 Nate Graham 2022-03-25 03:51:26 UTC
If you open the Media Player applet, you can see which app the shortcuts are targeting. Often what happens is that some ad or video file in your web browser takes over it, and you can make it target the app you want by specifically clicking on its icon in the icon tab bar at the top. Can you see if this is what's happening?
Comment 4 Jan Klos 2022-03-25 06:23:10 UTC
No it's not. Once the media hotkeys stop working, I can close each and every application and then reopen e.g. Spotify as an only app and it's still not working. Clicking the applet (seeing there's only one media app) and mouse-clicking the buttons works.
Comment 5 Jan Klos 2022-03-29 14:40:45 UTC
As an additional test, I have tried assigning additional keyboard shortcuts to prev/next/play/stop (to test whether the problem isn't just with just the  media keys / scancodes), but those do not work either. Even when the media player control is focused/pinned. Clicking individual buttons works.
Comment 6 Nate Graham 2022-03-31 21:14:32 UTC
Thanks for the info.
Comment 7 Yao Mitachi 2022-04-05 16:10:52 UTC
I am on Ubuntu 20.04 with an Apple style keyboard, and I am also having trouble with my media keys. Yesterday they were only working after I hit a key before it. I would hit Volume Up, several times, and nothing would  happen. I would tap Caps Lock or J or whatever, then hit Volume Up, and it would work... once.

Then I disconnected my keyboard, and reconnected it. Now media keys don't want to work at all, this issue continues today.

I've also noticed that Kinto.sh is not working correctly (the media keys issue occurs whether Kinto.sh was enabled or not) and the Cmd-Space shortcut doesn't bring up the application menu like it would before, only tapping Ctrl does. Global hotkeys such as opening the terminal (Ctrl/Cmd+Alt+T) is not working.

Is it odd that I'm experiencing this issue with an older version of Plasma than others here, though (Plasma 5.18.8, Frameworks 5.68)?
Comment 8 Riccardo Robecchi 2022-07-09 20:16:25 UTC
I can confirm this (and since it seems like many people are affected, I am marking this as "confirmed").
In my case, the media keys do not work immediately after the computer has booted up. In order for them to work, I have to restart Plasma (kquitapp5 plasmashell && kstart5 plasmashell) and then they start to work as intended. It is interesting to note that only one of my computers displays this behaviour, the others do not; they all have Neon installed. I am sure the issue is not the keyboard as it is shared through a KVM with a laptop, on which they work perfectly well. The issue is not a selection of another player in the plasmoid as previously suggested.

OS: KDE neon
KDE Plasma version: 5.25.2
KDE Frameworks version: 5.95.0
Qt version: 5.15.5
Comment 9 Mariusz Libera 2022-11-19 21:31:09 UTC
Just noticed that global media keys stopped working for me. Restarting plasma 'systemctl --user restart plasma-plasmashell.service' fixes it.

Operating System: Arch Linux
KDE Plasma Version: 5.26.3
KDE Frameworks Version: 5.100.0
Qt Version: 5.15.7
Kernel Version: 6.0.9-arch1-1 (64-bit)
Graphics Platform: X11
Processors: 8 × Intel® Core™ i7-8550U CPU @ 1.80GHz
Memory: 19.3 GiB of RAM
Graphics Processor: Mesa Intel® UHD Graphics 620
Manufacturer: LENOVO
Product Name: 81BF
System Version: Lenovo ideapad 520-15IKB
Comment 10 Fushan Wen 2024-03-14 13:51:08 UTC
In Plasma 6 the media shortcut is moved to kded, so it's no longer affected by plasmashell
Comment 11 Nicolas Fella 2024-03-14 13:58:45 UTC
(In reply to Fushan Wen from comment #10)
> In Plasma 6 the media shortcut is moved to kded, so it's no longer affected
> by plasmashell

That change is not merged, so this comment is premature
Comment 12 Fushan Wen 2024-03-14 14:01:26 UTC
(In reply to Nicolas Fella from comment #11)
> (In reply to Fushan Wen from comment #10)
> > In Plasma 6 the media shortcut is moved to kded, so it's no longer affected
> > by plasmashell
> 
> That change is not merged, so this comment is premature

Can you elaborate in case we were talking different things? The volume shortcut is not merged but the media shortcut is already merged.
Comment 13 Jan Klos 2024-03-14 14:11:02 UTC
It seems that plasma6 has indeed resolved this for me (or a switch from xorg to wayland, but I doubt it). Prev & next & play/pause keys seem to work perfectly all the time for me.

Never had any issue with volume keys.
Comment 14 Fushan Wen 2024-03-14 14:12:08 UTC
Thanks for the feedback