Skip to content

DEVICE1: real ASIO/WASAPI device selection inside existing custom Audio I/O Matrix - #228

Merged
masarray merged 13 commits into
mainfrom
feat/custom-juce-audio-io-native-m1-20261031
Oct 31, 2026
Merged

masarray merged 13 commits into
mainfrom
feat/custom-juce-audio-io-native-m1-20261031

Conversation

@masarray

Copy link
Copy Markdown
Owner

Milestone — working custom JUCE DEVICE/DRIVER path

Implements the PRD/ARD/handoff merged in #227 without creating a second audio engine or new Audio Setup popup. Existing WebView2 AUDIO I/O matrix now contains real detected ASIO/WASAPI/DirectSound backend, capture/playback device selection, actual active device sample rates/buffer sizes and verified input/output pin checkboxes. Unsupported/new candidate capabilities remain AUTO until driver has opened; no phantom pins/rates.

Native: added audioDeviceApply on the existing JUCE AudioDeviceManager; validates reported backend/device names, duplex pairing, rate/buffer and same-active-device masks. Enforces outputs already MUTED including independent secondary; uses existing direct fence, opens the selected backend/device once, verifies native readback + production session, persists only success, and attempts previous-device rollback on failure. Returns requestId-keyed native arMixAudioDeviceApplyAck with ACCEPTED_MUTED / RESTORED_MUTED / RECOVERY_REQUIRED states; never auto-rearms output. Direct fallback AudioDeviceSelectorComponent retained in C++ for engineering recovery, no longer in normal WebView DEVICE UI.

WebView2: same existing 3-tab matrix and mixer/route controller. Compact premium no-blur controls, config draft & APPLY DEVICE, exact native ACK, no per-dropdown backend open. Standalone inline JS kept identical. Existing INPUT/OUTPUT PATCH, 10CH/4AUX, VST leases, MAIN/MONITOR/OUTPUT1, RAIL3 and SOURCE1 preserved.

Tests: enhanced operator contracts and Chromium fake-driver smoke (real selectors, one apply, stale ACK fencing, verified pin checkboxes, revert) plus existing native Windows CTest/package. Hardware FAT required for MAONO PS22/ASIO and WASAPI; driver scan/open operations are synchronous JUCE backend calls, so no claim of immunity to a wedged third-party ASIO driver. #15 zero-FX crackle remains separate release gate.

Review gates: must pass exact-head Chromium + Windows native compile/CTest before merge. No claim of physical test until measured.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 31, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-31T02:50:20.786675Z 389df72 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

masarray added a commit that referenced this pull request Oct 31, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 389df72221

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/Main.cpp
checked.inputChannels==before.inputChannels&&
checked.outputChannels==before.outputChannels&&
manager.getCurrentAudioDevice()!=nullptr&&
manager.getCurrentAudioDevice()->isOpen()&&engine_.finishManualAudioSetup();

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Restore the accepted mixer session during device rollback

When a device APPLY fails with an existing patched mix, rollback restores only the hardware configuration, not the working mixer session. The earlier beginManualAudioSetup() calls dryRoutingLab_.disable(), which clears the accepted route and unpublishes its FX graph; this call to finishManualAudioSetup() then creates an unpatched session with no sends or routed FX selections. Consequently, even RESTORED_MUTED leaves the operator's previous mix and routed plugin state lost. Retain the accepted session and FX leases before mutation, then restore them against the restored device epoch while keeping outputs muted.

AGENTS.md reference: AGENTS.md:L23-L23

Useful? React with 👍 / 👎.

Comment thread web/mixer-io.js
Comment on lines +1075 to +1079
}else if(target.matches('.arIODevicePlayback')){
deviceDraft.playbackDevice=target.value;
if(!deviceType(deviceDraft.backend)?.separate)deviceDraft.captureDevice=target.value;
}else if(target.matches('.arIODeviceCapture')){
deviceDraft.captureDevice=target.value;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Reset endpoint-specific settings when changing devices

When an operator selects another capture or playback endpoint within the current backend, these handlers retain the previous endpoint's sample rate and buffer size. Since deviceSameEndpoint() becomes false, the form displays only AUTO for both fields, but deviceApply() still submits the retained nonzero values. For example, switching from a 48 kHz/128-sample endpoint submits those settings to the new device despite showing AUTO, potentially causing rejection and rollback when the new device does not support them. Reset endpoint-specific draft settings to AUTO when either endpoint changes, and hydrate the accepted settings when returning to the active endpoint.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Owner Author

Cross-thread PR merge guard — 2026-10-31: The new DEVICE1 code shares src/Main.cpp, web/mixer-io.js/css, standalone HTML and UI tests with active selected CHANNEL/AUX master PR #226. Canonical PR ledger: #229. Earlier head 8c152945 Chromium run 41161694180 failed the generated standalone HTML CSS parity gate; updated head 0e7abf27 has a new pending CI and must be evaluated independently. Do NOT merge #228 and #226 in parallel on the same base just because both turn green; choose one integrated order, rebase the remaining PR and rerun native + Chromium. Preserve existing AudioDeviceManager, native audio source/status owner, MAIN/MONITOR/OUTPUT1, live POST sends, VST Show and L2/RAIL3. No physical device/ASIO stability claim from mocked UI/CI.

Copy link
Copy Markdown
Owner Author

DEVICE1 — Physical FAT acceptance (execute ONLY on a verified main-build Windows ZIP)

Release constraint: PR Windows workflow compiles/tests/packages but does not publish a ZIP. The artifact ArSonMix-GUI10CH-P012-Verified-Hardware-FAT-Windows-x64 is available only from a successful main Windows run or explicit workflow_dispatch. Do not label browser mocks as hardware PASS.

  1. Extract verified Windows ZIP on the actual test PC. Launch ARMixConsole EXE. Set amplifier/headphones to a conservative safe level. Open AUDIO DEVICE; confirm one existing DEVICE / DRIVER overlay (not JUCE AudioDeviceSelectorComponent). Before changing hardware, disarm both MAIN and optional secondary OUTPUT1.
  2. ASIO: Select the actual vendor-reported MAONO/PS22 ASIO backend/device if installed. Use AUTO rate/buffer on the first open. Press APPLY DEVICE once and record the native ACK/status. It must finish ACCEPTED · OUTPUT MUTED, with the actual driver/device and sample/buffer reported back. Do not assume MAONO virtual pins exist until shown under real input port labels.
  3. On this active interface, set 48 kHz / 128 samples only if those appear as supported options; select the actual capture and output pin masks (at least 1 capture and 2 playback). APPLY again, check reported values. Test 44.1 kHz and 64/256 only when present; unsupported selections must not be fabricated.
  4. Open INPUT ROUTING / MIX ROUTE; with outputs still muted, assign real HW Input 1 -> CH3 and APPLY/PENDING -> positive native routing ACK; test virtual stereo L/R -> CH6 only if driver really exposes the pins. Observe correct channel meter behavior and L/R identity. Never infer virtual devices by strings alone.
  5. Open OUTPUT ROUTING; MAIN -> real output L/R (often 1/2, but use actual driver labels); MONITOR -> separate 3/4 only when actually reported and enabled. Never treat AUX FX returns as physical audio sockets. Explicitly arm OUTPUT in existing Signal Check after reviewing accepted MAIN/MONITOR destinations, at low headphone volume. Listen for correct capture, no channel swap or gross glitch.
  6. WASAPI: Disarm before switching, select authentic Windows capture/playback endpoints and APPLY. Confirm actual rate/buffer and mute state, recheck patches. Test busy/removed device, restart, revert and a deliberately invalid/missing pin scenario; no silent default endpoint fallback or auto-unmute.
  7. Record repeated device open/apply/close behavior, UI responsiveness/driver stalls, route epoch changes and any audio crackle. Issue P0 — Crackling with 0 VST3: diagnose WASAPI clock/input/output buffering before engine expansion #15 zero-FX crackle is independent and remains open until audibly proven fixed. For a bad result, use the existing COPY AUDIO REPORT and MARK CRACKLE actions, noting backend, selected pins, sample rate, buffer and test timestamp.

PASS only when: same shipped EXE does real JUCE device APPLY/readback + native input/output routing/ACK + audible physical output; no automatic unmute, unexpected endpoint substitution, duplicate callback or unbounded freeze. Green CTest/Chromium alone is not physical qualification.

Known limitation: ASIO vendor scan/open can synchronously stall inside third-party code on the JUCE device owner; WebView2 controls do not make vendor code interruptible. Record and isolate field cases rather than claiming hard no-freeze guarantees.

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