Bug 466288

Summary: Bluetooth media sessions don't appear in Media Player when using mpris-proxy
Product: [Plasma] plasmashell Reporter: Jackson <jacksonburner>
Component: Media PlayerAssignee: Plasma Bugs List <plasma-bugs>
Status: RESOLVED FIXED    
Severity: normal CC: kde, nate, qydwhotmail
Priority: NOR    
Version: 5.27.1   
Target Milestone: 1.0   
Platform: Arch Linux   
OS: Linux   
Latest Commit: Version Fixed In: 5.27.3
Sentry Crash Report:

Description Jackson 2023-02-23 05:38:09 UTC
SUMMARY
By connecting my phone to my computer through Bluetooth, and by using PipeWire, I'm able to play my phone's audio through my computer. By default, my phone's Bluetooth media session doesn't show up in Media Player, but I can use BlueZ's mpris-proxy utility to expose the session as an MPRIS player. However, the MPRIS player generated by mpris-proxy isn't detected by Media Player. Media keys don't work either.

STEPS TO REPRODUCE
1. Use Bluetooth to connect a phone to a machine running Plasma with PipeWire as the audio system.
2. Play music on the phone. Make sure the sound output is set to the computer.
3. Open a terminal, and run `mpris-proxy`.

OBSERVED RESULT
The Media Player icon doesn't appear in the system tray, and manually selecting it results in the 'No media playing' message. Media keys don't affect playback, either.

EXPECTED RESULT
Once mpris-proxy is started, playback controls for the Bluetooth media session should appear in Media Player, and media keys should function.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Arch Linux (Wayland)
KDE Plasma Version: 5.27.1
KDE Frameworks Version: 5.103.0
Qt Version: 5.15.8

ADDITIONAL INFORMATION
I'm able to successfully control playback by using playerctl v2.4.1 or GNOME Shell 43.3.
I'm using a Pixel 6 running Android 13 with YouTube Music, but the same behavior should occur with other phone brands and music apps.
Comment 1 Fushan Wen 2023-03-05 14:52:05 UTC
Does mpris-proxy create an interface as expected? You can search "org.mpris.MediaPlayer2.bt_" in Qt DBus Viewer, and double click  "org/mpris/MediaPlayer2/org.freedesktop.DBus.Introspectable/Method: Introspect", and paste the output here.
Comment 2 Fushan Wen 2023-03-05 15:09:56 UTC
> kde.dataengine.mpris: MPRIS2 service "motorola_edge_s_____________" isn't standard-compliant, ignoring
Comment 3 Bug Janitor Service 2023-03-05 17:08:23 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/2719
Comment 4 Fushan Wen 2023-03-06 00:13:44 UTC
Git commit 177cf79ba2e1a055823677a710399b63bb55efb5 by Fushan Wen.
Committed on 05/03/2023 at 16:57.
Pushed by fusionfuture into branch 'Plasma/5.27'.

dataengines/mpris2: tolerate non-standards compliant players like mpris-proxy

BlueZ mpris-proxy doesn't provide "SupportedUriSchemes" or
"SupportedMimeTypes". Since the two properties are not directly used in
the media controller widget, show a debug message instead of rejecting
the player.
FIXED-IN: 5.27.3

M  +6    -2    dataengines/mpris2/mpris2engine.cpp

https://invent.kde.org/plasma/plasma-workspace/commit/177cf79ba2e1a055823677a710399b63bb55efb5
Comment 5 Fushan Wen 2023-03-06 11:40:37 UTC
Git commit 9dfd7608cb296694d0e8d6046cfd350f4fe4fd90 by Fushan Wen.
Committed on 06/03/2023 at 11:15.
Pushed by fusionfuture into branch 'master'.

dataengines/mpris2: tolerate non-standards compliant players like mpris-proxy

BlueZ mpris-proxy doesn't provide "SupportedUriSchemes" or
"SupportedMimeTypes". Since the two properties are not directly used in
the media controller widget, show a debug message instead of rejecting
the player.
FIXED-IN: 5.27.3


(cherry picked from commit 177cf79ba2e1a055823677a710399b63bb55efb5)

M  +6    -2    dataengines/mpris2/mpris2engine.cpp

https://invent.kde.org/plasma/plasma-workspace/commit/9dfd7608cb296694d0e8d6046cfd350f4fe4fd90