LeoKlaus / plappa

An Audiobook client for Jellyfin and AudioBookShelf, written in Swift/SwiftUI.
https://plappa.me
159 stars 0 forks source link

[BUG] Bluetooth speaker pause button takes 2 presses if using 1.1x playback speed #123

Open timespaced opened 2 weeks ago

timespaced commented 2 weeks ago

Describe the bug When using 1.1x playback speed (may also occur with other speeds, I did not test), the play/pause button on Bluetooth devices requires 2 presses to pause the audiobook (and only 1 to resuming playing, as expected).

To Reproduce Steps to reproduce the behavior:

  1. Connect to Bluetooth speaker.
  2. Play an audiobook.
  3. Set playback speed to 1.1x.
  4. Press the play/pause button on speaker; audiobook will not pause. Press play/pause on speaker again, and the audiobook will pause.
  5. Change playback speed back to 1x.
  6. Play/pause button Bluetooth speaker will function as expected with speed at 1x.

Expected behavior Expect play/pause button on Bluetooth speaker to pause (and play, as it does) after only 1 press.

Logs

[6/12/2024, 20:41] [SoundHandler] Received playCommand but couldn't determine current rate
[6/12/2024, 20:42] [SoundHandler] Received playCommand but couldn't determine current rate
[6/12/2024, 20:44] [SoundHandler] Received playCommand but couldn't determine current rate
[6/12/2024, 20:44] [SoundHandler] Received playCommand but couldn't determine current rate
[6/12/2024, 20:46] [AudioBookShelfAPIHandler] Successfully pushed playbackstates
[6/12/2024, 20:46] [SoundHandler] Received playCommand, current rate 0.000000, resuming playback
[6/12/2024, 20:46] [SoundHandler] Received pauseCommand, current rate 1.000000, pausing playback
[6/12/2024, 20:46] [AudioBookShelfAPIHandler] Successfully pushed playbackstates
[6/12/2024, 20:46] [SoundHandler] Received playCommand, current rate 0.000000, resuming playback
[6/12/2024, 20:46] [AudioBookShelfAPIHandler] Successfully pushed playbackstates
[6/12/2024, 20:46] [AudioBookShelfAPIHandler] Successfully pushed playbackstates
[6/12/2024, 20:46] [AudioBookShelfAPIHandler] Successfully pushed playbackstates
[6/12/2024, 20:46] [SoundHandler] Received pauseCommand, current rate 1.000000, pausing playback
[6/12/2024, 20:46] [AudioBookShelfAPIHandler] Successfully pushed playbackstates
[6/12/2024, 20:46] [SoundHandler] Received playCommand, current rate 0.000000, resuming playback
[6/12/2024, 20:46] [AudioBookShelfAPIHandler] Successfully pushed playbackstates
[6/12/2024, 20:46] [AudioBookShelfAPIHandler] Successfully pushed playbackstates
[6/12/2024, 20:46] [SoundHandler] Received pauseCommand, current rate 1.000000, pausing playback
[6/12/2024, 20:46] [AudioBookShelfAPIHandler] Successfully pushed playbackstates
[6/12/2024, 20:46] [SoundHandler] Received playCommand, current rate 0.000000, resuming playback
[6/12/2024, 20:46] [AudioBookShelfAPIHandler] Successfully pushed playbackstates
[6/12/2024, 20:46] [SoundHandler] Received playCommand but couldn't determine current rate
[6/12/2024, 20:46] [SoundHandler] Received pauseCommand, current rate 1.100000, pausing playback
[6/12/2024, 20:46] [AudioBookShelfAPIHandler] Successfully pushed playbackstates
[6/12/2024, 20:47] [AudioBookShelfAPIHandler] Successfully pushed playbackstates
[6/12/2024, 20:47] [AudioBookShelfAPIHandler] Successfully pushed playbackstates

Environment(please complete the following information):

LeoKlaus commented 2 weeks ago

Thanks for the update and for posting the logs. I find this very curious:

[6/12/2024, 20:41] [SoundHandler] Received playCommand but couldn't determine current rate [6/12/2024, 20:42] [SoundHandler] Received playCommand but couldn't determine current rate [6/12/2024, 20:44] [SoundHandler] Received playCommand but couldn't determine current rate [6/12/2024, 20:44] [SoundHandler] Received playCommand but couldn't determine current rate

Did you pause in between those using the software buttons or were those all triggered by pressing the hardware button on your speaker? I'll get my speaker and test if I can reproduce this.

timespaced commented 2 weeks ago

I believe it was only Bluetooth speaker buttons but I can’t be sure. I’m happy to re-test if that’s helpful?