Skip to content

feat(io1): secondary ASIO capture-only producer via existing bounded ASRC - #771

Draft
masarray wants to merge 8 commits into
mainfrom
feat/io1-secondary-capture-clock-producer-20261118
Draft

masarray wants to merge 8 commits into
mainfrom
feat/io1-secondary-capture-clock-producer-20261118

Conversation

@masarray

Copy link
Copy Markdown
Owner

IO-1 — Secondary ASIO capture producer + existing ASRC (native-only, no ChannelId binding yet)

Deliverable: a real juce::AudioIODevice capture-only adapter with a producer callback and a separate capture-rate -> primary-rate consumer, using original AdaptiveClockBridge SPSC/48-tap FIR plus ClockBridgeSizing. This is NOT a second DSP/VST3 renderer and does NOT alter the primary ASIO fast path. IO-1 follows merged IO-0 #770 on exact main 3d133d8614ca6f2b4c231e96cdc2613bf23ddb90.

Implementation

  • engine/device/LiveSecondaryCaptureDevice.h: real independent ASIO class, output name empty in JUCE's createDevice(output,input), exact input channel mask, zero outputs, class identity re-attestation before/after, actual negotiated rate/period, callback-start readback, explicit different-driver preflight, producer-only push, control-thread stop/driver teardown. No default speaker selection, no silent fallback, no output ARM, no driver open from callbacks.
  • engine/device/SecondaryCaptureClockStream.h: reuses, not duplicates, the preallocated AdaptiveClockBridge, bounded producer/primary-reader atomic gate, captureGeneration and primaryEpoch fail-silent authorization, independent failure/readback counters, quiescent bridge reclamation. No callback allocation, DSP, manager or graphics.
  • tests/secondary_capture_clock_stream_test.cpp: deterministic 9 rate pairings (44.1/48/96 kHz), 2 independent generation/epoch checks, late/stall/overflow/NaN sanitization and stop/reopen/recover. The existing adaptive_clock_virtual_soak_test.cpp remains unchanged and keeps positive/negative drift coverage.
  • tests/asio_backend_registration_test.cpp: compile the real JUCE adapter under Windows JUCE_ASIO=1 and prove invalid open + idempotent close without touching physical hardware.
  • CMakeLists.txt: register IO-1 portable CTest and retain Windows ASIO backend/native regression tests.

Narrow scope: IO-1 implements the actual driver B producer + bounded ASRC + primary consumer interface, but production LiveAudioEngine does not yet call it. Source DeviceKey, pin → ChannelId, canonical accepted transaction/ACK/rollback, .smix offline intent, native GUI and installed runtime PCM remain IO-2. This PR cannot make extra interface sound in the mixer until IO-2 attaches an authenticated lease to the single existing graph. No MVVM UI, main engine refactor, new FIFO/ASRC, session migration or secondary output.

Safety: A failed driver B never reopens/replaces A, all B outputs stay inactive, stale captureGeneration or primary epoch pulls zeroes, callback B performs push only; primary PCM owner still src/LiveAudioEngine.h. Owner physical vendor A/B test later, NOT RUN in CI.

CI: exact-head Fast Native and Windows MSVC/CTest PENDING on creation; native hardware FAT NOT RUN. Draft until all relevant Windows build+CTest results pass and main is reconciled. No UI or workflow CI changes.

Owner: HASIL = real IO-1 adapter source + deterministic regression, not yet application feature; STATUS = KODE DIBUAT, CI PENDING; AMAN DIPAKAI = BELUM as multi-device input; TINDAKAN ANDA = TIDAK PERLU MELAKUKAN APA-APA; LANGKAH BERIKUTNYA = native CI, test/fix, then IO-2 user-admitted source map without DSP duplication.

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Nov 18, 2026 •

Copy link
Copy Markdown

Deploying arsonmix with  Cloudflare Pages  Cloudflare Pages

Latest commit: a0af644
Status: ✅  Deploy successful!
Preview URL: https://292695ee.arsonmix.pages.dev
Branch Preview URL: https://feat-io1-secondary-capture-c.arsonmix.pages.dev

View logs

Copy link
Copy Markdown
Owner Author

/arsonmix-ci native fd70336

Copy link
Copy Markdown
Owner Author

IO-1 Native capture producer — checkpoint 2026-11-18

HASIL: New real Windows JUCE ASIO capture-only adapter + original preallocated AdaptiveClockBridge SPSC/ASRC ingress/primary-consumer interface. The secondary callback only copies PCM and never invokes mixer/VST3; output pins are exactly zero; wrong driver class/pin layout/callback channel count, stale captureGeneration or primaryEpoch reject or silence. Control owns open/stop and ASRC lifetime. New deterministic native test covers 9x rate combinations, overflow, nonfinite PCM sanitization, stale generations and isolated secondary failure; Windows ASIO backend test compiles the actual production class and exercises invalid-open/stop without driver activation.

STATUS NYATA: KODE DIBUAT / PR #771 DRAFT, NOT MERGED. Exact HEAD fd703369f09ed578fe9daf48a1e613eadf8dcc74, base merged IO-0 main 3d133d8614ca6f2b4c231e96cdc2613bf23ddb90. Fast native PASS 44221547633. Windows MSVC / full realtime CTest IN PROGRESS 44222404826; the new compiled test has NOT YET passed. Physical ASIO A/B FAT NOT RUN.

AMAN DIPAKAI? BELUM as installed multi-device mixer: the adapter has real device-I/O implementation and render-side PCM interface, but is not yet connected to the active native ChannelId graph. Source binding, explicit user request/ACK, rollback and .smix are IO-2, not falsely claimed by this PR. No GUI/MVVM, primary fastpath, VST3, existing ASRC or main session refactors.

TINDAKAN ANDA: TIDAK PERLU MELAKUKAN APA-APA.

LANGKAH BERIKUTNYA: review Windows compile and CTest, fix true failures on same PR, reconcile main, and merge only after exact-HEAD qualification. IO-2 attaches verified DeviceKey + physical pins to ChannelId and provides native installed PCM/ACK evidence, without invoking a second DSP graph. Hardware FAT remains separate.

Copy link
Copy Markdown
Owner Author

/arsonmix-ci native a0af644

Copy link
Copy Markdown
Owner Author

IO-1 fail-closed preparation regression — 18 Nov 2026

HASIL: Identified and corrected a real stale-lease case in SecondaryCaptureClockStream::prepare(). If a valid bridge was prepared but not yet activated, an invalid replacement prepare() previously returned false without clearing prepared_; a subsequent activate() could wrongly succeed against reset/empty format. The fix clears prepared_ before any replacement validation. Regression covers invalid format and invalid bounded clock sizing after a valid unactivated prepare, then requires both activate() == false and a fresh explicit successful prepare before activation.

STATUS: source fix + deterministic regression committed to SAME PR #771, exact head a0af6448c19d20d35830271c07803f41fe9ea85b; Fast native run 44224086939 PASS. Exact SHA Windows MSVC/CTest 44224277959 PENDING. Previous Windows attempt on old head superseded; cannot qualify new head.

AMAN DIPAKAI? As released multi-device source in mixer: BELUM. IO-1 B callback/ASRC remains separate and not attached to production ChannelId/MAIN; physical dual-vendor ASIO FAT NOT RUN. Original direct primary ASIO, one DSP/VST3 graph, /preview/, session and device output authorization untouched.

TINDAKAN ANDA: TIDAK PERLU MELAKUKAN APA-APA.

LANGKAH BERIKUTNYA: require actual exact-head Windows MSVC/CTest PASS, verify main/branch and merge gate before merger. Implement IO-2 source DeviceKey+pin→ChannelId independently with hardware-readback, epoch and fail-closed routing; don't claim physical compatibility until verified FAT.

This branch has not been deployed

No deployments
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