Skip to content

Restore mixer audio and controls after device changes, and enable Add Audio Track - #445

Merged
masarray merged 9 commits into
mainfrom
fix/verified-device-mixer-rebind
Nov 8, 2026
Merged

masarray merged 9 commits into
mainfrom
fix/verified-device-mixer-rebind

Conversation

@masarray

@masarray masarray commented Nov 7, 2026 •

Copy link
Copy Markdown
Owner

Mixer

  • Audio I/O rebinds the verified native mixer to the new device epoch, preserving stable ChannelIds, WIRE, VST3 and controls. Only physical patches that cannot be verified are cleared.
  • MAIN starts automatically after a verified startup, device change or first input patch. An explicit user mute cancels the pending automatic start. Known VB-Cable feedback pairs stay blocked.
  • Persist the Windows VST3 module description cache and reuse discovery results for unchanged modules. Vendor instances still initialize when loaded.
  • The floating channel editor selects the full name on open. Enter saves through the existing native readback.
  • The native toolbar adds a stereo audio track with no hardware input and a MAIN route. It waits for the accepted ChannelId before selecting and revealing the new strip. Works from the verified silent starter mixer and the admitted live mixer.

Checkpoint and verification

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 7, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-07T20:56:41.075097Z a909531 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 commented Nov 7, 2026

Copy link
Copy Markdown
Owner Author

/arsonmix-ci fat a909531

masarray commented Nov 7, 2026

Copy link
Copy Markdown
Owner Author

/arsonmix-ci ui a909531

@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: a909531f36

ℹ️ 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/NativeMixerSessionDocument.h Outdated
outputs.monitorL=outputs.monitorR=-1;
outputs.monitorEnabled=false;
}
if(!outputs.valid())outputs={count,0,1,-1,-1,false};

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 Require explicit MAIN remapping when selected output pins disappear

When Apply disables the currently assigned MAIN pins on the same device, this fallback silently assigns MAIN to the first two remaining outputs. For example, a session using physical outputs 3/4 with mask f becomes routed to physical outputs 1/2 after applying mask 3. Previously, the exact-binding check rejected that changed mapping; the new verifiedDeviceApply path accepts and publishes it through finishAudioSetupAndRecoverMixer(true). MAIN remains muted initially, but subsequently enabling monitoring sends audio to connectors the operator never selected as MAIN. Return NEEDS_REMAP when the saved MAIN pair cannot be preserved, and require an explicit physical-output selection instead of substituting another pair. This also violates the explicit prohibition on silent output rerouting in AGENTS.md.

AGENTS.md reference: AGENTS.md:L67-L68

Useful? React with 👍 / 👎.

masarray commented Nov 7, 2026

Copy link
Copy Markdown
Owner Author

Cross-thread reconciliation — audio device Apply vs smart Inno Setup (8 Nov 2026)

This native-device PR is the device-session/control recovery authority; separate #443 is the Inno setup/update + Preview-branded artifact authority. Both touch src/Main.cpp, but #443 changes ConsoleApp installer handshake near startup/shutdown; #445 changes ConsoleWindow verified device Apply and retained-mixer restoration. They MUST both survive the final main merge.

Critical #445 Codex P1 review finding (silent MAIN jack migration) addressed on current head cddf25b8c82a2d417d73bd09dc2d1c15b78cbf75:

  • MixerDeviceBindingPolicy::proposedOutputs never falls back to physical output 1/2 when original physical MAIN pins vanish on the same endpoint or ASIO pin inventory changes. Returns an invalid proposal, which triggers NEEDS_REMAP.
  • apply checks the proposed identity-preserving remap even if another valid-looking output pair is provided; it cannot overwrite the retained session or silently send audio to different jacks.
  • A different playback device exposing more than one stereo pair does not get an arbitrary MAIN 0/1 by default; output pair selection must be explicit.
  • tests/native_mixer_session_store_test.cpp now checks saved physical MAIN 3/4 with mask f, new mask 3 (reject/no mutation), mask c (preserve same physical pins via ordinal remap), output pin label change (reject), new playback with four outputs (reject).
  • Standard operator Apply remains muted on success, so no unexpected monitor ARM.

Do not merge without new exact-head native CTest. #443 installer head 0a48518dd7e92897572ff02c84c3b34a607beb7f has native quick and Windows Inno smoke passing; exact-head packaging is separately gated. Coordinate final branch merge to include BOTH changes and keep optional CI selective.

masarray commented Nov 7, 2026

Copy link
Copy Markdown
Owner Author

/arsonmix-ci native cddf25b

masarray commented Nov 7, 2026

Copy link
Copy Markdown
Owner Author

/arsonmix-ci fat 8af626a

masarray commented Nov 7, 2026

Copy link
Copy Markdown
Owner Author

/arsonmix-ci ui 8af626a

masarray commented Nov 7, 2026

Copy link
Copy Markdown
Owner Author

Cross-thread P0 Inno upgrade failure and device-work preservation (8 Nov 2026)

Actual Windows user error: DeleteFile failed; code 5. Access is denied while replacing %LOCALAPPDATA%\Programs\ArSonMix\ArSonMix.exe. The installer could reach [Files] while the old executable remained alive. PR #443 is the authoritative installer fix on exact head 2fa18fe47109ba3d99a06324d71ce8a943aefe60: its PrepareToInstall first signals native ConsoleApp handshake, falls back to exact-EXE-path process WM_CLOSE for legacy builds, waits for shutdown, verifies an exclusive writable EXE handle, and aborts prior to replacement on a hung or locked process. CloseApplications=no intentionally disables the competing Windows Restart Manager path; no kill, no user data cleanup. RestartApplications=no + a single interactive [Run] ensures exactly one launch.

Windows real install/upgrade smoke PASS: native-handshake fixture; legacy no-handshake GUI + WM_CLOSE_SAVED; nonresponsive locked binary fails before replacement with exit 7 and Studio SHA/data preserved. Exact-head Windows MSVC + installer FAT is in progress.

Reconciliation: PR #443 only changes ConsoleApp startup/shutdown in src/Main.cpp, while #445 changes ConsoleWindow device Apply / retained mixer session and separate native engine files. Keep both on integration; do NOT revert #445's saved WIRE/FX/fader, output-pin NEEDS_REMAP safety, or GUI rename workflow. An upgrade must close/safely save the old mixer and reopen a full mixer capable of the device-switch fixes, not install a stale executable.

masarray commented Nov 7, 2026

Copy link
Copy Markdown
Owner Author

/arsonmix-ci fat 656c7a5

masarray commented Nov 7, 2026

Copy link
Copy Markdown
Owner Author

Integration handoff: smart installer PR #443 now merged into main

Main merge: 30aea0deecb08d26633c272040d1920cc9df12fc — PR #443 merged after exact-head Windows FAT/CTest PASS and real Windows Inno legacy/blocked EXE smoke PASS. This thread's installer owner task is complete.

Your device/session PR #445 remains independently open at head 656c7a5605038d9e39bf1a7b40453ff35eb3ed85 (head changed during cross-thread development). Its base must reconcile latest main. Both branches touched src/Main.cpp: keep newly merged ConsoleApp installer startup/shutdown handshake AND #445 ConsoleWindow verified device Apply/mixer retention; don't overwrite either. The installer asset/CI source is now on main with ArSonMixUpdateShutdown.ps1, PrepareToInstall fail-closed preflight, and Preview artifacts.

No merging of #445 was attempted here; coordinate its own latest tests/approval in the device thread.

@masarray masarray changed the title Restore mixer controls after audio device Apply Restore mixer audio and controls after device changes, and enable Add Audio Track Nov 7, 2026

masarray commented Nov 7, 2026

Copy link
Copy Markdown
Owner Author

/arsonmix-ci ui c56831a

masarray commented Nov 7, 2026

Copy link
Copy Markdown
Owner Author

/arsonmix-ci fat 4c55c80

masarray commented Nov 7, 2026

Copy link
Copy Markdown
Owner Author

/arsonmix-ci ui 4c55c80

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