Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
69fedf8
feat(P0): real separate WASAPI capture and render devices with bounde…
masarray Oct 25, 2026
a57df1b
feat(P0): run true independent capture/render managers and live adapt…
masarray Oct 25, 2026
e14c3b3
fix(P0): honor mono capture selection and observe stopped endpoint fo…
masarray Oct 25, 2026
3b30921
feat(P0): telemetry for actual split-stream clock state and capture w…
masarray Oct 25, 2026
ecc60e4
feat(P0): AUTO startup, stable/low/direct profiles, watchdog rollback…
masarray Oct 25, 2026
a12ee79
feat(P0): user-visible AUTO/STABLE/LOW LATENCY/DIRECT profiles and re…
masarray Oct 25, 2026
31f7094
build(P0): register production split-stream JUCE adapter header
masarray Oct 25, 2026
d7b6e48
docs(engine): reflect actual split-stream adapter integration without…
masarray Oct 25, 2026
b2c3049
test(P0): update native integration contracts for real independent st…
masarray Oct 25, 2026
82ca0a5
test(P0): enforce real independent Windows capture/render streams and…
masarray Oct 25, 2026
11b752f
ci(P0): require proof of real independent capture/render manager and …
masarray Oct 25, 2026
0fa83e4
docs(ci): label production path correctly with unqualified hardware FAT
masarray Oct 25, 2026
3974d0a
test(P0): 30-minute deterministic split-clock stress with -300ppm dri…
masarray Oct 25, 2026
4d5e002
docs(P0): truthfully specify production split-clock engine, fallback …
masarray Oct 25, 2026
7fdc8a1
docs(handoff): reflect live split adapter and remaining hardware qual…
masarray Oct 25, 2026
9c2aec9
docs(readme): synchronize live smart audio routing capabilities and h…
masarray Oct 25, 2026
d4ef486
docs(P0): mark earlier offline bridge as historical, point all thread…
masarray Oct 25, 2026
39cac2f
fix(P0): explicit full-duplex channel restoration and clock-generatio…
masarray Oct 25, 2026
519370b
fix(P0): persist SRC preparation rates, expose current callback rates…
masarray Oct 25, 2026
7d41ff9
test(P0): use STABLE headroom for 10ms capture stalls; low-latency po…
masarray Oct 25, 2026
b540744
test(P0): regression guards for exact input-mask recovery and callbac…
masarray Oct 25, 2026
c42dca2
test(P0): correct JS regular-expression escapes in lifecycle regressi…
masarray Oct 25, 2026
f40476c
safety(P0): block old callback-detaching FX mutations during Smart du…
masarray Oct 25, 2026
dbff5a1
fix(msvc): use non-const JUCE AudioIODevice for rate and period getters
masarray Oct 25, 2026
2234b47
test(P0-00): prevent persisting both isolated and independent split a…
masarray Oct 25, 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
3 changes: 2 additions & 1 deletion .github/workflows/p1-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ jobs:
node --test tests/smart_audio_ard_contract_test.mjs
node --test tests/p0_diagnostic_contract_test.mjs
node --test tests/smart_audio_diagnostic_contract_test.mjs
node --test tests/live_split_audio_contract_test.mjs
- name: Configure Windows x64
shell: pwsh
run: >
Expand All @@ -64,7 +65,7 @@ jobs:
if (-not $exe) { throw "ARMixConsole EXE not found" }
Copy-Item $exe.FullName "dist/ArSonMix-P2.5-GUI-v0.8-Native-Windows.exe"
Copy-Item README.md "dist/README.md"
"P0 native engineering build: SIGNAL CHECK has COPY FULL REPORT, hardware capability and DSP distributions, and isolated output/capture/dry modes. An offline adaptive dual-clock FIR bridge is tested in CI but NOT connected to the existing JUCE joined callback until P0-01 separate-stream adapter is validated. No hardware audio acceptance yet. Use headphones at low level. Only Channel 1 is native." |
"P0 live dual-stream integration build: AUTO attempts independent Windows Audio capture/render with bounded polyphase ASRC for distinct endpoints, DIRECT keeps ASIO without added SRC; profiles and one-click report are available in SIGNAL CHECK. AUTO falls back to legacy JUCE on failed setup or missing capture callbacks. No physical hardware acceptance yet. Use headphones at low level. Only Channel 1 is native." |
Out-File -FilePath dist/FIRST_SOUND_README.txt -Encoding utf8
- uses: actions/upload-artifact@v4
with:
Expand Down
2 changes: 1 addition & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
- Locked GUI v0.8 source untouched without explicit new visual approval. Engine status goes through native adapter. No stale branch bulk merges.
- Use `docs/SMART_AUDIO_ENGINE_IMPLEMENTATION_BLUEPRINT.md` PR ladder and definition of done, and update it only with evidence/ADR when changing design decisions.
- Consolidate P0 infrastructure development and automated CI before requesting another physical hardware test; no user-assisted test after every tiny code edit. Native SIGNAL CHECK should expose **COPY FULL REPORT** to capture hardware capabilities, source-labeled xruns, budget histograms, and latest MARK CRACKLE events in the OS clipboard.
- Read [P0 Smart Audio diagnostics & prepared bridge](docs/P0_SMART_AUDIO_DIAGNOSTIC_AND_BRIDGE.md) before wiring an SRC. The `AdaptiveClockBridge` is **experimental standalone**, and MUST NOT be wired to the joined JUCE callback or claimed to fix physical crackling until separate-clock adapter feasibility, back-end xrun semantics, automated quality benchmarks and hardware FAT are demonstrated.
- Read [P0 live dual-stream engine](docs/P0_LIVE_SPLIT_AUDIO_ENGINE.md): the Smart path uses TWO independent JUCE Windows Audio devices and capture/render callbacks with FIFO+ASRC; the ASIO/direct path remains unchanged. No GUI mixer redesign. The previous P0 prepared-core handoff is historical. This real adapter is still hardware-UNQUALIFIED: device-dependent buffering and Bluetooth transport cannot be promised glitch-free or sub-10ms until physical FAT. Preserve one-click COPY FULL REPORT.

## If you are a future ChatGPT thread
1. Fetch live repository `main`, this file and the lock document. Cite approved commit and deployment metadata accurately.
Expand Down
2 changes: 1 addition & 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/PluginCatalog.h src/DiagnosticsRecorder.h src/StereoPan.h src/NativePresetArchive.h src/VstBusLayout.h src/LiveGraphHandoff.h src/DiagnosticTone.h engine/core/RealtimeHealthHistogram.h engine/device/AdaptiveClockBridge.h engine/device/AudioProfilePolicy.h)
target_sources(ARMixConsole PRIVATE src/Main.cpp src/LiveAudioEngine.h src/PluginCatalog.h src/DiagnosticsRecorder.h src/StereoPan.h src/NativePresetArchive.h src/VstBusLayout.h src/LiveGraphHandoff.h src/DiagnosticTone.h src/SplitDuplexAdapter.h engine/core/RealtimeHealthHistogram.h engine/device/AdaptiveClockBridge.h engine/device/AudioProfilePolicy.h)
target_compile_definitions(ARMixConsole PRIVATE
JUCE_WEB_BROWSER=1
JUCE_USE_WIN_WEBVIEW2=1
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ The Chromium smoke test needs Playwright Chromium installed. `.github/workflows/

`main` contains experimental JUCE C++20 ASIO/WASAPI **Channel 1** realtime audio, VST3 scanning/import/catalog, editor, FX bypass, FabFilter/RX-compatible layout, diagnostics, native `.armix` preset saving and P2.5 prepared-graph recall. It preserves GUI v0.8, while Channels 2–12 and Master FX/PAN remain non-native previews. The display does **not** claim measured BS.1770 LUFS-I or dBTP. Live recall uses a de-click fade (not seamless DSP crossfade), and ADD/REMOVE/REORDER still detach callback. FabFilter, iZotope RX, and other third-party plugins require Windows hardware FAT before a stable release. [Experimental Windows CI builds](https://github.com/masarray/arsonmix/actions/workflows/p1-windows.yml) provide artifacts from passing runs.

**P0 field support:** SIGNAL CHECK → **COPY FULL REPORT** copies the current native device, sample-rate/buffer, performance, source-labeled discontinuities and recent MARK CRACKLE events into the Windows clipboard for direct paste into the engineering thread. Experimental FIR/dual-clock code is a CI-tested core, not yet wired to physical WASAPI. [Detailed status and remaining gates](docs/P0_SMART_AUDIO_DIAGNOSTIC_AND_BRIDGE.md).
**P0 live routing candidate:** SIGNAL CHECK → SMART AUDIO offers AUTO / STABLE / LOW LATENCY / DIRECT and **COPY FULL REPORT**. AUTO now attempts two real, independently-clocked Windows Audio capture/render devices for distinct endpoint names; a bounded FIR ASRC consumes capture from render clock, with watchdog and rollback to legacy JUCE on failure. Wired ASIO stays direct without extra SRC. **This code is still hardware-unqualified, not guaranteed to eliminate crackling on every device; Bluetooth and hardware latency remain device-dependent.** [Live split engine and acceptance plan](docs/P0_LIVE_SPLIT_AUDIO_ENGINE.md).

**Current native architecture (read first):** [Smart Audio Engine ARD v1.0](docs/ARD_SMART_AUDIO_ENGINE_V1_2026-10-25.md) · [implementation blueprint](docs/SMART_AUDIO_ENGINE_IMPLEMENTATION_BLUEPRINT.md) · [zero-FX crackling P0 issue #15](https://github.com/masarray/arsonmix/issues/15). The [older architecture v0.3](docs/ARD_AR_MIX_LIVE_FX_HOST_v0.3.md) is historical and superseded where inconsistent. [GUI v0.8](docs/GUI_BASELINE_LOCK_2026-10-25.md) remains locked. No P2.6 expansion until 44.1/48 kHz dry audio FAT is clean; no public-live claims from green CI alone. Native code follows GUI v0.8, not the opposite.

Expand Down
33 changes: 33 additions & 0 deletions docs/P0_LIVE_SPLIT_AUDIO_ENGINE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# P0 Live Smart Audio — independent Windows capture/render integration

**2026-10-25 · implementation review status:** Windows CI pending on PR branch; physical 44.1/48 kHz crackling FAT not run. Never mark P0 hardware acceptance GREEN from simulated test.

## What is actually different from PR #21

- **Two independently started JUCE Windows Audio devices** (separate capture `AudioDeviceManager` and render manager) replace the earlier single joined I/O callback in Smart mode. The producer capture callback deposits raw audio in preallocated SPSC FIFO; the render callback clocks the VST3 mixer through bounded polyphase FIR ASRC. There is **no extra user thread per channel**.
- Only the Windows Audio shared backend is eligible for the dual-stream route; **ASIO and exclusive** retain their existing direct fast path (no added FIFO, no additional SRC).
- **AUTO** is the default: tries split capture/render for two different selected Windows Audio endpoint names. Failure to open either endpoint is caught; stops capture, restores the original full-duplex JUCE setup, and records a diagnostic. Distinct names are only a conservative *candidate signal*, **not proof that two hardware clocks differ**.
- Profile menu in the native-only SIGNAL CHECK: AUTO (20 ms FIFO fill), STABLE (40 ms), LOW LATENCY (12 ms), DIRECT (no bridge). These are provisional **additional FIFO targets**, not total end-to-end latency; output device and wireless transport add their own latency. The selected profile persists locally.
- One-sided OUTPUT ONLY/CAPTURE ONLY tests remain accessible: Smart stream stops before diagnostic routing changes; after NORMAL the selected Smart profile is attempted again. Editing audio device configuration reverts to the existing supported device selector; temporary split or diagnostic setups **never overwrite the saved device XML**.
- A control-thread watchdog detects capture callback stoppage or >3 seconds with no capture callback; this fails over once to direct mode. It does not attempt repeated restart storms, does not restart on the audio thread, and preserves the old route on failed restoration.
- Existing native **COPY FULL REPORT** includes routing mode, capture and render rates, periods, FIFO fill, ratio correction ppm, host FIFO overrun/underflow/priming counts, capture backend xrun provenance, callback timing and timestamped markers. This does **not** imply render hardware underrun telemetry is available through generic JUCE.

## Realtime invariants

Audio callback is **always** either the old direct callback, or a render callback pulling from a prepared SPSC FIFO. Independent capture callback only does bounded copying + relaxed atomic telemetry. Device teardown/initialization, plugin preparation, diagnostics writer, Clipboard and WebView are control-thread operations. FIFO preparation happens after endpoints have been negotiated and before the callbacks are attached. A route transition mutes the output while detaching callbacks and restoring the device.

Cross-clock drift is corrected by the precomputed 48-tap/1024-phase FIR and bounded PI loop; 44.1→48, 48→44.1, +100/+300/−300 ppm deterministic CTests remain required. An additional 30 virtual-minute 8kHz test includes −300 ppm drift and short capture scheduling stalls. Do not infer CPU headroom for all processors/sample rates from this short test alone.

## Remaining non-negotiable P0 acceptance

1. Windows MSVC x64 Release compile, whole CTest suite, native/JS contract and Chromium smoke green on **exact commit**.
2. Realtime capture/render drop/race stability under real WASAPI. Neither JUCE backend output-underrun nor device hardware timestamps are currently exposed; **hardware render starvation remains unavailable**, not zero.
3. Device stop/unplug/replug, output sample-rate renegotiation, shared-period contention, 44.1 and 48 kHz + virtual cable / Bluetooth / wired interface all need physical FAT. Unknown clocks can still be unsupported; never claim zero glitches on every driver.
4. Proof-quality SRC tests (multi-tone/sweep, stop-band alias, impulse delay, CPU, 30-minute soak) and end-to-end sub-10ms targets remain **device-dependent**. 12/20/40 ms target FIFO profiles cannot honestly be described as universal ultra-low latency.
5. Third-party VST3 callback safety remains a separate P2.5.2 scope. This P0 update changes I/O, not add/remove graph APIs.

## User acceptance workflow (ONE campaign)

The user should not be forced to manually test after every code step. When actual Windows CI is green and a complete P0 candidate is packaged, test both 44.1 and 48 kHz across wired and reported virtual/BT endpoints. Listen at low volume for 0-VST3 dry / split / output-only, mark crackle, and click **COPY FULL REPORT** once to paste in the engineering conversation. Report backend names/modes, selected profiles, FIFO counters and any captured onset times. Only after measured real-device results should P0 hardware issue #15 be closed.

Primary references: Microsoft WASAPI IAudioClient3, IAudioCaptureClient GetBuffer flags (DATA_DISCONTINUITY), JUCE 8.0.15 AudioDeviceManager / AudioIODeviceCallback. P0 issue: https://github.com/masarray/arsonmix/issues/15
2 changes: 2 additions & 0 deletions docs/P0_SMART_AUDIO_DIAGNOSTIC_AND_BRIDGE.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# P0 Smart Audio — native diagnostic + prepared clock bridge milestone

> **Historical P0 core milestone (PR #21).** Live dual-stream integration is now documented in [P0_LIVE_SPLIT_AUDIO_ENGINE.md](P0_LIVE_SPLIT_AUDIO_ENGINE.md). Statements below that the bridge is not connected describe the historical PR #21 state, not the current branch.

**Date:** 2026-10-25
**Scope:** P0-00 one-click field support, P0-01 clock-domain core/feasibility, P0-02 standalone polyphase SRC simulation
**Status:** experimental infrastructure; **the JUCE audio capture/render adapter is still a joined callback. Clock bridge is not connected to live physical audio.**
Expand Down
4 changes: 2 additions & 2 deletions engine/device/AdaptiveClockBridge.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ namespace armix::device
// The render clock owns the output timeline; source clock can be independent.
// Prepare/reset are CONTROL-THREAD operations with both streams STOPPED.
// push()/pull() never allocate, lock, log, wait or call JUCE.
// Not yet wired to JUCE joined WASAPI callback: true independent device
// adapter is required to make this useful on unrelated physical clocks.
// Wired only through SplitDuplexAdapter: a separate capture manager runs its
// own callback. Direct JUCE full-duplex/ASIO never calls this SRC.
class AdaptiveClockBridge final
{
public:
Expand Down
Loading
Loading