Player: auto mode fails over between Spotify and HLS

No Spotify session (or paused, with failover_on_pause) for failover_delay_s
switches to HLS; Spotify playing switches back within ~1 s. Switches fade
out/in over 30 ms and flush the ring. HLS is suspended while Spotify plays.
cspot is held back instead of drained while it isn't Spotify's turn: it keeps
decoding on pause, so dropping its frames let it race through the queue.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-09-25 22:36:11 +10:00
parent 78c480a7c2
commit c6ecbbeb25
6 changed files with 202 additions and 34 deletions
+4 -1
View File
@@ -66,7 +66,10 @@ Repo: https://gitea.apointless.space/bsncubed/aes67-ESP32-P4
- Track display in the app can switch ~3-5 s early.
- Mute at 0 % volume not yet confirmed.
- Consider offering the delayed-Pong fix upstream (philippe44/cspot).
- [ ] failover (auto mode) + /api/player
- An old, long-idle session can get out of sync with the app: it sends empty Load frames ("No tracks in frame") instead of Pause/Play, so controls do nothing. Quitting and reopening Spotify on the Mac fixes it.
- [x] failover (auto mode): no session or (with `failover_on_pause`) paused for `failover_delay_s` -> HLS; Spotify playing -> Spotify within ~1 s; 30 ms fades; HLS suspended while Spotify plays; cspot is held back (not drained) while it isn't Spotify's turn, so it resumes where it paused. Verified: no session -> HLS, play -> Spotify, pause stays (on_pause off), pause -> HLS after 5 s (on_pause on), play -> Spotify at the paused position.
- Open: `aes67_tx resync` (TX 20-27 ms late) ~11 s after each switch to Spotify (seen 3 times); clicks at switches not yet checked in a recording; HLS start sometimes hits CDN read timeouts.
- [ ] /api/player
- [ ] 8. Mono sum, gain, polish.
## Phase 2 (parked)