Repository navigation
fix(ios): stabilize simulator audio startup - #34
Merged
Merged
Conversation
Prime the Simulator audio route before AVAudioEngine realization, size and clear render buffers defensively, and serialize runtime replacement across route changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #27. The Simulator can still crash in
AURemoteIO::Cleanupon cold startup, so this starts a muted audio player before creatingAVAudioEngineand 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.
getAudioInfonow 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.