Unable to resume music with headphones hardware button
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
does double pressing skip to the next track?
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.
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.
Of course!
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
what messages do you see when pausing and when resume should happen?
On pausing, I see "media 127" message, but on resuming it doesn't either resume music or show any message.
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?
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).
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
Unfortunately the latest build doesn't fix the issue. Thanks for today's struggling
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 127doesn'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.
Just updated to 5.14.0 - play/resume works flawlessly now. Thank you for your support!