Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
f763dc2
feat(device): attest actual JUCE active channel masks and sparse port…
masarray Oct 28, 2026
8a198c0
build(device): include explicit standard dependencies for channel sna…
masarray Oct 28, 2026
f5c6dad
test(device): verify sparse physical channels, output mask, epochs an…
masarray Oct 28, 2026
f55224b
build: register native JUCE physical channel topology verification
masarray Oct 28, 2026
3fcedd1
ci: test actual JUCE active-mask translation on Windows CI
masarray Oct 28, 2026
54f276a
feat(mixer): bind JUCE device masks to 10-channel DSP and realtime gr…
masarray Oct 28, 2026
660a379
test(mixer): JUCE sparse physical hardware pins through native-epoch …
masarray Oct 28, 2026
c4d5190
build: wire prepared JUCE-to-DSP session end-to-end acceptance test
masarray Oct 28, 2026
9962484
ci: include P1F device-epoch native render test in existing optimized…
masarray Oct 28, 2026
6a17a51
docs: retain P1F hardware session guard, cross-thread baseline, and n…
masarray Oct 28, 2026
344ce8c
merge current GUI main into P1F with JUCE port-binding CTests preserved
masarray Oct 28, 2026
ee1f955
feat(routing): decode validated 10-channel bus/send/mute/solo configu…
masarray Oct 28, 2026
d8bada6
fix(routing): keep decoded JUCE array lifetime stable while validatin…
masarray Oct 28, 2026
2d23311
feat(live): extend existing JUCE dry routing LAB with real cycle-safe…
masarray Oct 28, 2026
84ef063
feat(gui): operator-friendly live routing BUS, PRE/POST send matrix, …
masarray Oct 28, 2026
a2b115b
test(live): verify real PRE vs POST bus audio, cycles, invalid GUI co…
masarray Oct 28, 2026
1820f4a
build: native JUCE dry routing bus/send test in existing CTest
masarray Oct 28, 2026
0ed1428
ci: execute hardware mask and real dry BUS/send tests on Windows
masarray Oct 28, 2026
cabb17f
test(gui): guard truthful native BUS/send controls and ACK
masarray Oct 28, 2026
0ef6757
docs: P1G real hardware lab send and BUS acceptance with latest GUI b…
masarray Oct 28, 2026
3c89596
fix(rt): latch callback I/O topology mismatch to silence until valida…
masarray Oct 28, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/p1-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ jobs:
-DBUILD_TESTING=ON
-DJUCE_WEBVIEW2_PACKAGE_LOCATION="${{ github.workspace }}/.deps"
- name: Build executable and native RT tests
run: cmake --build build --config Release --target ARMixConsole ARMixFxOrderTests ARMixMixerRoutingTests ARMixChannelRoutingContractTests ARMixChannelSendTests ARMixPreparedMixerBlockTests ARMixLiveRoutingEpochTests ARMixWorkspaceTests ARMixVaultTests ARMixBackupTests ARMixOrbitPhaseTests ARMixOrbitControlTests ARMixOrbitMotionTests ARMixOrbitDistanceTests ARMixFxBypassEnvelopeTests ARMixDearVrPolarPolicyTests ARMixRTTests ARMixPresetTests ARMixDiagnosticTests ARMixClockBridgeTests ARMixVirtualClockSoakTests ARMixCadenceTests ARMixCrackleWindowTests ARMixHealthTests ARMixPolicyTests ARMixPeriodEvidenceTests ARMixLifecycleTests ARMixWasapiProbeTests ARMixDualJuceTests ARMixClockSizingTests ARMixIndependentFormatTests ARMixRecoveryTests ARMixStreamWatchdogTests ARMixBridgeContinuityTests ARMixEndpointPolicyTests ARMixEndpointGuardTests ARMixAsioPolicyTests ARMixAsioBackendTests ARMixAsioRegistryIdentityTests ARMixDirectFenceTests --parallel 2
run: cmake --build build --config Release --target ARMixConsole ARMixFxOrderTests ARMixMixerRoutingTests ARMixChannelRoutingContractTests ARMixChannelSendTests ARMixPreparedMixerBlockTests ARMixLiveRoutingEpochTests ARMixJucePortMaskTests ARMixNativeMixerSessionTests ARMixNativeDrySendTests ARMixWorkspaceTests ARMixVaultTests ARMixBackupTests ARMixOrbitPhaseTests ARMixOrbitControlTests ARMixOrbitMotionTests ARMixOrbitDistanceTests ARMixFxBypassEnvelopeTests ARMixDearVrPolarPolicyTests ARMixRTTests ARMixPresetTests ARMixDiagnosticTests ARMixClockBridgeTests ARMixVirtualClockSoakTests ARMixCadenceTests ARMixCrackleWindowTests ARMixHealthTests ARMixPolicyTests ARMixPeriodEvidenceTests ARMixLifecycleTests ARMixWasapiProbeTests ARMixDualJuceTests ARMixClockSizingTests ARMixIndependentFormatTests ARMixRecoveryTests ARMixStreamWatchdogTests ARMixBridgeContinuityTests ARMixEndpointPolicyTests ARMixEndpointGuardTests ARMixAsioPolicyTests ARMixAsioBackendTests ARMixAsioRegistryIdentityTests ARMixDirectFenceTests --parallel 2
- name: Test realtime control primitives
run: ctest --test-dir build -C Release --output-on-failure
- name: Package verified JUCE GUI for hardware FAT
Expand Down
17 changes: 16 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ juce_add_gui_app(ARMixConsole
juce_add_binary_data(ARMixAssets SOURCES
web/index.html web/styles.css web/app.js web/bridge.js web/monitor.js)

target_sources(ARMixConsole PRIVATE src/Main.cpp src/LiveAudioEngine.h src/VstOrbitController.h engine/core/MixerRoutingPlan.h engine/core/ChannelRoutingContract.h engine/core/ChannelSendPlan.h engine/core/PreparedMixerBlock.h engine/core/RealtimeRoutePublisher.h engine/device/LiveInputPortRegistry.h src/LiveDryRoutingLab.h engine/core/OrbitPhase.h engine/core/OrbitControlPolicy.h engine/core/OrbitMotion.h engine/core/OrbitDistanceMapping.h engine/core/DearVrPolarPolicy.h src/PluginCatalog.h src/PluginVault.h src/PortableWorkspace.h src/StudioBackup.h src/DiagnosticsRecorder.h src/StereoPan.h src/NativePresetArchive.h src/VstBusLayout.h src/LiveGraphHandoff.h src/DiagnosticTone.h engine/core/RealtimeHealthHistogram.h engine/core/CallbackCadenceEvidence.h engine/diagnostics/CrackleEvidenceWindow.h engine/device/AdaptiveClockBridge.h engine/device/AudioProfilePolicy.h engine/device/PeriodCapabilityEvidence.h engine/device/SessionLifecycle.h engine/device/WasapiCapabilityProbe.h engine/device/JuceIndependentClockDevice.h engine/device/ClockBridgeSizing.h engine/device/IndependentStreamFormatFence.h engine/device/DirectRestoreBackoff.h engine/device/IndependentStreamWatchdog.h engine/device/BridgeContinuityGate.h engine/device/EndpointIdentityPolicy.h engine/device/WasapiEndpointIdentityGuard.h engine/device/AsioStartupPolicy.h engine/device/AsioPriorityDeviceManager.h engine/device/AsioRegistrationPolicy.h engine/device/AsioRegistryIdentityProbe.h engine/device/DirectRouteFence.h)
target_sources(ARMixConsole PRIVATE src/Main.cpp src/LiveAudioEngine.h src/VstOrbitController.h engine/core/MixerRoutingPlan.h engine/core/ChannelRoutingContract.h engine/core/ChannelSendPlan.h engine/core/PreparedMixerBlock.h engine/core/PreparedNativeMixerSession.h engine/core/NativeDryRouteCommand.h engine/core/RealtimeRoutePublisher.h engine/device/LiveInputPortRegistry.h src/LiveDryRoutingLab.h engine/core/OrbitPhase.h engine/core/OrbitControlPolicy.h engine/core/OrbitMotion.h engine/core/OrbitDistanceMapping.h engine/core/DearVrPolarPolicy.h src/PluginCatalog.h src/PluginVault.h src/PortableWorkspace.h src/StudioBackup.h src/DiagnosticsRecorder.h src/StereoPan.h src/NativePresetArchive.h src/VstBusLayout.h src/LiveGraphHandoff.h src/DiagnosticTone.h engine/core/RealtimeHealthHistogram.h engine/core/CallbackCadenceEvidence.h engine/diagnostics/CrackleEvidenceWindow.h engine/device/AdaptiveClockBridge.h engine/device/AudioProfilePolicy.h engine/device/PeriodCapabilityEvidence.h engine/device/SessionLifecycle.h engine/device/WasapiCapabilityProbe.h engine/device/JuceIndependentClockDevice.h engine/device/ClockBridgeSizing.h engine/device/IndependentStreamFormatFence.h engine/device/DirectRestoreBackoff.h engine/device/IndependentStreamWatchdog.h engine/device/BridgeContinuityGate.h engine/device/EndpointIdentityPolicy.h engine/device/WasapiEndpointIdentityGuard.h engine/device/AsioStartupPolicy.h engine/device/AsioPriorityDeviceManager.h engine/device/JuceActivePortSnapshot.h engine/device/AsioRegistrationPolicy.h engine/device/AsioRegistryIdentityProbe.h engine/device/DirectRouteFence.h)
target_compile_definitions(ARMixConsole PRIVATE
JUCE_WEB_BROWSER=1
JUCE_USE_WIN_WEBVIEW2=1
Expand Down Expand Up @@ -59,6 +59,21 @@ if(BUILD_TESTING)
add_executable(ARMixPreparedMixerBlockTests tests/prepared_mixer_block_test.cpp)
target_compile_features(ARMixPreparedMixerBlockTests PRIVATE cxx_std_20)
add_test(NAME TenChannelEndToEndPreparedAudioRender COMMAND ARMixPreparedMixerBlockTests)
juce_add_console_app(ARMixJucePortMaskTests PRODUCT_NAME "ArSonMix JUCE Port Mask Snapshot Tests")
target_sources(ARMixJucePortMaskTests PRIVATE tests/juce_active_port_snapshot_test.cpp engine/device/JuceActivePortSnapshot.h)
target_link_libraries(ARMixJucePortMaskTests PRIVATE juce::juce_audio_devices juce::juce_recommended_config_flags)
target_compile_features(ARMixJucePortMaskTests PRIVATE cxx_std_20)
add_test(NAME JuceSparseActiveChannelMaskAndEpoch COMMAND ARMixJucePortMaskTests)
juce_add_console_app(ARMixNativeMixerSessionTests PRODUCT_NAME "ArSonMix Bound Native Routing Tests")
target_sources(ARMixNativeMixerSessionTests PRIVATE tests/prepared_native_mixer_session_test.cpp engine/core/PreparedNativeMixerSession.h)
target_link_libraries(ARMixNativeMixerSessionTests PRIVATE juce::juce_audio_devices juce::juce_recommended_config_flags)
target_compile_features(ARMixNativeMixerSessionTests PRIVATE cxx_std_20)
add_test(NAME P1FPhysicalPortToNativeMasterAndEpochGuard COMMAND ARMixNativeMixerSessionTests)
juce_add_console_app(ARMixNativeDrySendTests PRODUCT_NAME "ArSonMix Live Dry Send and BUS Tests")
target_sources(ARMixNativeDrySendTests PRIVATE tests/native_dry_route_command_test.cpp engine/core/NativeDryRouteCommand.h)
target_link_libraries(ARMixNativeDrySendTests PRIVATE juce::juce_core juce::juce_recommended_config_flags)
target_compile_features(ARMixNativeDrySendTests PRIVATE cxx_std_20)
add_test(NAME LiveNativePrePostSendAndBusContract COMMAND ARMixNativeDrySendTests)
add_executable(ARMixLiveRoutingEpochTests tests/live_port_epoch_publisher_test.cpp)
target_compile_features(ARMixLiveRoutingEpochTests PRIVATE cxx_std_20)
add_test(NAME P1ELivePortGenerationRevisionAndRealtimeRetirement COMMAND ARMixLiveRoutingEpochTests)
Expand Down
21 changes: 21 additions & 0 deletions docs/P1F_JUCE_DEVICE_BOUND_DSP_20261028.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# P1F — JUCE hardware port binding to prepared native 10-channel graph

Source: main `15450e64d6fbb683150a624859a6351ca5ad2c34` (FX drag atomic reorder, Orbit/POLAR, meter, bypass and lean CI already reconciled). No edits to production `LiveAudioEngine.h`, `src/Main.cpp`, `web/*`, vendor VST or hardware settings.

## Implemented in code

- `engine/device/JuceActivePortSnapshot.h` reads the *real opened device's* `getActiveInputChannels()` and `getActiveOutputChannels()` masks on the control/device lifecycle thread. Sparse enabled physical inputs are sorted and mapped to JUCE callback pointer ordinals. Output physical indices are retained. Rejects missing device, unopened device, empty inputs/outputs, masks >256 physical channels, a changing mask while read, invalid epochs. No fallback to `input[0]` or invention of physical pins. Driver/ASIO registration identity remains protected by the existing direct-route fence.
- `engine/core/PreparedNativeMixerSession.h` composes `JuceActivePortSnapshot` + `PreparedRenderGraph` + `PreparedMixerBlock` + existing P1E `RealtimeRoutePublisher`. The **same** physical port mapping is validated into the DSP source and bound to immutable graph/device epoch/revision. Rejects invalid buffer limits and invalid routing without partial publication. Audio-reader render lease rejects changed device epoch or callback input/output counts and clears master output. Realtime render has no port discovery, allocations, device restart, file calls or locks. Snapshots and FX ownership are retired on control thread.
- Two executable native JUCE CTests, `JuceSparseActiveChannelMaskAndEpoch` and `P1FPhysicalPortToNativeMasterAndEpochGuard`, are built into existing Windows workflow. Test: active input bits 2/5/9, actual callback pointer order, channel physical mono IN9 + stereo IN2/5, CH1→CH3 return without physical input, exact stereo master audio values, stale epoch/input count/output count fail-closed, invalid routing rollback, and epoch/revision publication validation.

## Strict gate to full live DAW routing

This is **an executable control-to-DSP integration artifact**, not yet enabled as the native live JUCE host path. The existing host still starts `deviceManager_.initialise(1,2,...)`; enabling any other hardware input may require user-controlled device reopen. A verified requested physical ASIO mask and deliberate device profile must precede live activation.

The native callback currently owns one CH1-only VST chain; replacing it blindly would erase proven Orbit, FabFilter processing, FX reorder, anti-crackle bypass and the user's physical audio results. The next milestone must first provide independent VST3 instance ownership and real mono/stereo plugin bus negotiation, then wire a callback-boundary route change with ACK, preallocated FX scratch, actual VU per strip, and preserve DIRECT / Independent Clock diagnostics. Do not mark CH2–10 GUI buttons active without all of that.

Issue #15 zero-FX crackle remains open. Unit tests do not qualify hardware sound quality. Approved GUI remains unchanged; #115/#117 are overlapping offline graphs and must be reconciled by function rather than merged as duplicate engines.

## Acceptance and follow-up

Windows MSVC native CTest and UI must pass at exact PR head; no main merge without that. Audio interface ASIO tests with ports not starting at 1 and sparse enabled masks are required before declaring physical I/O mapping trustworthy. Device disconnect/reopen increments epoch and cannot inherit old live snapshots, with port identity remapping explicit for portable performances. If a route requests a currently inactive physical pin, the control plane must ask for Audio Setup and cannot silently reopen during live performance.
32 changes: 32 additions & 0 deletions docs/P1G_NATIVE_DRY_BUS_SENDS_FAT_20261028.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# P1F–P1G — Native 10-Channel Routing LAB + PRE/POST Sends (2026-10-28)

**Starting point:** reconciled latest `main@3b327bd5f9513ad405122258665457eb8ee07e73`. Preserve merged GUI finish, channel/master strip layout, button colors, master mono, CH1 native VST3/Orbit/FX reorder and bypass, backup, lean CI and physical no-FX diagnostic. The native Routing LAB existed already in main: this is an extension of that actual callback path, **not a second mixer engine or GUI mockup**.

## What actually runs natively now

- A verified direct JUCE device supplies **actual active hardware input/output masks**, not guessed pin ordinals; physical IN 3 can be callback[0], and a stereo pair can have nonadjacent physical pins. The P1F `JuceActivePortSnapshot` validates hardware topology at device start and records output mask/count. If the callback input **or output** count changes, LAB writes silence and never falls through to the live CH1 host.
- The opt-in `LiveDryRoutingLab` already called `PreparedMixerBlock` in `LiveAudioEngine` without changing the normal VST3 path. P1G now decodes one **transactional** routing command into ten physical/BUS channels and up to **32 internal PRE or POST fader sends**. Edits are validated completely off RT; a graph that contains feedback loops, duplicate edges, invalid port selection, invalid levels, self-send, stale device epoch or stale graph revision is **rejected without changing the active graph**.
- Channels can be `NONE`, physical `MONO`, physical `STEREO`, or virtual `BUS` (a native stereo return with no physical capture port). Each has a fader, MAIN output toggle, mute and solo. A source can go to MAIN, to sends only, or both. BUS returns can send onward to other buses in validated topological order. Native signal path: **real input → optional downmix/dual-mono → PRE send → fader/pan/mute/solo → POST send → BUS return → MAIN master**.
- The audio callback uses the existing preallocated array-backed `PreparedMixerBlock` and `RealtimeRoutePublisher`. Graph publication uses device-epoch and revision fencing. No JSON parsing, heap, I/O, plugin initialization, device restart, JS, mutex or thread spawn in the realtime render. Preserve 256-sample de-click ramp and strict emergency mute behavior.
- Ten true post-fader per-strip peaks are published using atomics (peak values reflect DSP channel output), exposed to the Routing LAB panel only; no fake VU or heavy blur/DOM animation. The GUI has one consolidated panel with physical input selectors, format/BUS, level, MAIN/MUTE/SOLO and an Add/Remove PRE/POST send list; it submits **draft only** and reflects the native ACK. The source list resets on device epoch change.
- One new JUCE C++ test validates command parsing, actual synthetic sample audio through pre-fader bus return with the source fader at zero, silence at post-fader sends, cycle rejection, invalid GUI values and rollback. An expanded Node/UI contract proves the source is connected to native audio and send controls. Existing P1A–P1F and P0 tests still run on the same Windows CI.

## Actual on-device usage — *controlled FAT, not a show build*

1. Open SIGNAL CHECK → **MUTE OUTPUT** first. Confirm DIRECT ASIO/WASAPI device is authorized. Remove any CH1 VST3 before using LAB.
2. Click **ROUTING LAB · 10 CH**. Select a real physical `MONO` or `STEREO` input for CH1, select `BUS` for CH2 or another return. Leave unused channels `NONE`.
3. For a dry AUX example: set CH1 `MAIN` off, CH1 fader zero, CH2 `BUS` with `MAIN` on. Press `+ ADD SEND`, choose `CH1 → CH2`, `PRE`, gain `−12 dB`. APPLY TO NATIVE AUDIO while muted; verify ACK.
4. Unmute with **headphones and low external monitoring volume**, observe master and channel peak in LAB. The PRE send should still be audible even if CH1 fader is zero. Change send to `POST`, APPLY while muted; the output should be silent at fader zero. This is actual DSP, not an FX plugin reverb; BUS does not insert a VST.
5. Use `STOP LAB` to exit back to the original CH1 host. Output stays muted for safety. If the device restarts, the LAB route becomes stale; inputs need explicit remapping and fresh native approval. Invalid sends produce a reason and preserve the prior verified state.

## Explicit uncompleted qualifications

- **No real VST3 chains on CH2–10.** No AUX hardware outputs or true plug-in FX returns yet. BUS is internal dry mixing, not an FX plugin. CH1 native VST3 remains suspended/excluded during LAB and resumes only after STOP.
- The production JUCE host initialises with 1 input and 2 outputs. Extra active ASIO hardware inputs require the user to enable channels in AUDIO SETUP; the LAB cannot silently reopen or activate absent ports.
- The new status outputPort mask is backend-reported. Hardware port names, device serial identity, actual dual-clock endpoint identity, PDC and portable per-user routing persistence remain follow-on obligations.
- Real hardware click/dropout validation, independent-clocks FAT, VST3 bus negotiation, latency compensation and **Issue #15 zero-FX crackle** are still not qualified. CTest PASS only proves programmatic contracts; never label a build FAT-certified based on CI.
- Bounded 32 sends, ten strips and stereo MAIN are an implementation scope; these do not limit the flexibility of imported VST3 plugins or public/private feature parity.

## Merge gates and follow-on

Use exact-head Windows MSVC, CTest and JS+Chromium checks, compare main before merge, and verify GitHub release artifact. GUI finishes currently in main **must not be overwritten**. Next milestone: native CH1–10 independent plugin instance ownership, stereo/mono VST3 bus negotiation and latency/PDC, publish/retire all FX state safely off callback; activate normal GUI SOURCE/FX only after real hardware acceptance.
Loading
Loading