Simple-Music-Player icon indicating copy to clipboard operation
Simple-Music-Player copied to clipboard

Unable to resume music with headphones hardware button

Open synergic777 opened this issue 3 years ago • 12 comments

Though pausing music is flawless, I am unable to resume music using a hardware button on my headphones

Conditions: Headphones: JBL Tune 500BT OS: Android 11 App: Simple Music Player 5.11.3

Steps to reproduce:

  • Play music on your headphones
  • Pause music using hardware button: as in result, music is paused
  • Try to resume music using the same button: as of result, the music remains stopped

Expected behaviour (this is how it works in AntennaPod, Spotify, VLC…): Pressing the button again resumes music

Possibly related with: https://github.com/SimpleMobileTools/Simple-Music-Player/issues/395

synergic777 avatar Jun 21 '22 08:06 synergic777

does double pressing skip to the next track?

tibbi avatar Jun 21 '22 09:06 tibbi

I'm afraid JBL Tune 500BT have Google Assistant/Siri assistants hard coded to double pressing. Though I can skip to the next track by holding the Volume Up button.

synergic777 avatar Jun 21 '22 10:06 synergic777

ok, if I send you a test version, can you try it out? You would have to uninstall your current version. You will see some message show up on button press.

tibbi avatar Jun 21 '22 10:06 tibbi

Of course!

synergic777 avatar Jun 21 '22 10:06 synergic777

ok, here it is. To install the test version first uninstall your current one and allow installing apps from unknown sources in the security settings of your device. Once you download the attachment on your device just remove the ".zip" extension by renaming. Github doesn't allow sending apk files directly for security reasons. After renaming just run it, it should be straightforward. If you cannot find the item related to installing apps from unknown sources, go into the device Settings -> Apps -> Special app access -> Install unknown apps and select your file manager, or the app you use for launching the sent file, then enable the "Allow from this source" item. music-player-core-release.apk.zip

tibbi avatar Jun 21 '22 10:06 tibbi

what messages do you see when pausing and when resume should happen?

tibbi avatar Jun 21 '22 10:06 tibbi

On pausing, I see "media 127" message, but on resuming it doesn't either resume music or show any message.

synergic777 avatar Jun 21 '22 10:06 synergic777

music-player-core-release.apk.zip how about this? If you still see nothing at resuming, does it work well in other apps? Isnt your system swallowing the action for some reason?

tibbi avatar Jun 21 '22 10:06 tibbi

On pausing, the app says "action android.intent.action.MEDIA_BUTTON", but on resuming there is no toast notification again. I am not sure about my system, though it works that way, correctly, in the following apps: VLC, Transistor, ViMusic, AntennaPod, Vinyl, Howl, LibreTube (all of them FLOSS) and Spotify (proprietary).

synergic777 avatar Jun 21 '22 10:06 synergic777

try this one please. If it wont work, Ill take a look at it some other day, it might be some bigger issue, not just the button itself. music-player-core-release.apk.zip

tibbi avatar Jun 21 '22 12:06 tibbi

Unfortunately the latest build doesn't fix the issue. Thanks for today's struggling

synergic777 avatar Jun 21 '22 13:06 synergic777

Just an addition. This used to be my main player, but I had to move to other one because apparently Simple Music Player is invisible regarding media control. Things I've noticed:

  • Last.FM scrobblers based on notification inspection don't detect Simple Music Player
  • Sending media key presses through adb do nothing (probably this is why headphones can't control the player, because the player ignores any hardware input). E.g. Trying to stop reproduction with $adb shell input keyevent 127 doesn't work.
  • KDEConnect doesn't detect the player either.

Months ago I tried to fix this myself by looking at your code and comparing it to Music Player GO, but I couldn't find any meaningful difference (edit: regarding this issue, of course). I don't know why this player is "invisible" and others aren't.

salazarbarrera avatar Jul 22 '22 18:07 salazarbarrera

Just updated to 5.14.0 - play/resume works flawlessly now. Thank you for your support!

synergic777 avatar Sep 07 '22 22:09 synergic777