Skip to content

fix(ios): stabilize simulator audio startup - #34

Merged
txbrown merged 2 commits into
mainfrom
fix/ios-simulator-route-priming
Nov 16, 2026
Merged

txbrown merged 2 commits into
mainfrom
fix/ios-simulator-route-priming

Conversation

@txbrown

@txbrown txbrown commented Aug 31, 2026 •

Copy link
Copy Markdown
Collaborator

Follow-up to #27. The Simulator can still crash in AURemoteIO::Cleanup on cold startup, so this starts a muted audio player before creating AVAudioEngine and stops it once the engine is running.

I also brought in the related iOS fixes: checking output formats and buffer sizes, keeping DSP blocks fixed when the host requests a different frame count, and locking event collection without holding the lock while delivering events. The fixed-block adapter can add up to one block of latency. getAudioInfo now reports status without starting audio.

All five CI checks pass on 973dcc4. Local checks pass too, including 24 tests, native sanitizer tests and the full iOS Simulator build for arm64 and x86_64.

I ran the new-architecture example through Argent on iOS Simulator 26.5. Three app cold starts, sample loading, individual samples, beat playback and Stop worked. Captured output measures 440 Hz for the tone and 126 BPM for the beat; Stop is silent. No new app crash reports. Physical-device route changes still need testing.

Prime the Simulator audio route before AVAudioEngine realization, size and clear render buffers defensively, and serialize runtime replacement across route changes.
@txbrown
txbrown marked this pull request as ready for review November 16, 2026 22:59
@txbrown
txbrown merged commit f9dd8a3 into main Nov 16, 2026
5 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.

1 participant