Skip to content

P0 DAW workflow: real hardware IN on any channel, native fader controls and compact Audio I/O - #413

Closed
masarray wants to merge 26 commits into
mainfrom
integration/audition-direct-per-channel-source-20261105
Closed

masarray wants to merge 26 commits into
mainfrom
integration/audition-direct-per-channel-source-20261105

Conversation

@masarray

@masarray masarray commented Nov 5, 2026 •

Copy link
Copy Markdown
Owner

Refs #412 — this PR implements the approved native First Sound workflow. Keep #412 open until physical hardware FAT has been independently verified; CI does not certify actual sound.

Root cause

The shipped Windows app uses site/preview-v2 + web/approved-native-bridge.js via scripts/build_approved_native_gui.py. The earlier web/mixer-io.js / web/monitor.js controllers belong to a legacy standalone renderer and are NOT the shipped approved WebView! Our previous UI-engine efforts were repeatedly wired to the wrong surface. This PR deliberately restores these legacy files unchanged and edits the actual native bundle.

Adobe Audition / FL Studio operator workflow

  • Hardware preferences set once in compact Audio I/O; actual driver inventory, input/output name, rate/buffer and signed ACK come from existing AudioDeviceManager.
  • CH01…CH10 IN dropdown in existing approved mixer offers actual enabled JUCE pins, including mono or stereo, based on actual callback/physical mask. No fabricated CABLE/IN1 demo list in native host; no CH1-first rule.
  • Selection of any input is one operator gesture: existing native routingSourceSwitch on exactly the chosen strip; same-format changes use 64-sample native crossfade. Structural changes while monitored perform safe mute, native route ACK/readback and resume MAIN monitoring internally. No Patch CH1 / Arm / Start wizard. Driver/hotplug stale status fails closed.
  • All ten fader/pan/mute/solo controls now use existing setDryRoutingLabParameter while M4 is PCM owner—even if universal ChannelId/FX graph admission is not yet ready. Main controls are sent to native master setters. No JS audio engine.
  • Existing native GUI meters are fed from real channel peak atomics and MAIN PCM status at 12Hz; full mixer re-render only on accepted control or port changes, not every meter frame.
  • Audio I/O is visible on command bar and has a compact native-only setup overlay. The original generic JUCE selector is Advanced driver recovery only. Virtual output names show an advisory that headphone output may need different routing.
  • One CSS asset is loaded ONLY into approved native bundle; no second mixer GUI, no changes to public visual preview behavior or Windows audio callback.

Tests and stop ship

  • Native M4 epoch/revision + exact physical pin checks are retained. Existing JUCE/ASIO/WASAPI driver transaction has rollback and safe mute.
  • Added regression assertions for any-channel controls, concrete approved HTML source, independent native bundle, setup, no old wizard.
  • Windows MSVC/JUCE CTest + Chromium/source parity gates must pass on exact head before merge.
  • Hardware FAT PENDING: speaker/headphone audible path, fader/mute sound, 30m clean 0FX, VST3 and latency cannot be claimed from CI.

2026-11-08 reconciliation: ARCHIVED, NOT MERGED

Superseded pre-#418 standalone first-sound integration. Current main is the source of truth for per-channel IN, device setup and ACK/realtime PCM, and #412 remains the product acceptance tracker.

Current authority: main, #418. Historical branch retained; hardware FAT not inferred.

…rce selection and remove implicit CH1/2 start
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 5, 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-11-05T04:39:51.180720Z 4fe434b 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.

@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: 4fe434b828

ℹ️ 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 on lines +457 to +459
p.phase="monitor";p.revision=Number(d.revision);
backend.emitEvent("arMixAction",{action:"monitor",value:true,
expectedEpoch:p.epoch,expectedRevision:p.revision});

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 Preserve explicit monitoring consent when changing an input

When MAIN monitoring is off, selecting a physical IN now reaches monitorAfterSource() after the source ACK and unconditionally sends monitor: true, even though p.wasMonitoring is false. Consequently, patching an input also makes it audible, including after the operator deliberately turned monitoring off. Retain the muted state unless monitoring was already enabled before the transaction, and require an explicit Monitor action for initial arming. This violates the explicit no-silent-auto-arm requirement in AGENTS.md.

AGENTS.md reference: AGENTS.md:L20-L22

Useful? React with 👍 / 👎.

Comment thread web/approved-native-bridge.js Outdated
Comment on lines +360 to +364
const b=ioElement("button","tool ar-native-io-open","Audio I/O");
b.id="arNativeIoOpen";b.addEventListener("click",openNativeAudioIO);
before.insertAdjacentElement("afterend",b);
ioMonitorButton=ioElement("button","tool ar-native-monitor","Monitor off");
ioMonitorButton.id="arNativeMonitor";

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 Keep native hardware controls within the approved GUI

In the Windows WebView, this inserts new Audio I/O and Monitor buttons into the command bar, alongside the newly constructed native-only settings dialog and stylesheet. The public /preview/ assembly receives none of these additions, so the shipped native GUI now differs in appearance and interaction from the approved reference. AGENTS.md explicitly limits this adapter to data/event authority changes and requires the same generated GUI in both environments; hardware setup needs to be integrated through an approved shared surface rather than introducing a native-only visual variant.

AGENTS.md reference: AGENTS.md:L34-L34

Useful? React with 👍 / 👎.

…, refresh readback, distinguish patched from unknown
…N MUTE as explicit monitor control, remove added command-bar buttons
@masarray masarray closed this Nov 8, 2026
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