Home

dev / openkara

publicthedavidweng/OpenKara· sync paused
Overview Code History Branches Pull requestsIssuesInsights
main
HomeOverview Code PRsIssues

#549 AirPlay: audience stream reattaches on every playback change, causing speed-up and repeated lyric lines

open

Opened by dev · 3 weeks ago

devopened this issueAuthor· 3 weeks ago

Problem

While playing a library song over AirPlay, the receiver's audio sometimes speeds up or stutters, and a lyric line repeats.

What we found

  • Rust bumps the audience stream generation on every BeginLoad, install, resume, pause, seek and clear. It also bumps on audience mode changes and after debounced volume changes.
  • The macOS bridge bumps it too. When externalPlaybackActive goes from false to true, restartStreamForRouteActivation (src-tauri/src/macos/airplay_bridge.m, around line 2045) sets streamGeneration + 1.
  • Each bump attaches a new AVPlayerItem for audience-video.m3u8?generation=N. The new item starts at the live edge and drops the sync points. Meanwhile the lyric position keeps following the app's playback position, so the receiver jumps ahead to catch up and replays a line.
  • A real session logged:
    • generation 19→32 within about 2 s, and 42→47 within a few seconds;
    • the phase flapping between waiting_for_video and waiting_for_route every ~25 ms with no user action;
    • FigBufferedAirPlayOutput err=-17320 when the device was selected.

The ~25 ms flapping points at the bridge's route-activation bump, but the log alone doesn't confirm it.

Related

  • The audience stream is live HLS (no #EXT-X-ENDLIST, no duration), so receivers show "Live" for every song.
  • Separately, cpal_stream.rs used to rebuild the output stream on every xrun, about every 220 ms. That was fixed on feat/418-online-sources and may have made the audio side worse. Re-test after that lands.

Acceptance

  • Pause, resume and seek don't make the receiver re-buffer from the live edge, or they re-sync lyrics and audio without a visible jump.
  • Selecting an AirPlay device produces one stable attach, not a burst of generations.

Sign in to comment.

Linked pull requests

No linked pull requests yet.