Bug 502501

Summary: Media Key usage blocked by bluetooth headphones
Product: [Unmaintained] plasma-mediacenter Reporter: Will Styler <will>
Component: MediaControllerAssignee: Sinny Kumari <ksinny>
Status: REPORTED ---    
Severity: normal    
Priority: NOR    
Version First Reported In: unspecified   
Target Milestone: ---   
Platform: Fedora RPMs   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description Will Styler 2025-04-06 22:35:47 UTC
SUMMARY

For some (but not all) bluetooth headphones (I've observed this with Sennheiser Momentum 4, but not Sony XM5s), upon connection, a second 'Media Player' is created with the name of the Bluetooth headphone. This shows nothing playing and appears to have no use, hitting the buttons does nothing, but after a short time, this becomes the default media player, and absorbs the media control hotkeys which would otherwise be directed at the running media playback app (e.g. cmus). 

In these cases, the media playback continues fine, and on-device controls control the media playback just fine (e.g. tap the earcup to pause, swipe forward to change track). But all keyboard media controls are eaten by this phantom device until it is disconnected and reconnected.

This may be difficult to address device-specifically, as not all bluetooth headphones create this device, but another way to address this would be to allow us to give priority to a certain media playback for control with media keys, or to 'disable' a media player.

I am very happy to run any commands you'd like to provide output which addresses this, understanding that not everybody has these particular headphones.

STEPS TO REPRODUCE
1. Connect offending headphones (e.g. Sennheiser Momentum 4) via Bluetooth. Codec doesn't appear to matter
2. Observe the creation of a second 'Media Player' entry for the headphones which is unresponsive to control.
3. Play music with a music player which accepts media controls (e.g. cmus)
4. Attempt to control using keyboard media playback keys (e.g. play/pause, next track)

OBSERVED RESULT

Immediately after connection, generally this works as expected, allowing you to use the media keys. However, after an unclear amount of time, media keys stop working, seemingly directed to this phantom media player.

EXPECTED RESULT

Media keys on keyboard work as expected. 

SOFTWARE/OS VERSIONS

Operating System: Fedora Linux 41
KDE Plasma Version: 6.3.4
KDE Frameworks Version: 6.12.0
Qt Version: 6.8.2
Kernel Version: 6.13.9-200.fc41.x86_64 (64-bit)
Graphics Platform: Wayland
Processors: 32 × AMD Ryzen 9 7950X 16-Core Processor
Memory: 61.9 GiB of RAM
Graphics Processor 1: AMD Radeon RX 7900 XTX
Graphics Processor 2: AMD Radeon Graphics
Comment 1 Will Styler 2025-04-06 23:00:04 UTC
It's worth noting as well that this phantom player is the one chosen by 'Choose Player Automatically', and that manually selecting the proper player does not re-direct the media player keyboard shortcuts to the proper place.
Comment 2 Will Styler 2025-04-07 06:45:03 UTC
One additional comment: Doing some research in bluetoothctl, I was able to determine that these headphones have a target for A/V remote control, using `sudo bluetoothctl` and then `info` will show you an 'A/V Remote Control Target' with a UUID. 

	UUID: A/V Remote Control Target (0000110c-0000-1000-8000-00805f9b34fb)

With this, it's clear (I think) why this device is causing this issue. Perhaps the bigger issue, then, is the fact that I don't appear to be able to exclude a given media control target from the KDE Media Player Handler, and that 'Choose Player Automatically' seems to prefer a non-playing, non-functioning 'player' over a running player.