[Bug] (Android) Volume doesn't reset when shake to reset sleep timer #488

Closed
opened 2026-04-24 23:25:49 +02:00 by adam · 11 comments
Owner

Originally created by @YodaDaCoda on GitHub (Mar 12, 2023).

Steps to reproduce

  1. Play an audiobook and wait for the sleep timer to count down.
  2. When the volume starts to lower, shake the phone to reset the timer.
  3. Observe that the book continues playing at reduced volume.

Expected behaviour

  • The volume should be restored when the phone is shaken to reset the timer

Actual behaviour

  • The volume is not restored, and the audiobook continues playing at reduced volume

Environment data

Audiobookshelf Version: 0.9.63-beta

  • Android App?
  • iOS App?

Android Issue

Android version: 13

Device model: OnePlus 9 (LE2115)

Stock or customized system: Stock

iOS Issue

iOS Version:

iPhone model:

Originally created by @YodaDaCoda on GitHub (Mar 12, 2023). ### Steps to reproduce 1. Play an audiobook and wait for the sleep timer to count down. 2. When the volume starts to lower, shake the phone to reset the timer. 3. Observe that the book continues playing at reduced volume. ### Expected behaviour - The volume should be restored when the phone is shaken to reset the timer ### Actual behaviour - The volume is not restored, and the audiobook continues playing at reduced volume ### Environment data Audiobookshelf Version: 0.9.63-beta - [x] Android App? - [ ] iOS App? #### Android Issue Android version: 13 Device model: OnePlus 9 (LE2115) Stock or customized system: Stock #### iOS Issue iOS Version: iPhone model:
adam added the bug label 2026-04-24 23:25:49 +02:00
adam closed this issue 2026-04-24 23:25:49 +02:00
Author
Owner

@brcarls commented on GitHub (Mar 19, 2023):

I have noticed that if I manually increase the volume using my phone's volume slider to compensate for the partially faded volume, the next time the sleep timer starts to fade, it first goes back to full volume and then fades from there.

@brcarls commented on GitHub (Mar 19, 2023): I have noticed that if I manually increase the volume using my phone's volume slider to compensate for the partially faded volume, the next time the sleep timer starts to fade, it first goes back to full volume and then fades from there.
Author
Owner

@advplyr commented on GitHub (Mar 19, 2023):

I'm not able to reproduce this.

I set the sleep timer to 1 minute then with around 10 seconds remaining I shake the phone. The volume resets properly.

Can you reproduce this every time? Are you using chromecast?

@advplyr commented on GitHub (Mar 19, 2023): I'm not able to reproduce this. I set the sleep timer to 1 minute then with around 10 seconds remaining I shake the phone. The volume resets properly. Can you reproduce this every time? Are you using chromecast?
Author
Owner

@YodaDaCoda commented on GitHub (Mar 20, 2023):

Interesting...

Test 1:
1min timer.
Watched it count down.
Noticed the sound lowering with about 20s remaining.
Shook the phone at 10s remaining and observed the timer reset & volume went back up.

Test 2:
1min timer.
Started playback, then turned screen off.
Using timer on laptop, observed sound lowering around 20s remaining.
Shook the phone at about 10s remaining and observed volume went back up.

Test 3:
5min timer.
Started playback, then turned screen off.
Using timer on laptop, observed sound lowering around 30s remaining.
Shook the phone at about 10s remaining and observed playback continuing at reduced volume.
Turned phone back on, observed timer reset to 5min.
Pressed pause/play & observed playback back at full volume.

Seems like the sleep duration somehow impacts whether the volume is restored.

@YodaDaCoda commented on GitHub (Mar 20, 2023): Interesting... Test 1: 1min timer. Watched it count down. Noticed the sound lowering with about 20s remaining. Shook the phone at 10s remaining and observed the timer reset & volume went back up. Test 2: 1min timer. Started playback, then turned screen off. Using timer on laptop, observed sound lowering around 20s remaining. Shook the phone at about 10s remaining and observed volume went back up. Test 3: 5min timer. Started playback, then turned screen off. Using timer on laptop, observed sound lowering around 30s remaining. Shook the phone at about 10s remaining and observed playback continuing at reduced volume. Turned phone back on, observed timer reset to 5min. Pressed pause/play & observed playback back at full volume. Seems like the sleep duration somehow impacts whether the volume is restored.
Author
Owner

@YodaDaCoda commented on GitHub (Mar 21, 2023):

Further to my last: turned off restricting battery usage for the app & it restores volume when shaken.

@YodaDaCoda commented on GitHub (Mar 21, 2023): Further to my last: turned off restricting battery usage for the app & it restores volume when shaken.
Author
Owner

@advplyr commented on GitHub (Mar 23, 2023):

Thanks for testing. The battery optimization on some devices is closing background processes and causing some strange results. I think we'll have to put an alert in the app about this. There is a feature request for that already.

@advplyr commented on GitHub (Mar 23, 2023): Thanks for testing. The battery optimization on some devices is closing background processes and causing some strange results. I think we'll have to put an alert in the app about this. There is a feature request for that already.
Author
Owner

@YodaDaCoda commented on GitHub (Mar 23, 2023):

I still have battery optimisation turned off for abs but last night experienced the same thing with the volume not restoring. Even if it is a battery optimisation thing, can't that be worked around? I have used Smart Audiobook Player for many years & it rests the volume without having to disable battery optimisation.

@YodaDaCoda commented on GitHub (Mar 23, 2023): I still have battery optimisation turned off for abs but last night experienced the same thing with the volume not restoring. Even if it is a battery optimisation thing, can't that be worked around? I have used Smart Audiobook Player for many years & it rests the volume without having to disable battery optimisation.
Author
Owner

@advplyr commented on GitHub (Mar 23, 2023):

If it happened with battery optimization turned off then it is not battery optimization. I haven't reproduced this and can't think of how this would be possible

@advplyr commented on GitHub (Mar 23, 2023): If it happened with battery optimization turned off then it is not battery optimization. I haven't reproduced this and can't think of how this would be possible
Author
Owner

@YodaDaCoda commented on GitHub (Mar 25, 2023):

Yeah I thought it was odd. Is there any additional testing I can do?

@YodaDaCoda commented on GitHub (Mar 25, 2023): Yeah I thought it was odd. Is there any additional testing I can do?
Author
Owner

@brcarls commented on GitHub (Mar 25, 2023):

I'm on android 12 Samsung S10e OneUI 4.1 Same symptoms as YodaDaCoda, 100% reproduceable.

I use a 15 min sleep timer. Hitting pause and then play will restore the volume.

If instead of pause/play, I increase volume to compensate, then next time the timer starts to expire, the volume suddenly gets very loud, then starts to fade.

Turning off battery optimization did not help. (I set battery to "Unrestricted" for this app)

@brcarls commented on GitHub (Mar 25, 2023): I'm on android 12 Samsung S10e OneUI 4.1 Same symptoms as YodaDaCoda, 100% reproduceable. I use a 15 min sleep timer. Hitting pause and then play will restore the volume. If instead of pause/play, I increase volume to compensate, then next time the timer starts to expire, the volume suddenly gets very loud, then starts to fade. Turning off battery optimization did not help. (I set battery to "Unrestricted" for this app)
Author
Owner

@advplyr commented on GitHub (Mar 25, 2023):

Thanks all for the testing. I did end up reproducing this and it will be fixed in the next release

@advplyr commented on GitHub (Mar 25, 2023): Thanks all for the testing. I did end up reproducing this and it will be fixed in the next release
Author
Owner

@advplyr commented on GitHub (May 23, 2023):

Fixed in v0.9.64-beta

@advplyr commented on GitHub (May 23, 2023): Fixed in [v0.9.64-beta](https://github.com/advplyr/audiobookshelf-app/releases/tag/v0.9.64-beta)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/audiobookshelf-app#488