Skip to content

P0 live Windows dual-clock capture/render: adaptive routing, automatic failback & field diagnostics - #25

Closed
masarray wants to merge 25 commits into
mainfrom
feature/p0-live-dual-stream-smart-recovery
Closed

masarray wants to merge 25 commits into
mainfrom
feature/p0-live-dual-stream-smart-recovery

Conversation

@masarray

Copy link
Copy Markdown
Owner

P0 live engine integration

Deliver actual independent JUCE Windows Audio capture and render devices. Existing paired JUCE full-duplex callback cannot provide true dual-clock correction; a distinct capture manager now pushes to bounded SPSC, while the output manager is render master and pulls via 48-tap prepared FIR / bounded PI drift correction.

Safety & throughput

  • Capture callback is separate; no per-channel worker, COM call or allocation in host callback. Buffer prepared between device stop and callback attachment.
  • ASIO and Windows Audio Exclusive remain direct with zero added SRC. AUTO only attempts shared Windows Audio for distinct configured endpoints and falls back to original route if anything fails.
  • Native profile selector in existing SIGNAL CHECK: AUTO 20ms, STABLE 40ms, LOW LATENCY 12ms, DIRECT without ASRC. These are FIFO-only targets; output, driver and BT latency still apply.
  • Watchdog detects capture callback shutdown/scheduling >3s and fails over once on the message thread. Do not thrash reconnect loops. Restore original user device; never save temporary render-only setup to audio-devices.xml.
  • Supports P0-00 one-endpoint test before/after smart route and one-click COPY FULL REPORT including capture rates, FIFO fill/overflows, correction ppm, and driver-provenance xrun semantics.
  • Existing approved GUI mixer app.js/styles.css/standalone UNCHANGED.

Tests & limitations

  • Extended deterministic 30-virtual-minute -300 ppm clock test with 10ms capture scheduling gaps, in addition to ±100/300 and 44.1↔48 tests, histogram, preset and realtime graph tests.
  • Source-level test contract proves two physical JUCE managers and safety order; MSVC Release/CTest and Chromium must be GREEN before merge.
  • Real Windows Audio, Bluetooth and third-party driver acceptance not executable on GitHub cloud Windows VMs. No universal latency or crackle-free guarantee until one consolidated hardware FAT.
  • Capture discontinuity from JUCE backend != confirmed hardware render underrun. Adaptive resampler, FIFO overflow and scheduling metrics are explicitly source labeled.

Runbook: docs/P0_LIVE_SPLIT_AUDIO_ENGINE.md
Issue: #15

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 25, 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-25T13:04:11.797957Z 9c2aec9 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: 9c2aec9dce

ℹ️ 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/LiveAudioEngine.h Resolved
Comment thread src/SplitDuplexAdapter.h Resolved
Comment thread tests/adaptive_clock_bridge_test.cpp Resolved

Copy link
Copy Markdown
Owner Author

RECONCILIATION 2026-10-26 — Converted to DRAFT, not merged. This 2026-10-25 dual-clock integration candidate diverges from latest main (8d5f974) and is superseded architecturally by merged #35 (real independent JUCE WASAPI capture/render with ASRC), plus #39/#40/#45/#50/#52/#55 recovery, identity, and ASIO route fences. Do NOT merge/cherry-pick whole branch over latest LiveAudioEngine. Preserve branch for provenance. Any unmet behavior must be isolated as a fresh main-based P0 test/PR with current CI and one consolidated hardware FAT tracked in #15. No physical no-crackle claim.

Copy link
Copy Markdown
Owner Author

Backlog reconciliation — archived as SUPERSEDED (NOT merged). Old independent dual-clock callback fork overlaps the existing optional secondary OUTPUT1/ASRC path and current one-primary-callback contract. Physical #15 is not resolved; revive only from a proved driver topology test.

Current PRD v5 / ARD v5. Active owners: native #266 / epic #192, UI #265, physical #15, Show #180 and owner GUI #176. This PR's historical commits remain accessible, and no head is blindly merged into modern engine.

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