Skip to content

Fix transient crashes during audio-engine recovery - #120

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

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

Conversation

@sanylax0

@sanylax0 sanylax0 commented Jul 20, 2026 •

Copy link
Copy Markdown
Collaborator

Root cause

A configuration change can stop AVAudioEngine during a crossfade without sending the interruption path through pauseForEnvironment(). Recovery rescheduled only the outgoing deck while leaving the transition active and the incoming deck's invalidated schedule reachable. A later pause/resume could call play() on that stale deck, triggering an uncatchable AVFAudio exception; media-services reset also left skip-transition flags orphaned.

Fix

  • Discard an interrupted transition before rescheduling the outgoing deck.
  • Clear transition state without touching orphaned AVAudio nodes after media-services reset or a failed engine restart.
  • Centralize full transition-state cleanup and add regression coverage proving state-only cleanup remains audio-stack-free.

Validation

  • Core Linux CI passes.
  • Linux cannot build the iOS-only Playback module; the new PlaybackTests target is intended for the iOS Simulator/Xcode 26 path.
  • Source review confirms recovery now follows the invariant that blend state cannot survive an engine stop.

Slack Thread

Open in Web Open in Cursor 

Co-authored-by: sanylax0 <sanylax0@users.noreply.github.com>

@sanylax2 sanylax2 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ts better work pt 52000

@sanylax2
sanylax2 merged commit 313ab00 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