Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sleep timer restart issues. #178

Open
tehguitarist opened this issue Dec 8, 2024 · 9 comments
Open

Sleep timer restart issues. #178

tehguitarist opened this issue Dec 8, 2024 · 9 comments

Comments

@tehguitarist
Copy link

Not sure if this is a regression, but have noticed to issues.

The first is that restarting the sleep timer after it has ended (within the 15 second window) starts it when the fade out ends, instead of started, which seems to be a regression.

The other is that sometimes (and I can't seem to find out exactly when) the sleep timer will get applied on a new listening session long after the last timer ran out. For example, if I had the sleep timer on at night (probably extending it with the headphone button once or twice), the next morning, sometimes it is applied when I start playing the book again. I'll try to get a more accurate idea of when it is happening. Not really a problem, just odd.

@rasmuslos
Copy link
Owner

I removed the seek back because it caused issues when the chapter sleep timer ended right after a chapter ended, but I will add a check.
This seems to be related to the other issues that struggle with playback ending prematurely, please do investigate!

@rasmuslos
Copy link
Owner

What version of iOS are you using?

@tehguitarist
Copy link
Author

18.1.1 currently

@tehguitarist
Copy link
Author

tehguitarist commented Dec 12, 2024

Ok these aren’t the best reproduction steps but I had the same issue today. The timeline of events are this:

  • Using wired headphones, had the sleep timer on for 15 minutes and restarted once or twice in offline mode.
  • Played through speakers with no sleep timer still in offline mode after 20-30 minutes after last session
  • Played in car using CarPlay still in offline mode about 20 minutes after last session
  • Played on Bluetooth headphones straight after getting out of the car. This also skipped backwards in time about 2 minutes (did not remember position) still in offline mode.
  • Sleep timer faded out after about 15 minutes (I did not actually set a sleep timer at all)
  • Manually pressed play in the app, and sleep timer reset to 3 minutes
  • Cleared the sleep timer. Playback stopped again abruptly at end of chapter. The app did not crash.

@rasmuslos
Copy link
Owner

I really don't understand why this is happening... I added a debug section to the top of the account sheet which tracks all stops and sleep timer expires, can you share its contents when this happens again?

@rasmuslos
Copy link
Owner

Ok, so the code that suspends the sleep timer after it expires is the same as the one that suspends it when you pause, so it does not continue running. It returns before updating the DispatchTimerSource. Maybe it gets activated again or is still active because it is not updated. This could be the piece of code that is pausing playback.

@tehguitarist
Copy link
Author

Yeah it’s a hard issue to replicate. Could it be that CarPlay handles playing sessions differently than the app through the phone? Like is it treated a separate app? I notice if I was listening to music in my car, and then get back in my car, even if I listened to ShelfPlayer last, Spotify is loaded in the now playing section with the last song I was listening to.

@tehguitarist
Copy link
Author

Was skipping around chapters this morning and got this, I also hit update on the debug counter.

IMG_8260
IMG_8261

@rasmuslos
Copy link
Owner

Yeah it’s a hard issue to replicate. Could it be that CarPlay handles playing sessions differently than the app through the phone? Like is it treated a separate app? I notice if I was listening to music in my car, and then get back in my car, even if I listened to ShelfPlayer last, Spotify is loaded in the now playing section with the last song I was listening to.

Not really, it’s probably just iOS preferring
Music content. The player is the same

What you are seeing is probably caused by extend which has quadratic properties… I have to change that but it’s most likely not related to this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants