Skip to content

Prevent crashes when Live Activities reconfigure audio - #121

Merged
sanylax2 merged 1 commit into
mainfrom
cursor/fix-audio-interference-crashes-45ff
Jul 21, 2026
Merged

sanylax2 merged 1 commit into
mainfrom
cursor/fix-audio-interference-crashes-45ff

Conversation

@sanylax0

@sanylax0 sanylax0 commented Jul 21, 2026 •

Copy link
Copy Markdown
Collaborator

Root cause

Live Activity, Dynamic Island, Siri, and competing media updates can report an audio configuration change while AVAudioEngine.isRunning is still true, then stop the engine asynchronously. That bypassed recovery and left invalid player-node schedules reachable. Quick restarts could also leave a pre-restart lastRenderTime less than one second old, incorrectly authorizing AVAudioPlayerNode.play(at:) on the new engine epoch.

Fix

  • Recheck apparently-spurious configuration changes and recover if the engine stops after the callback.
  • Make the 20 Hz playback loop recover before touching nodes on a stopped engine.
  • Tie synchronized stem starts to the current engine-start host-time boundary.
  • Guard stop/seek operations and rebuild invalid schedules on automatic, paused, remote, and scrubber resume paths.
  • Cancel paused crossfades whose incoming schedule was invalidated.
  • Add regression tests for old-epoch, future, and expired render clocks.

Validation

  • Core Linux CI passes.
  • Source/actor/lifecycle review completed for interruption, transition, pause/resume, seek, and repeated-restart paths.
  • iOS Playback tests require Xcode 26 and cannot run on the Linux agent.

Slack Thread

Open in Web Open in Cursor 

Co-authored-by: sanylax0 <sanylax0@users.noreply.github.com>
@sanylax2
sanylax2 merged commit aa95a0c into main Jul 21, 2026
4 checks passed
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

Successfully merging this pull request may close these issues.

3 participants