OpenSilk / Orpheus

Orpheus Music Player
https://play.google.com/store/apps/details?id=org.opensilk.music
GNU General Public License v3.0
52 stars 20 forks source link

Play/Pause Button on Headset #4

Open Nutomic opened 9 years ago

Nutomic commented 9 years ago

I have a headset with a play/pause button.

Pressing that button has a noticable delay of about one second. In Apollo on the other hand, the button works instantly.

This is on a Nexus 5 running OmniROM (Kitkat).

I recorded a log at the same time:

D/AudioFlinger(  224): copl(39):resume hal
W/Binder  (  834): Caught a RuntimeException from the binder stub implementation.
W/Binder  (  834): java.lang.IllegalArgumentException: Wake lock not active
W/Binder  (  834):      at com.android.server.power.PowerManagerService.updateWakeLockWorkSourceInternal(PowerManagerService.java:825)
W/Binder  (  834):      at com.android.server.power.PowerManagerService.updateWakeLockWorkSource(PowerManagerService.java:811)
W/Binder  (  834):      at com.android.server.power.PowerManagerService.updateWakeLockUids(PowerManagerService.java:792)
W/Binder  (  834):      at android.os.IPowerManager$Stub.onTransact(IPowerManager.java:103)
W/Binder  (  834):      at android.os.Binder.execTransact(Binder.java:404)
D/AudioTrack(  224): copl:AudioTrack::Pause called
D/AudioFlinger(  224): pause(0), calling pid 1791
W/WakefulBroadcastReceiver( 1791): No active wake lock id #22
D/AudioFlinger(  224): copl(39):pause hal
W/Binder  (  834): Caught a RuntimeException from the binder stub implementation.
W/Binder  (  834): java.lang.IllegalArgumentException: Wake lock not active
W/Binder  (  834):      at com.android.server.power.PowerManagerService.updateWakeLockWorkSourceInternal(PowerManagerService.java:825)
W/Binder  (  834):      at com.android.server.power.PowerManagerService.updateWakeLockWorkSource(PowerManagerService.java:811)
W/Binder  (  834):      at com.android.server.power.PowerManagerService.updateWakeLockUids(PowerManagerService.java:792)
W/Binder  (  834):      at android.os.IPowerManager$Stub.onTransact(IPowerManager.java:103)
W/Binder  (  834):      at android.os.Binder.execTransact(Binder.java:404)
D/AwesomePlayer(  224): copl: pause, arm a tear down timer for 60000000 us
W/TimedEventQueue(  224): delay_us exceeds max timeout: 59999568 us
W/AudioCache(  224): Battery track warning: refCount is already 0
I/MediaFocusControl(  834):  AudioFocus  requestAudioFocus() from android.media.AudioManager@6571f028com.andrew.apollo.MusicPlaybackService$7@6570b1b0
W/WakefulBroadcastReceiver( 1791): No active wake lock id #23
I/MediaFocusControl(  834):   Remote Control   registerMediaButtonIntent() for PendingIntent{660b1808: PendingIntentRecord{65e4a790 org.opensilk.music broadcastIntent}}
D/AudioFlinger(  224): start(0), calling pid 1791 session 8
W/TimedEventQueue(  224): Event 18 was not found in the queue, already cancelled?
D/AudioFlinger(  224): PAUSED => RESUMING (0) on thread 0xb7831c78
D/audio_hw_primary(  224): out_set_parameters: enter: usecase(3: compress-offload-playback) kvpairs: routing=4
drewis commented 9 years ago

Ive noticed this too but thought it was just lag from BT. I think theres a douple tap timeout thats causing the delay. I also just noticed the Mediabutton receiver is in the wrong process which is whats causing that stacktrace and means the wakelock is never released

Nutomic commented 9 years ago

By BT you mean Bluetooth? I'm using a wired headset though. And as I said, this doesn't happen with Apollo. Double tap timeout shouldn't be more than 200ms I think, but this is around 1s.