Jump to content

Resume play after replacing Bluetooth headset


NeekosDris

Recommended Posts

Hi. 

I've got an issue where my music stops automatically when I remove my bluetooth headset, but doesnt auto restart when I put them back in. I am using the Technics eah-az80 and I have three setting that says auto connect if the headphones are put back within 1 minute. 

Everything works fine with YT music, PlayerPro, or other video players. I only have the issue with Poweramp. 

I'm on Android 14, One UI 6.0 with the Samsung Galaxy S22 Ultra. 

Poweramp Version/Changelog

build-976-bundle-play [976004-c2601e58]

Full Version

64  bit

Thanks 👍🏾

 

Link to comment
Share on other sites

If this is something that the headset is meant to do for you, you'd need to see what commands the headset is actually sending to the phone in order to trigger playback to restart (see PA Settings=>Headset/Bluetooth=>Last Processed Commands).

If you are disconnecting the BT device from your phone and then reconnecting it, you'd need to enable PA Settings=>Headset/Bluetooth=>Resume on Bluetooth.

Andre

Link to comment
Share on other sites

Hi Andre. Thanks for getting back to me. I'm not disconnecting the earbuds. I'm just pressing the touch sensor once to pause, and then once again to restart. The last processed commands are below:

 

==================
18:33:52.181 PSMediaButtonReceiver android.intent.action.MEDIA_BUTTON
KEYCODE_MEDIA_PAUSE ACTION_UP name=Virtual source=0x0 sources=0x301 virt=true repeat=0 actionTime=397812055 sourcePak=com.android.bluetooth isAvrcp  flags=0x0 playerState=1
==================
18:33:52.807 PlayerService TOGGLE_PLAY_PAUSE
from PSMediaButtonReceiver pausePlaying 
==================
18:33:53.088 BTReceiver headset event
connection BT=true am mode=0 KIA MOTORS
==================
18:33:53.392 BTReceiver headset event
disconnection BT=true am mode=0 Technics EAH-AZ80 no_keep_notif_on_dscn=false
==================
18:33:57.556 PlayerService onRoutingChanged
newDevice=bt oldDevice=bt
==================
18:33:57.556 PlayerService reloadPipeline
 allowPlaying=true forceResume=false state after reload=2
==================
18:37:35.560 HeadsetPlugReceiver headset event
disconnection BT=false am mode=0 no_keep_notif_on_dscn=false
==================
18:37:35.647 BTReceiver headset event
disconnection BT=true am mode=0 KIA MOTORS no_keep_notif_on_dscn=false
==================
18:37:35.968 PlayerService onRoutingChanged
newDevice=speaker oldDevice=bt
==================
18:37:35.968 PlayerService reloadPipeline
 allowPlaying=false forceResume=false state after reload=2
==================
18:41:47.523 BTReceiver headset event
connection BT=true am mode=0 KIA MOTORS
==================
18:41:47.810 PlayerService onRoutingChanged
newDevice=bt oldDevice=speaker
==================
18:41:47.810 PlayerService reloadPipeline
 allowPlaying=true forceResume=false state after reload=2
==================
18:45:25.469 HeadsetPlugReceiver headset event
disconnection BT=false am mode=0 no_keep_notif_on_dscn=false
==================
18:45:25.488 BTReceiver headset event
disconnection BT=true am mode=0 KIA MOTORS no_keep_notif_on_dscn=false
==================
18:45:25.968 PlayerService onRoutingChanged
newDevice=speaker oldDevice=bt
==================
18:45:25.968 PlayerService reloadPipeline
 allowPlaying=false forceResume=false state after reload=2
==================
18:49:05.785 BTReceiver headset event
connection BT=true am mode=0 KIA MOTORS
==================
18:49:06.083 PlayerService onRoutingChanged
newDevice=bt oldDevice=speaker
==================
18:49:06.083 PlayerService reloadPipeline
 allowPlaying=true forceResume=false state after reload=2
==================
18:52:11.207 HeadsetPlugReceiver headset event
disconnection BT=false am mode=0 no_keep_notif_on_dscn=false
==================
18:52:11.226 BTReceiver headset event
disconnection BT=true am mode=0 KIA MOTORS no_keep_notif_on_dscn=false
==================
18:52:11.779 PlayerService onRoutingChanged
newDevice=speaker oldDevice=bt
==================
18:52:11.779 PlayerService reloadPipeline
 allowPlaying=false forceResume=false state after reload=2
==================
19:28:38.449 BTReceiver headset event
connection BT=true am mode=0 Technics EAH-AZ80
==================
19:28:38.963 PlayerService onRoutingChanged
newDevice=bt oldDevice=speaker
==================
19:28:38.964 PlayerService reloadPipeline
 allowPlaying=true forceResume=false state after reload=2
==================
19:28:55.969 PSMediaButtonReceiver android.intent.action.MEDIA_BUTTON
KEYCODE_MEDIA_PAUSE ACTION_DOWN name=Virtual source=0x0 sources=0x301 virt=true repeat=0 actionTime=399758750 sourcePak=com.android.bluetooth isAvrcp  flags=0x0 playerState=1
==================
19:28:56.003 PSMediaButtonReceiver android.intent.action.MEDIA_BUTTON
KEYCODE_MEDIA_PAUSE ACTION_UP name=Virtual source=0x0 sources=0x301 virt=true repeat=0 actionTime=399758784 sourcePak=com.android.bluetooth isAvrcp  flags=0x0 playerState=1
==================
19:28:56.626 PlayerService TOGGLE_PLAY_PAUSE
from PSMediaButtonReceiver pausePlaying 
==================
19:29:00.216 PSMediaButtonReceiver android.intent.action.MEDIA_BUTTON
KEYCODE_MEDIA_PAUSE ACTION_DOWN name=Virtual source=0x0 sources=0x301 virt=true repeat=0 actionTime=399762997 sourcePak=com.android.bluetooth isAvrcp  flags=0x0 playerState=2
==================
19:29:00.272 PSMediaButtonReceiver android.intent.action.MEDIA_BUTTON
KEYCODE_MEDIA_PAUSE ACTION_UP name=Virtual source=0x0 sources=0x301 virt=true repeat=0 actionTime=399763054 sourcePak=com.android.bluetooth isAvrcp  flags=0x0 playerState=2
 

The last 2 commands are the ones (as far as I understand). 

Hope this helps 

Thanks 

Kev

Link to comment
Share on other sites

@NeekosDris in your case BT stack sends KEYCODE_MEDIA_PAUSE 2 times and player complies. If it's not you, who presses the key, it's a BT device who does that.

The next Poweramp builds will include option to ignore key presses for a few seconds, but it won't help your case as pause command comes in 17 seconds.

Link to comment
Share on other sites

2 hours ago, andrewilley said:

Presumably this issue is not occurring with your Kia headunit (from earlier in the log) and only with the Technics device? Those two (20 seconds after connection) button presses are not actual presses of your own during testing are they?

Andre

Hi Andre. 

The KIA is my car unit. 

When I take my Technics earbuds out of my ear, it automatically pauses. Those 2 pause actions at the end are happening when I take the earbuds out of my ear and then put them back in (I assume). As I said, putting the earbuds back into my ears works fine on other music players. 

Thanks 

Kevin 

Link to comment
Share on other sites

Sorry, I think I followed up on a wrong thread subject with my last post (I was thinking about one regarding auto-start on BT reconnection, which I think may have been what Max was commenting about too).
 

So to get back on track and confirm your log details: when you remove your Technics earbuds from your ears, they send a MEDIA_PAUSE event to which Poweramp responds as expected and pauses playback:

==================
19:28:55.969 PSMediaButtonReceiver android.intent.action.MEDIA_BUTTON
KEYCODE_MEDIA_PAUSE ACTION_DOWN name=Virtual source=0x0 sources=0x301 virt=true repeat=0 actionTime=399758750 sourcePak=com.android.bluetooth isAvrcp  flags=0x0 playerState=1
==================
19:28:56.003 PSMediaButtonReceiver android.intent.action.MEDIA_BUTTON
KEYCODE_MEDIA_PAUSE ACTION_UP name=Virtual source=0x0 sources=0x301 virt=true repeat=0 actionTime=399758784 sourcePak=com.android.bluetooth isAvrcp  flags=0x0 playerState=1
==================
19:28:56.626 PlayerService TOGGLE_PLAY_PAUSE
from PSMediaButtonReceiver pausePlaying 

However when you put them back in your ears again a few seconds later, another MEDIA_PAUSE command is generated, but that does not resume playback:

==================
19:29:00.216 PSMediaButtonReceiver android.intent.action.MEDIA_BUTTON
KEYCODE_MEDIA_PAUSE ACTION_DOWN name=Virtual source=0x0 sources=0x301 virt=true repeat=0 actionTime=399762997 sourcePak=com.android.bluetooth isAvrcp  flags=0x0 playerState=2
==================
19:29:00.272 PSMediaButtonReceiver android.intent.action.MEDIA_BUTTON
KEYCODE_MEDIA_PAUSE ACTION_UP name=Virtual source=0x0 sources=0x301 virt=true repeat=0 actionTime=399763054 sourcePak=com.android.bluetooth isAvrcp  flags=0x0 playerState=2

Technically, I guess the second command, when you put the buds back in your ears, should really be either a MEDIA_PLAY command (to start playback) or a MEDIA_PLAY_PAUSE command (which is meant to toggle between any current playing or paused state).

For example, my own cabled headset button generates a MEDIA_PLAY_PAUSE event when I first press the button to pause, and the same again when I press it again to resume, so each event correctly toggles the playback state:

==================
16:38:18.470 PSMediaButtonReceiver android.intent.action.MEDIA_BUTTON
KEYCODE_MEDIA_PLAY_PAUSE ACTION_DOWN name=KTMicro KT USB Audio Consumer Control source=0x101 virt=false repeat=0 actionTime=18770057 sourcePak=android flags=0x8 playerState=1
==================
16:38:18.623 PSMediaButtonReceiver android.intent.action.MEDIA_BUTTON
KEYCODE_MEDIA_PLAY_PAUSE ACTION_UP name=KTMicro KT USB Audio Consumer Control source=0x101 virt=false repeat=0 actionTime=18770213 sourcePak=android flags=0x8 playerState=1
==================
16:38:19.236 PlayerService TOGGLE_PLAY_PAUSE
from PSMediaButtonReceiver pausePlaying
==================
16:38:28.246 PSMediaButtonReceiver android.intent.action.MEDIA_BUTTON
KEYCODE_MEDIA_PLAY_PAUSE ACTION_DOWN name=KTMicro KT USB Audio Consumer Control source=0x101 virt=false repeat=0 actionTime=18779835 sourcePak=android flags=0x8 playerState=2
==================
16:38:28.255 PlayerService RESUME
from PSMediaButtonReceiver resumePlaying 
==================
16:38:28.408 PSMediaButtonReceiver android.intent.action.MEDIA_BUTTON
KEYCODE_MEDIA_PLAY_PAUSE ACTION_UP name=KTMicro KT USB Audio Consumer Control source=0x101 virt=false repeat=0 actionTime=18779997 sourcePak=android flags=0x8 playerState=1


My Bluetooth headphones, which have the same remove/replace functionality as yours, generate a MEDIA_PAUSE when they are removed and then a MEDIA_PLAY when putting them back on again:

==================
16:56:55.545 PSMediaButtonReceiver android.intent.action.MEDIA_BUTTON
KEYCODE_MEDIA_PAUSE ACTION_DOWN name=Virtual source=0x0 sources=0x301 virt=true repeat=0 actionTime=19887144 sourcePak=com.android.bluetooth isAvrcp  flags=0x0 playerState=1
==================
16:56:55.720 PSMediaButtonReceiver android.intent.action.MEDIA_BUTTON
KEYCODE_MEDIA_PAUSE ACTION_UP name=Virtual source=0x0 sources=0x301 virt=true repeat=0 actionTime=19887319 sourcePak=com.android.bluetooth isAvrcp  flags=0x0 playerState=1
==================
16:56:56.404 PlayerService TOGGLE_PLAY_PAUSE
from PSMediaButtonReceiver pausePlaying 
==================
16:57:04.715 PSMediaButtonReceiver android.intent.action.MEDIA_BUTTON
KEYCODE_MEDIA_PLAY ACTION_DOWN name=Virtual source=0x0 sources=0x301 virt=true repeat=0 actionTime=19896314 sourcePak=com.android.bluetooth isAvrcp  flags=0x0 playerState=2
==================
16:57:04.738 PlayerService RESUME
from PSMediaButtonReceiver resumePlaying 
==================
16:57:04.954 PSMediaButtonReceiver android.intent.action.MEDIA_BUTTON
KEYCODE_MEDIA_PLAY ACTION_UP name=Virtual source=0x0 sources=0x301 virt=true repeat=0 actionTime=19896554 sourcePak=com.android.bluetooth isAvrcp  flags=0x0 playerState=1


Could you check to see what gets generated when you use the earbud's touch control actions to start and stop playback? 

Andre

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...