Jump to content

Seeking forward in a track WITHOUT first advancing to the next track?


Roey Katz

Recommended Posts

Curious behavior I'm noticing from Poweramp in Android Auto and a Genesis G80 car: upon seeking forward with the car's steering wheel controls, it first advances to the next track. Where can I disable this? I just want the controls to act like those of a standard CD player (i.e., long press forward or backward seeks within the track, quick press and release of the Forward button advances to the next track, quick press and release on Backward button recedes to the start of the previous track, and multiple presses/releases on Backward button recedes successively to previous tracks).                                                                                                                                                                                    
                 
 

Edited by Roey Katz
formatting
Link to comment
Share on other sites

It all depends on how your head-unit issues the button events when you long-press.

There are official proper FAST_FORWARD and REWIND events which your device could generate if it has been programmed that way, but more likely it will simply pass on the individual clicks by generating MEDIA_BUTTON KEYCODE_MEDIA_NEXT and MEDIA_BUTTON KEYCODE_MEDIA_PREVIOUS events from its '+' or -' controls.

A single click thus generates a BUTTON_DOWN event followed quickly by a BUTTON_UP event. The BUTTON_UP part is what Poweramp uses to commence the required action. A long-press would consist of one or more BUTTON_DOWN events, but no BUTTON_UP until the control is released. A double click would be two DOWN/UP clicks with a short gap between them.

To provide the user with greater functionality, Poweramp interprets the timing of these simple events to activate different features, but it can only make assumptions based on whatever PREVIOUS and NEXT events it receives. Could you take a look at PA Settings=>Headset/Bluetooth=>Last Processed Commands, and post the events that your device is seeing when you do a long-press versus a click. I would expect the log at that moment to contain something like this:

18:50:42.614 PSMediaButtonReceiver android.intent.action.MEDIA_BUTTON
KEYCODE_MEDIA_NEXT ACTION_DOWN A2dpOn  isAvrcp  flags=0x4 playerState=1
==================
18:50:43.104 PSMediaButtonReceiver android.intent.action.MEDIA_BUTTON
KEYCODE_MEDIA_NEXT ACTION_DOWN A2dpOn  isAvrcp  flags=0x84 playerState=1
==================
18:50:43.118 PlayerService BEGIN_FAST_FORWARD
from PSMediaButtonReceiver 
==================
18:50:49.368 PSMediaButtonReceiver android.intent.action.MEDIA_BUTTON
KEYCODE_MEDIA_NEXT ACTION_UP A2dpOn  isAvrcp  flags=0x4 playerState=1
==================
18:50:49.375 PlayerService END_FAST_FORWARD
from PSMediaButtonReceiver 


If the timings of the events are within Poweramp's internal threshold values, and using the default settings in Headset/Bluetooth, pressing '+' and '-' should result in:

Single click:  Next / Previous Track
Double click:  Next / Previous Category (e.g. change album or folder)
Long-press:  Fast-Forward or Rewind until button is released (seeking speed increases the longer the action continues)

 

Android's list of possible keycodes is huge by the way (see https://developer.android.com/reference/android/view/KeyEvent), this is only the media playback section:

KEYCODE_MEDIA_PLAY
KEYCODE_MEDIA_STOP
KEYCODE_MEDIA_PAUSE
KEYCODE_MEDIA_PLAY_PAUSE
KEYCODE_MEDIA_NEXT
KEYCODE_MEDIA_PREVIOUS
KEYCODE_MEDIA_FAST_FORWARD
KEYCODE_MEDIA_REWIND
KEYCODE_MEDIA_SKIP_FORWARD
KEYCODE_MEDIA_SKIP_BACKWARD
KEYCODE_MEDIA_STEP_FORWARD
KEYCODE_MEDIA_STEP_BACKWARD

Andre

Link to comment
Share on other sites

  • 5 months later...

Sorry, I know this is an old post but I'm having the same issue with Poweramp in my Kia. Using the steering wheel controls, "Next track" (up) and "Previous Track" (down) work correctly. However, "Fast Forward" (holding up) advances to the next track before forwarding kicks in, and "Rewind" (holding down) jumps back two tracks before rewinding kicks in. This used to work as expected (Fast forwarding and rewinding was to the currently playing track) and my car/head unit software hasn't been updated since so some update to Android Sytem/Android Auto/Poweramp broke this.

 

Here's my "Last Processed Commands" output:

Next Track (up, single press)

==================
09:48:15.088 PSMediaButtonReceiver android.intent.action.MEDIA_BUTTON
KEYCODE_MEDIA_NEXT ACTION_DOWN A2dpOn  isAvrcp  flags=0x4 playerState=1
==================
09:48:15.114 PlayerService NEXT
from PSMediaButtonReceiver 
==================
09:48:15.266 PSMediaButtonReceiver android.intent.action.MEDIA_BUTTON
KEYCODE_MEDIA_NEXT ACTION_UP A2dpOn  isAvrcp  flags=0x4 playerState=1

Fast Forward (hold up, then release)

==================
09:49:02.453 PSMediaButtonReceiver android.intent.action.MEDIA_BUTTON
KEYCODE_MEDIA_NEXT ACTION_DOWN A2dpOn  isAvrcp  flags=0x4 playerState=1
==================
09:49:02.495 PlayerService NEXT
from PSMediaButtonReceiver 
==================
09:49:02.997 PSMediaButtonReceiver android.intent.action.MEDIA_BUTTON
KEYCODE_MEDIA_NEXT ACTION_DOWN A2dpOn  isAvrcp  flags=0x84 playerState=1
==================
09:49:03.000 PlayerService BEGIN_FAST_FORWARD
from PSMediaButtonReceiver 
==================

(after releasing button)

09:49:04.846 PSMediaButtonReceiver android.intent.action.MEDIA_BUTTON
KEYCODE_MEDIA_NEXT ACTION_UP A2dpOn  isAvrcp  flags=0x4 playerState=1
==================
09:49:04.859 PlayerService END_FAST_FORWARD
from PSMediaButtonReceiver

Previous Track/Reset current track (down, single press)

==================
09:50:08.710 PSMediaButtonReceiver android.intent.action.MEDIA_BUTTON
KEYCODE_MEDIA_PREVIOUS ACTION_DOWN A2dpOn  isAvrcp  flags=0x4 playerState=1
==================
09:50:08.754 PlayerService PREVIOUS
from PSMediaButtonReceiver 
==================
09:50:08.870 PSMediaButtonReceiver android.intent.action.MEDIA_BUTTON
KEYCODE_MEDIA_PREVIOUS ACTION_UP A2dpOn  isAvrcp  flags=0x4 playerState=1

Rewind (hold down, then release)

==================
09:50:38.004 PSMediaButtonReceiver android.intent.action.MEDIA_BUTTON
KEYCODE_MEDIA_PREVIOUS ACTION_DOWN A2dpOn  isAvrcp  flags=0x4 playerState=1
==================
09:50:38.049 PlayerService PREVIOUS
from PSMediaButtonReceiver 
==================
09:50:38.501 PSMediaButtonReceiver android.intent.action.MEDIA_BUTTON
KEYCODE_MEDIA_PREVIOUS ACTION_DOWN A2dpOn  isAvrcp  flags=0x84 playerState=1
==================
09:50:38.506 PlayerService BEGIN_REWIND
from PSMediaButtonReceiver 
==================

(after releasing button)

09:50:41.096 PSMediaButtonReceiver android.intent.action.MEDIA_BUTTON
KEYCODE_MEDIA_PREVIOUS ACTION_UP A2dpOn  isAvrcp  flags=0x4 playerState=1
==================
09:50:41.099 PlayerService END_FAST_FORWARD
from PSMediaButtonReceiver

 

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