Jump to content

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


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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...