Repository navigation
fix(audioout): preserve conversion state across output blocks - #5558
Merged
adriadam10 merged 5 commits intoOct 15, 2026
Merged
Conversation
…o-output-conversion-state
…o-output-conversion-state
This was referenced Oct 14, 2026
This was referenced Oct 14, 2026
Collaborator
|
Checked the diff, built and ran the AudioOut ctest scope (17/17 pass, |
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.
What
Legacy AudioOut allows SDL to change the device format/rate and then calls SDL_ConvertAudio independently for every guest block. When the host rate differs, each conversion starts with fresh resampler state and drops the impulse response at block boundaries.
Open the SDL device with no format/rate changes allowed. SDL keeps the requested callback format and maintains a conversion stream for the native device. Remove the per-block converter; volume/channel preparation and output pacing remain in guest format. AudioOut2 already opens its device this way. The behavior is implemented in the pinned SDL device-open path.
Tested
The final Linux regression fails on the original production code with the missing impulse-tail error. It models a 48 kHz device with SDL's real conversion stream, feeds an impulse at the end of a 256-frame block, and checks that the response extends into the following block while preserving stereo levels. The fix passes for both 32 kHz and 44.1 kHz input.
Full bundled Linux Release development build passes with 32 build threads. All 13 audio/patched-library checks pass without skips. The regression uses an intercepted device backend, not a measured hardware rate mismatch. Full CI run 38330144628 passed at exact topic head 4111215. Linux: 937 passed and 43 skipped (980 total), including the new resampling regression. Windows: 638 passed and 357 skipped (995 total). All relinker, register-context and write-watch jobs passed. GitHub conventions passed. A fresh native Quake PPSA01880 run with the fix reached 3D gameplay and closed normally after 180.98 seconds (exit 0), with imports enabled and no debugger, preload or audio tracing. The user reported that gameplay audio still sounds the same. Its source and obtained SDL rate were both 48 kHz; this fixes a separate host-conversion defect and does not resolve Quake's reported static.
This review PR targets the existing JJenkx fork main at 1acfa7f while the upstream author allowance is occupied by #4474. The independent topic retains its base's initialization code and does not require the tracing PR.
Checklist
Current upstream validation
Published head
957051602c9e28ede9ee2e97ce00efed312e8279contains current maind1670009fbfdfe57f8f26ee09ced77fe6b18c2caand merges without conflicts. Conventions and whitespace checks pass. The topic's production change is unchanged by this main refresh. Previous validated build passes at12fddc733787670812529eee5f266740ae409641against main7a0c838ca48; any reused Linux results apply to their explicitly recorded earlier head/base. Latest-main full Linux and Windows validation passes for this published head; expected skips remain unvalidated.Current review refresh: head
079164e84cbf53ab5b51d2d2fe20909dbad8517cincludes upstream maina5f493f90dca348a65561aed4bb325a629d1b668. Conflicts are resolved and current conventions pass. Earlier full-build results describe the earlier head; fresh full Linux/Windows checks for this head are pending.Verified current full CI: run 38505284721 passes topic
079164e84cbf53ab5b51d2d2fe20909dbad8517cmerged into basea5f493f90dca348a65561aed4bb325a629d1b668. Linux 1060 passed/46 expected skips; Windows 730 passed/397 expected skips. Skipped cases remain unvalidated. The tested source tree matches this published topic head.