Bug: Pause/Play doesn't work with Bluetooth earphones' buttons on Android 12+

Search This thread

gururoop

Senior Member
Dec 24, 2011
579
275
Google Pixel 4 XL
Google Pixel 6 Pro
I've noticed that pause/play using Bluetooth earphones' buttons is not working in any version of Android 12 (tested on every version, from DP1 till PB1). The sound is muted for a few seconds, but the video continues playing. I've tried both free and pro versions and tried toggling the settings. The same problem also exists in Facebook app but not VLC player nor XPlayer.
 

MXPlayer

Senior Member
Nov 3, 2015
418
114
mx.j2inter.com
I've noticed that pause/play using Bluetooth earphones' buttons is not working in any version of Android 12 (tested on every version, from DP1 till PB1). The sound is muted for a few seconds, but the video continues playing. I've tried both free and pro versions and tried toggling the settings. The same problem also exists in Facebook app but not VLC player nor XPlayer.
Please collect a bug report from the help menu on the playback screen quickly after reproducing the problem and share it with us at [email protected] along with a reference to this thread link. Once received, we will investigate this further and get a workaround for your issues.

Thank You.
 

Thirumalai.K

Inactive Recognized Contributor
Sep 14, 2011
2,273
4,114
Just an update, the bug is not resolved in Android 12 Beta 2, which was released yesterday.
We apologize for the delayed response.

Based on the information provided, there seems to be a bug in Android 12's MediaPlayer implementation. Please select HW+ Decoder from the menu options on the playback screen and let us know if it fixes your problems.
 

gururoop

Senior Member
Dec 24, 2011
579
275
Google Pixel 4 XL
Google Pixel 6 Pro
We apologize for the delayed response.

Based on the information provided, there seems to be a bug in Android 12's MediaPlayer implementation. Please select HW+ Decoder from the menu options on the playback screen and let us know if it fixes your problems.

The problem is not solved by choosing HW+ decoder. I understand that this problem is in Android 12 (because the same problem exists in videos on Facebook app), but some other media players like X Player and VLC seem to have apparently found a workaround the issue. Good luck with that. I am really missing my favourite media since Android 12 DPs started coming out.
 

gururoop

Senior Member
Dec 24, 2011
579
275
Google Pixel 4 XL
Google Pixel 6 Pro
Just an update, this problem is not yet been solved. I have tried every monthly patch of Android 12, 12L Beta 3 and now Android 13 DP1. The reason I keep on checking MX Player Pro if they fixed it after every update is that it is awesome and still much better than VLC Player and X Video Player, both of which have found workaround to this issue. I hope and request the developers fix this issue so that I can get back to using my favorite player since more than 10 years again.
 
  • Like
Reactions: Batman1302

gangpe

Senior Member
Aug 20, 2010
351
85
Same here. I've pinged the devs via tickets a few times with the logs attached. Heartbreaking considering other players are able to use the Bluetooth controls. Hope they fix this soon; I'll buy the pro version once they do.
 
  • Like
Reactions: Batman1302

Batman1302

New member
Apr 6, 2022
1
0
Friends, the same has happened to me. It's a horrible mistake, I thought it was a problem with my cell phone. MX Player is very important to me because it's the only one I use to watch classes, due to the perfect compatibility with MixPlorer. Could you please let me know when the bug is resolved? I'm considering staying with the BS Player while they don't solve it.
 

Renate

Recognized Contributor / Inactive Recognized Dev
Feb 3, 2012
3,604
1,598
Boston
www.temblast.com
Nexus 7 (2013)
Moto E5
You need to break this problem down.
Get UsbMode.apk out of my sig. Figure out what keys your headphones send.
Then, try to send the keycodes manually with ADB.
Code:
$ input keyevent 126
$ input keyevent 127
$ input keyevent 85
$ input keyevent 85
That's Play, Pause, Play/Pause
Your headphones may be "Apple compatible" and send out multiple keypresses just to be stupid.
 
  • Like
Reactions: ze7zez

slamming_sammy1

Senior Member
Feb 13, 2007
299
7
You need to break this problem down.
Get UsbMode.apk out of my sig. Figure out what keys your headphones send.
Then, try to send the keycodes manually with ADB.
Code:
$ input keyevent 126
$ input keyevent 127
$ input keyevent 85
$ input keyevent 85
That's Play, Pause, Play/Pause
Your headphones may be "Apple compatible" and send out multiple keypresses just to be stupid.
ok but why does it work with other apps like the built-in samsung music player; also downloaded a podcast app called podkicker and that works like a charm
 

Renate

Recognized Contributor / Inactive Recognized Dev
Feb 3, 2012
3,604
1,598
Boston
www.temblast.com
Nexus 7 (2013)
Moto E5
Just a stab in the dark, I would guess that your headphones are sending multiple keys.
That can be hard to see in my UsbMode.apk but if you press the key enough times you'll see wonkiness.
In any case, if the manual key insertion works responsibly you can guess what's happening.

Reverse engineering and flashing the headphones can probably be done, but it is a bit of a project.
I do that to all my BLE keyboards because I hate stupid identifier like "Anker 1234".
I prefer "English" and "Russian".
(Although, since the start of the year I don't use the latter keyboard.)
 

slamming_sammy1

Senior Member
Feb 13, 2007
299
7
it's not the headphones. I've tried 5 to 6 different bluetooth devices and they all don't work; but they all work with other apps; it's the app
 

leo46

Member
Jun 29, 2014
12
1
I noticed the same problem and am willing to help debug it.

I am using Pixel Buds Pro with a Pixel 6a with Android 13.

I downloaded & installed USB Mode but unfortunately I don't see any key printed when triggering the pause control on the earbuds. Using ADB shell to send key events show them as expected. Could it be that these earphones use another mehcanism to send play/pause events?

I created an issue here describing which apps work and which won't, maybe this can help:
 

Attachments

  • Screenshot_20220919-094154.png
    Screenshot_20220919-094154.png
    150.9 KB · Views: 3
Last edited:

Renate

Recognized Contributor / Inactive Recognized Dev
Feb 3, 2012
3,604
1,598
Boston
www.temblast.com
Nexus 7 (2013)
Moto E5
Oh, I was thinking that headphones were just using HID (7 keyboard or 0xc consumer) over Bluetooth.
I've verified that they are using AVRCP instead.

I dug out my old Bluetooth headphones to give this a whack.
It's got some wacky multifunction knob/switch that I was never sure exactly how it worked.

My /system/usr/keylayout/AVRCP.kl is conspicuously missing:
Code:
key 164   MEDIA_PLAY_PAUSE
So I put it in. (You must be rooted or Magisk or something.)
But... I commented it out and it still worked!
So it must be using Generic.kl

Also, I never see headphone buttons in UsbMode.apk even when they are working.
I have a footpedal that generates MEDIA_PLAY and MEDIA_STOP and I see them.
But that uses HID 0xc consumer controls.

Still, maybe your system is doing something different.
It might be worth trying to edit AVRCP.kl

I looked at this some more. "Media buttons" get dispatched a little bit differently, that's why UsbMode.apk didn't see them.
android.intent.action.MEDIA_BUTTON
https://developer.android.com/guide/topics/media-apps/mediabuttons

I'll look at this some more.
 

Top Liked Posts

  • There are no posts matching your filters.
  • 1
    Here are the grep results in case you still need them. I'll send the logcat later.

    Code:
    Generic.kl:key 164   MEDIA_PLAY_PAUSE
    Vendor_046d_Product_b501.kl:key 164 MEDIA_PLAY_PAUSE
    Vendor_05ac_Product_0239.kl:key 164   MEDIA_PLAY_PAUSE
    Vendor_0957_Product_0001.kl:key usage 0x000c00CD    MEDIA_PLAY_PAUSE
    Vendor_1949_Product_0401.kl:key 164 MEDIA_PLAY_PAUSE
    Vendor_22b8_Product_093d.kl:key 164   MEDIA_PLAY_PAUSE
    Vendor_2378_Product_1008.kl:key 164 MEDIA_PLAY_PAUSE
    Vendor_2378_Product_100a.kl:key 164 MEDIA_PLAY_PAUSE
    qwerty.kl:key 164   MEDIA_PLAY_PAUSE
  • 1
    Just an update, this problem is not yet been solved. I have tried every monthly patch of Android 12, 12L Beta 3 and now Android 13 DP1. The reason I keep on checking MX Player Pro if they fixed it after every update is that it is awesome and still much better than VLC Player and X Video Player, both of which have found workaround to this issue. I hope and request the developers fix this issue so that I can get back to using my favorite player since more than 10 years again.
    1
    Same here. I've pinged the devs via tickets a few times with the logs attached. Heartbreaking considering other players are able to use the Bluetooth controls. Hope they fix this soon; I'll buy the pro version once they do.
    1
    You need to break this problem down.
    Get UsbMode.apk out of my sig. Figure out what keys your headphones send.
    Then, try to send the keycodes manually with ADB.
    Code:
    $ input keyevent 126
    $ input keyevent 127
    $ input keyevent 85
    $ input keyevent 85
    That's Play, Pause, Play/Pause
    Your headphones may be "Apple compatible" and send out multiple keypresses just to be stupid.
    1
    Here are the grep results in case you still need them. I'll send the logcat later.

    Code:
    Generic.kl:key 164   MEDIA_PLAY_PAUSE
    Vendor_046d_Product_b501.kl:key 164 MEDIA_PLAY_PAUSE
    Vendor_05ac_Product_0239.kl:key 164   MEDIA_PLAY_PAUSE
    Vendor_0957_Product_0001.kl:key usage 0x000c00CD    MEDIA_PLAY_PAUSE
    Vendor_1949_Product_0401.kl:key 164 MEDIA_PLAY_PAUSE
    Vendor_22b8_Product_093d.kl:key 164   MEDIA_PLAY_PAUSE
    Vendor_2378_Product_1008.kl:key 164 MEDIA_PLAY_PAUSE
    Vendor_2378_Product_100a.kl:key 164 MEDIA_PLAY_PAUSE
    qwerty.kl:key 164   MEDIA_PLAY_PAUSE