Jump to content
Poweramp
SuryaChandra

Bluetooth headset control not working

Recommended Posts

Same situation with my devices: OnePlus 5 and Sony wh-1000xm2. Play, stop, volume up/down work correctly, next/previous track - no response.

Share this post


Link to post
Share on other sites

Settings>Audio>Output>AudioTrack Output>Bluetooth (v709)

I've personally managed to solve this. I'm using an Axon 7  running a Custom ROM on 8.1. The OpenSL ES Output is breaking the Bluetooth responsiveness, which I figured out through curiously toggling on that option in foobar2000, which I used to control my Jaybird X2s in the gym.

 

 

 

Share this post


Link to post
Share on other sites
10 hours ago, Pointro said:

Settings>Audio>Output>AudioTrack Output>Bluetooth (v709)

I've personally managed to solve this. I'm using an Axon 7  running a Custom ROM on 8.1. The OpenSL ES Output is breaking the Bluetooth responsiveness, which I figured out through curiously toggling on that option in foobar2000, which I used to control my Jaybird X2s in the gym.

 

 

 

Confirmed...this definitely fixes BT control. Still outputs HiRes through my Sony 1000XM2's according to the dumpsys as well.

Added... Out of curiosity I tried switching back to the Hi Res API which BT controls stopped working on and the BT controls are working again. ERM!!!

Great catch @Pointro

Edited by beastobadness
Added further info

Share this post


Link to post
Share on other sites

I knew this won't be an issue only with me. I am using a Nexus 6 and Bluetooth controls don't work for me but only on specific ROMs. The controls work fine on Dirty Unicorns but don't work on Resurrection Remix and AEX. So yes, this is not an issue with Poweramp but with the ROM. However, other players work fine on any ROM. So Max, please add what is missing in our favourite music player. 

Edit: This has fixed the issue, thank you so much man!

Share this post


Link to post
Share on other sites

I had the same problem with beta 795, Xperia XZ2 Premium and Sony WH-1000XM2. Switching from hi-res output to OpenSL ES solved the problem, but switching back to hi-res did not break it again (and I'm pretty sure it switched back properly, cause there's noticeable difference in volume between the two). Now I can't break it back even if I restart Poweramp or reboot the phone itself. Weird, but hopefully helps someone.

Share this post


Link to post
Share on other sites

I have the same problem with my Sony WH-H900N (H.EAR) headset. I can pause the currently playing song, but I cannot resume it. I tried switching back and forth between normal OpenSL ES Output and OpenSL ES Hi-Res Output. What happens is that after I have switched and re-connected the headset, I can successfully trigger a PLAY event *once*, but then the headset falls back to the old behavior, i.e. PAUSE works and PLAY does nothing. According to Poweramp, the following events are received while I sent a PAUSE event, then one PLAY event, and then another PLAY event:

 

==================
14:24:11.025 PSMediaButtonReceiver android.intent.action.MEDIA_BUTTON
KEYCODE_MEDIA_PAUSE ACTION_DOWN name=Virtual source=0x0 sources=0x301 virt=true repeat=0 actionTime=10133703 A2dpOn  isAvrcp  playerState=1
==================
14:24:11.056 PSMediaButtonReceiver android.intent.action.MEDIA_BUTTON
KEYCODE_MEDIA_PAUSE ACTION_UP name=Virtual source=0x0 sources=0x301 virt=true repeat=0 actionTime=10133735 A2dpOn  isAvrcp  playerState=1
==================
14:24:11.061 PlayerService PAUSE
from PSMediaButtonReceiver pausePlaying
==================
14:24:17.827 PSMediaButtonReceiver android.intent.action.MEDIA_BUTTON
KEYCODE_MEDIA_PAUSE ACTION_DOWN name=Virtual source=0x0 sources=0x301 virt=true repeat=0 actionTime=10140506 A2dpOn  isAvrcp  playerState=2
==================
14:24:17.858 PSMediaButtonReceiver android.intent.action.MEDIA_BUTTON
KEYCODE_MEDIA_PAUSE ACTION_UP name=Virtual source=0x0 sources=0x301 virt=true repeat=0 actionTime=10140537 A2dpOn  isAvrcp  playerState=2
==================
14:24:26.031 PSMediaButtonReceiver android.intent.action.MEDIA_BUTTON
KEYCODE_MEDIA_PAUSE ACTION_DOWN name=Virtual source=0x0 sources=0x301 virt=true repeat=0 actionTime=10148709 A2dpOn  isAvrcp  playerState=2
==================
14:24:26.072 PSMediaButtonReceiver android.intent.action.MEDIA_BUTTON
KEYCODE_MEDIA_PAUSE ACTION_UP name=Virtual source=0x0 sources=0x301 virt=true repeat=0 actionTime=10148750 A2dpOn  isAvrcp  playerState=2

 

Share this post


Link to post
Share on other sites

Looks like PA is being sent MEDIA_PAUSE commands, which if handled correctly will always pause playback (even if it is already paused).

MEDIA_PLAY should be used to recommence playback, or MEDIA_PLAY_PAUSE can be used as a toggle function.

Andre

Share this post


Link to post
Share on other sites
Quote

MEDIA_PLAY should be used to recommence playback, or MEDIA_PLAY_PAUSE can be used as a toggle function.

 

Is there any way for me to control what event the headset triggers?

Share this post


Link to post
Share on other sites

To add just another data point to this topic, my Sony WH-H900N headset works just fine with all other applications I've tried. VLC, TuneIn, and the standard Music Player all toggle correctly between play / pause when I tap the appropriate button. Poweramp is the only app I've encountered so far that doesn't resume playing once I've paused the audio.

Share this post


Link to post
Share on other sites

Possibly the other apps are treating the PAUSE command as a toggle, whereas Poweramp is correctly treating is as a pause (only) command.

@maxmp a while back I suggesting creating a user-option to allow PA to process PAUSE as if it were PLAY_PAUSE, for devices like this which only issue the one command version. Would this help here?

Andre

Share this post


Link to post
Share on other sites

How can I create an user-option to PLAY_PAUSE? I have the same problem with an Anker Soundcore Vortex. Pause-Play work well with any player but Poweramp. Thanks.

Share this post


Link to post
Share on other sites
7 hours ago, PsychoTwM said:

How can I create an user-option to PLAY_PAUSE?

You can't. Generally Bluetooth devices send commands that are hard-coded into the design of that device. Check Settings > Headset/Bluetooth > Last Processed Commands to see what the device is sending to PA. 

Andre

Share this post


Link to post
Share on other sites

I don't know ... buying  a separate app that may or may not solve this issue seems like a poor solution and I'd rather not do that. I'd very much prefer that issue fixed in Poweramp directly.

Share this post


Link to post
Share on other sites
1 hour ago, peti said:

I'd very much prefer that issue fixed in Poweramp directly.

Unfortunately Poweramp is doing exactly what it should - i.e. when it receives a MEDIA_PAUSE command, it is pausing as instructed. If the BT device intended to trigger an Android PLAY_PAUSE event, then really that's what it should be sending. Have you contacted the support department for the BT device by the way?

Andre

Share this post


Link to post
Share on other sites
8 hours ago, peti said:

I don't know ... buying  a separate app that may or may not solve this issue seems like a poor solution and I'd rather not do that. I'd very much prefer that issue fixed in Poweramp directly.

I anderstand you. So you can try to use demo-verion here Voice Headset Poweramp Controller Demo version 1.4

Share this post


Link to post
Share on other sites
On 6/21/2019 at 11:51 PM, andrewilley said:

Unfortunately Poweramp is doing exactly what it should.

Well, no, it's not doing what it should. Every other app I have responds by resuming playing. TuneIn does that. VLC does that. The Android Music Player does that. The only app that does not respond that way is Poweramp. You'd have to have a rather strained definition of "should" IMHO to say that this is useful and intended behavior.

Share this post


Link to post
Share on other sites

Poweramp is constantly developed, so please post your Poweramp build number (Settings/About) and preferable share the headset button log (Settings/Headset/Bluetooth/Last Processed Commands). Thanks!

(RE: some issues which other players don’t have - Poweramp is unique player and uses Android audio subsystem in the way other players don’t. This works OK on most devices, but it can also expose some system bugs not known otherwise. I usually add some workarounds for the affected devices/ROMs if I can reproduce the issue locally. Good example is Huaweis EMUI up to 8.0 using code from Android 2.3 not being aware of hi-res music playing on the device).

Share this post


Link to post
Share on other sites
2 hours ago, peti said:

Well, no, it's not doing what it should. 

Technically, yes it is. Poweramp is correctly interpreting your headset's MEDIA_PAUSE event to mean what it says on the tin: i.e. PAUSE - not PLAY, not toggle via PLAY_PAUSE. If I had a control device with both a Pause and a Play button, then however many times I press Play music should be made to play (via a MEDIA_PLAY event) and however many times I press Pause it should stay paused (via MEDIA_PAUSE). If you want to have a single Pause/Play button, that would be a different matter and it should trigger a MEDIA_PLAY_PAUSE event.

With my own Bluetooth headset, this is the command sequence sent when I tap the side button - note the specific PLAY commands when the headset wants music to play, and a separate discrete PAUSE command when it wants the player to stop:

13:48:40.402 PSMediaButtonReceiver android.intent.action.MEDIA_BUTTON
KEYCODE_MEDIA_PAUSE ACTION_DOWN name=Virtual source=0x0 sources=0x301 virt=true repeat=0 actionTime=370216952 A2dpOn  isAvrcp  playerState=1
==================
13:48:40.435 PSMediaButtonReceiver android.intent.action.MEDIA_BUTTON
KEYCODE_MEDIA_PAUSE ACTION_UP name=Virtual source=0x0 sources=0x301 virt=true repeat=0 actionTime=370216985 A2dpOn  isAvrcp  playerState=1
==================
13:48:40.447 PlayerService PAUSE
from PSMediaButtonReceiver pausePlaying 
==================
13:48:42.440 PSMediaButtonReceiver android.intent.action.MEDIA_BUTTON
KEYCODE_MEDIA_PLAY ACTION_DOWN name=Virtual source=0x0 sources=0x301 virt=true repeat=0 actionTime=370218990 A2dpOn  isAvrcp  playerState=2
==================
13:48:42.465 PlayerService RESUME
from PSMediaButtonReceiver resumePlaying 
==================
 

However your other apps are all interpreting PAUSE as meaning PLAY_PAUSE, which while incorrect is not uncommon and happens to do what you want. As I said earlier, one possible solution for devices that send the wrong commands would be an option in Poweramp to deliberately treat PAUSE as PLAY_PAUSE. It would have to be an option though, as it would break other (correct) headset controls otherwise.

Andre

Share this post


Link to post
Share on other sites
8 minutes ago, maxmp said:

Poweramp is constantly developed, so please post your Poweramp build number (Settings/About) and preferable share the headset button log (Settings/Headset/Bluetooth/Last Processed Commands).

The log was shared further up the thread:

Andre

Share this post


Link to post
Share on other sites

The pause triggering play action instead may be an option for headsets like that (it can’t be enabled for everyone as some devices send many pause commands during first seconds of connection) though I prefer to find root cause of the issue. 

Share this post


Link to post
Share on other sites

May this be related to my car audio not resuming playback after a phone call? It resumes for a brief second and pauses again, then I have to press play to get it playing normally. HTC U11+ running stock HTC ROM on Android 8.0 connected to a Bluetooth 3.0-enabled Alpine car audio.

Share this post


Link to post
Share on other sites

@teorouge Poweramp has a log of incoming and executed commands in Settings / Headset/BT / Last Processed Commands. You can make a screenshot from there or directly copy/paste or share the contents otherwise (via 3-dot menu there) and post here - this will make it clear if it’s player or device issue (and if some workaround for future builds is possible).

For example, some devices sends multiple PAUSE commands on connection, may be this conflicts with the resuming after the call.

Share this post


Link to post
Share on other sites
49 minutes ago, maxmp said:

@teorouge Poweramp has a log of incoming and executed commands in Settings / Headset/BT / Last Processed Commands. You can make a screenshot from there or directly copy/paste or share the contents otherwise (via 3-dot menu there) and post here - this will make it clear if it’s player or device issue (and if some workaround for future builds is possible).

For example, some devices sends multiple PAUSE commands on connection, may be this conflicts with the resuming after the call.

Nice logging, gonna provide that ASAP.

 

EDIT: please note it happens only with my car audio system, no issues with other systems or my Jaybird X3 headset.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...