Jump to content

Rewind cmd not working in PA


Recommended Posts

When simulating a rewind media command (ie. Skip back 10 seconds) either from a remote device or a button on the phone, that cmd gets registered only once in PA. The second command doesn't work. There's a simple way to test this. 

1. Install this free app https://play.google.com/store/apps/details?id=flar2.homebutton

2. Map any button to perform a Rewind cmd (here I chose Single press Volume up button Button mapper https://imgur.com/gallery/9Clqd6K

In most music players (Gonemad, Jetaudio, Musicolet, etc.) pressing that button multiple times in a row will continuously rewind. In PA, it'll rewind only once. 

Edited by Chrisubuntu
Link to comment
Share on other sites

For Rewind/FastForward, PA normally expects a long-press event. For example, from the log in PA Settings > Headset/Bluetooth > Last Processed Commands, a press (ACTION_DOWN) event and a release (ACTION_UP) event:

==================
15:28:41.373 PSMediaButtonReceiver android.intent.action.MEDIA_BUTTON
KEYCODE_MEDIA_NEXT ACTION_DOWN A2dpOn isAvrcp flags=0x84 playerState=1
==================
15:28:41.378 PlayerService BEGIN_FAST_FORWARD
from PSMediaButtonReceiver
==================
15:28:44.364 PSMediaButtonReceiver android.intent.action.MEDIA_BUTTON
KEYCODE_MEDIA_NEXT ACTION_UP A2dpOn isAvrcp flags=0x4 playerState=1
==================
15:28:44.369 PlayerService END_FAST_FORWARD
from PSMediaButtonReceiver

PA should also respond to long-press on KEYCODE_MEDIA_REWIND and KEYCODE_MEDIA_FAST_FORWARD button events.


Possibly related, as you mention successive events, there is a known bug in the latest release of the 'Google' app (the voice command Assistant handler) which seems to somehow muddle the order of double-click events. Rolling that app back to factory-installed default version seems to resolve headset double/triple click issues. might be worth trying that in case this is what you are describing.

Andre

Link to comment
Share on other sites

You're right. Long press seems to work but not consistently. 1st of all, I have to wait like 4 seconds to long press for a second rewind to register. But other times, I have to Long press 2 or 3 times for the cmd to register 😔. Also I don't see an option to customize the rewind time and default is 5 seconds. Having to wait 4 seconds then the app rewinding 5 seconds makes this unusable, especially when listening to audiobooks, where rewinding is very important.  Is there a technical reason PA can't behave like the other apps I mentioned earlier ? 

Edited by Chrisubuntu
Link to comment
Share on other sites

There needs to be a short delay to detect the difference between and click and a hold, but button remapping software could be applying its own rules to that process too. Shouldn't be any more than half a second or so anyway. I used to use button remapping apps, but they all seem to interfere and have too many restrictions these days (without rooting anyway, which is what I did on all my previous devices).

Andre

Link to comment
Share on other sites

  • 5 months later...
On 7/1/2021 at 11:16 AM, andrewilley said:

There needs to be a short delay to detect the difference between and click and a hold, but button remapping software could be applying its own rules to that process too. Shouldn't be any more than half a second or so anyway. I used to use button remapping apps, but they all seem to interfere and have too many restrictions these days (without rooting anyway, which is what I did on all my previous devices).

Andre

Revisiting this thread. Do you know if dev did take a look at this issue. Seeing that he's just added a way to restore ratings and stats in recent release, this is only thing still bugging me about PA. I have a Samsung galaxy Note 9 and I've remapped single press of the Bixby button to "Rewind". So much convenient to rewind X amount second without turning on the phone. Doesn't need to be the Bixby button, even remapping Volume +/- works all the time on some players (but not all) like Gonemad, Jetaudio, Musicolet, Samsung music. 

Link to comment
Share on other sites

Why not send KEYCODE_MEDIA_REWIND (or KEYCODE_MEDIA_FAST_FORWARD) events? I don't think there is any delay before they trigger, and they should reliably ffwd or rewind, with increasing speed the longer the button is held, when sent (ACTION_DOWN event to start, ACTION_UP to stop).

Or do you want a 'tap-to-skip' button feature, to immediately move +/- 10s ? Not sure if KEYCODE_MEDIA_SKIP_FORWARD (272) and KEYCODE_MEDIA_SKIP_BACKWARD (273) events are supported by PA, but maybe @maxmp could add a little bit of code to watch for those and trigger the skip +/-10s feature?

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...