question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Can't control with bluetooth AVRCP controls via mpris-proxy

See original GitHub issue

Hello, thanks for writing this awesome TUI player, I use it everyday while I work and am super appreciative of your work!

Just wanted to log an issue I came across while playing with my new bluetooth headphones. According to the Arch wiki, bluetooth device AVRCP controls can be forwarded to players via MPRIS using the mpris-proxy tool included in bluez-utils. However, when I run mpris-proxy, I’m getting the following message:

org.bluez appeared
Bluetooth Adapter /org/bluez/hci0 found
player org.mpris.MediaPlayer2.tuijam at :1.68646 found
Can't register player
Operation is not supported
Bluetooth Transport /org/bluez/hci0/dev_38_18_4C_10_57_8C/sep1/fd0 found  <-- this is my headset connecting

Digging through the source of mpris-proxy led me to believe that something with the RegisterPlayer message is off and causing bluez to fail to register the player here. I also found this commit to another project that might hold a clue to the solution. But for all I can tell from reading the MPRIS spec, nothing really seems to be missing.

Obviously this is just a quality of life improvement and not a huge issue, but was curious if anyone knew how to solve this.

If it helps, here is the output of busctl while monitoring mpris-proxy:

‣ Type=method_call  Endian=l  Flags=0  Version=1  Priority=0 Cookie=57
  Sender=:1.17312  Destination=org.bluez  Path=/org/bluez/hci0  Interface=org.bluez.Media1  Member=RegisterPlayer
  UniqueName=:1.17312
  MESSAGE "oa{sv}" {
          OBJECT_PATH "/_1_10513";
          ARRAY "{sv}" {
                  DICT_ENTRY "sv" {
                          STRING "PlaybackStatus";
                          VARIANT "s" {
                                  STRING "Stopped";
                          };
                  };
                  DICT_ENTRY "sv" {
                          STRING "Rate";
                          VARIANT "d" {
                                  DOUBLE 1;
                          };
                  };
                  DICT_ENTRY "sv" {
                          STRING "Metadata";
                          VARIANT "a{sv}" {
                                  ARRAY "{sv}" {
                                  };
                          };
                  };
                  DICT_ENTRY "sv" {
                          STRING "Volume";
                          VARIANT "d" {
                                  DOUBLE 1;
                          };
                  };
                  DICT_ENTRY "sv" {
                          STRING "Position";
                          VARIANT "x" {
                                  INT64 0;
                          };
                  };
                  DICT_ENTRY "sv" {
                          STRING "MinimumRate";
                          VARIANT "d" {
                                  DOUBLE 1;
                          };
                  };
                  DICT_ENTRY "sv" {
                          STRING "MaximumRate";
                          VARIANT "d" {
                                  DOUBLE 1;
                          };
                  };
                  DICT_ENTRY "sv" {
                          STRING "CanGoNext";
                          VARIANT "b" {
                                  BOOLEAN true;
                          };
                  };
                  DICT_ENTRY "sv" {
                          STRING "CanGoPrevious";
                          VARIANT "b" {
                                  BOOLEAN true;
                          };
                  };
                  DICT_ENTRY "sv" {
                          STRING "CanPlay";
                          VARIANT "b" {
                                  BOOLEAN true;
                          };
                  };
                  DICT_ENTRY "sv" {
                          STRING "CanPause";
                          VARIANT "b" {
                                  BOOLEAN false;
                          };
                  };
                  DICT_ENTRY "sv" {
                          STRING "CanSeek";
                          VARIANT "b" {
                                  BOOLEAN false;
                          };
                  };
                  DICT_ENTRY "sv" {
                          STRING "CanControl";
                          VARIANT "b" {
                                  BOOLEAN true;
                          };
                  };
          };
  };

‣ Type=error  Endian=l  Flags=1  Version=1  Priority=0 Cookie=6076  ReplyCookie=57
  Sender=:1.12  Destination=:1.17312
  ErrorName=org.bluez.Error.NotSupported  ErrorMessage="Operation is not supported"
  UniqueName=:1.12
  MESSAGE "s" {
          STRING "Operation is not supported";
  };

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
cfangmeiercommented, Jan 22, 2020

I was able to play around with this with a set of bluetooth headphones I have and made a few observations.

First, with no modifications from the latest release of TUIJam, mpris-proxy doesn’t complain about being able to register the player.

> $ mpris-proxy
org.bluez appeared
Bluetooth Adapter /org/bluez/hci0 found
player org.mpris.MediaPlayer2.tuijam at :1.782 found
Bluetooth Transport /org/bluez/hci0/dev_00_25_BB_01_10_57/sep1/fd3 found

My headset has a play/pause button and two volume control buttons. The play/pause button seems to do nothing and while the volume control buttons audibly change the volume of the playback, this isn’t reflected in either the TUIJam volume control or my GNOME system volume.

Second, I added the org.bluez.Media1 interface to TUIJam and tested again. Doing this seems to have no effect on the behavior previously observed. I then used d-feet to compare the D-bus interface that TUIJam is producing with the Gnome music player (which does seem to work fine with mpris-proxy). I found that there were a few properties from the spec that TUIJam didn’t implement. I added them, and now at least the play button works on my headset.

Can you try checking out the latest version and see how it behaves on your system?

0reactions
nickclydecommented, Jan 22, 2020

Found a post on the Arch forums with a similar issue: https://bbs.archlinux.org/viewtopic.php?pid=1884292

Anyways, definitely seems like it’s not a tuijam issue. Thanks anyways for helping me dig @cfangmeier!!

Read more comments on GitHub >

github_iconTop Results From Across the Web

The bluetooth headset cannot control media playback (AVRCP).
Play a video using the mediaplayer-app 2. ... The bluetooth headset can not control the video playback. [Reproduce]
Read more >
Bluetooth AVRCP MPRISv2 Controls - Jolla Together Forums
Ok I did some digging and it seems that with Bluez 5 you get this out of the box and that is how...
Read more >
Re: AVRCP 1.6 — Linux Bluetooth - spinics.net
Linux Bluetooth: Re: AVRCP 1.6. ... is to use tools/mpris-proxy and then control it using a MPRIS controller. ... I can't find >...
Read more >
Bluetooth Audio driver issue (Avrcp Transport Adaptor )
Hi,. Thank you for writing to Microsoft Community Forums. This guided walk-through provides steps to fix ...
Read more >
bluetooth: Unify A2DP sink/source volumes with AVRCP ...
This patchset implements A2DP Absolute Volume control for both sources and sinks, using org.bluez.MediaTransport1 . This relies on AVRCP 1.4, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found