Repository navigation
P0 native LIVE mixer: in-place safe capture PCM, MAIN/MONITOR single-pass + 10k RT regression - #255
Merged
masarray merged 4 commits intoOct 31, 2026
Conversation
…preallocated monitor PCM
…apture PCM is consumed
…ical MAIN/MONITOR aliases
… buffer invariant
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
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.
P0: Fix production (NOT prototype) realtime input/output alias safety
Evidence / motivation
User still hears 0-FX crackle despite powerful PC. Hardware evidence: 48k/480 WASAPI VB-Cable capture → MAONO render, 113 JUCE WASAPI capture discontinuity flags / 8,126 callbacks but 0 host DSP deadline overruns. That evidence is a capture continuity problem, NOT proof this alias bug caused the audible crackle. PR #251 separately owns capture zero-head de-click; this PR does not modify that code.
Independent code audit found 2 layers of pre-clearing native output PCM BEFORE real physical inputs were consumed:
LiveDryRoutingLab::processcleared all physical outputs before invoking the current 10CH native mixer;PreparedMixerBlock::processcleared MAIN + MONITOR before reading input PCM in channel render order.A host/backend may provide aliased input/output backing (Steinberg VST3 buffer contract explicitly allows in-place processing), so a pre-clear can erase input in some supported buffer configurations. This is a production path safety hazard.
Source changes (one meaningful milestone, 3 files)
engine/core/PreparedMixerBlock.h: constructor preallocates one 2-channel MONITOR accumulator (2 * maxFrames float), keeps all source→sends→FX→master DSP in the existing single render pass, writes MAIN and independent MONITOR to physical output after all native source lanes are consumed. On invalid buffer/capacity still silence outputs. No callback heap/lock/worker, no additional plugin instance or graph. Buffer cost max 64 KiB at 8192 frames (2×8192×4 bytes).src/LiveDryRoutingLab.h: preserve native device epoch/ACK/MUTE, delay clearing unselected physical output channels until after the prepared process, silence every rejected/unsafe route immediately, protect exact selected MAIN/MONITOR pointer aliases. Existing chunked 10CH, AUX, CH1 vendor FX, Show, secondary output and 256-frame de-click retained.tests/prepared_mixer_block_test.cpp: exact 32-sample A/B PCM with four independent mono physical inputs that share backing memory with MAIN L/R and MONITOR L/R. Assert all four outputs sample-by-sample equal to non-aliased baseline. 10,000 PCM block soak withoperator newallocation counter unchanged in MSVC Release. Real C++ test, not browser simulation.Safety and scope
Refs: Steinberg VST3 API in-place buffer contract, #15, #251, #170, #192.