Repository navigation
Pad audio underruns with silence and preserve render buffer sizes - #9
Open
clopezadereso wants to merge 1 commit into
Open
clopezadereso wants to merge 1 commit into
clopezadereso wants to merge 1 commit into
Conversation
clopezadereso
marked this pull request as ready for review
November 16, 2026 21:02
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.
When a core's audio ring buffer returns fewer bytes than requested, the source-node callback currently shrinks
mDataByteSizeand leaves the unread portion untouched. That violates the render-block requirement that buffer sizes matchframeCount, and can expose stale samples during an underrun.Pad short reads with zeroes, retain the requested buffer length and channel layout, and set the silence hint for empty reads. Add regression tests for full, partial and empty reads, plus a request smaller than the available buffer capacity.
Validation: compiled the modified production
GameAudio2.swiftagainst OpenEmuBase and ran all four buffer cases locally. The integration suite for OpenEmu 2.4.1's pinned OpenEmuKit (2bc0ee9), with this patch and the current upstream audio availability guard applied, passed 32 tests with 0 failures, including both new regression tests: Xcode test run.This is a buffer-contract fix discovered while investigating save-state loading from a network library. It does not claim to fix the separate
caulk/EABLImpl::createinitialization trap on macOS 26.5 under Rosetta, which also reproduces with a standalone silent audio graph and no file access.Reference: AVAudioSourceNodeRenderBlock.