Skip to content

feat(diag): --debug ASIO routing diagnostics in static bundle#852

Merged
byrongamatos merged 5 commits into
mainfrom
diag/asio-routing-debug
Jul 10, 2026
Merged

feat(diag): --debug ASIO routing diagnostics in static bundle#852
byrongamatos merged 5 commits into
mainfrom
diag/asio-routing-debug

Conversation

@OmikronApex

@OmikronApex OmikronApex commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Why

Testers report song/game audio on the default WASAPI device while the guitar rides the selected ASIO output. The routing-watcher / renderer-bus-feeder logs are change-gated and terse; these verbose lines make tester logs decisive.

(feat/renderer-bus-phase2 is already in main — after merging origin/main this PR is diagnostics-only.)

What

All gated on window.feedBackDesktop.audio.debugEnabled() (desktop --debug; see companion desktop PR got-feedBack/feedBack-desktop#95). Inert in the Docker sphere and normal desktop runs.

  • [asio-diag] getCurrentDevice= — full device object on every outputType change; catches an ASIO driver reporting a type name other than exact 'ASIO' (the unconfirmed half of the exclusive predicate)
  • [asio-diag] renderer-bus: — feeder decision vector (running / exclusive / stems / juceMode / elementSong / want / mode), change-gated
  • [asio-diag] setSink: — every null-sink/default sink flip with context state + rate

Companion

got-feedBack/feedBack-desktop#95 (debug:isEnabled IPC + preload audio.debugEnabled()).

Verification

26/26 tests pass (renderer_bus_feeder.test.js + juce_engine_reroute.test.js — the feeder tests brace-parse the edited IIFE, so structure breakage would fail them).

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Diagnostics
    • Added optional verbose diagnostics for desktop audio routing and renderer-bus decisions.
    • Diagnostic logs now include detected output changes, selected audio sinks, and relevant routing decisions.
    • Logging is gated and change-aware to reduce unnecessary repeated messages.

OmikronApex and others added 4 commits July 9, 2026 19:33
Song playback runs through the renderer, which WASAPI-exclusive (and
ASIO) output silences. Route single-mix feedpaks (stem-less
original_audio packs AND single-stem packs) onto the engine's backing
transport when the output device type is exclusive-style, and migrate
back to HTML5 when it isn't. Extends /api/audio-local-path to resolve
/api/sloppak/.../file/... URLs via the same containment guards as
serve_sloppak_file. Multi-stem packs stay on the WebAudio path
(Phase 2). Includes [feedpak-route] transition-gated diagnostics
logging.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…e output (Phase 2)

Under exclusive-style output the native backing transport (Phase 1, #824)
carries loose /audio/ songs and feedpak full-mixes, but not the stems
plugin's multi-stem WebAudio graph or tracks JUCE rejected. The feeder taps
the renderer-side master with an AudioWorklet, re-points the owning
AudioContext at a null sink so it keeps rendering without a device, and
pushes ~10 ms chunks over IPC into the desktop engine's renderer bus
(feedBack-desktop#90 follow-up). Inert in the Docker sphere and in shared
mode. Validated by the fix12 tester spike: null-sink rendering works,
clocks hold, no overflow.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Gated on window.feedBackDesktop.audio.debugEnabled() (desktop --debug);
inert in the Docker sphere and normal desktop runs.

- [asio-diag] getCurrentDevice= full device object on outputType change
  (catches ASIO drivers reporting a non-'ASIO' type name)
- [asio-diag] renderer-bus: full feeder decision vector, change-gated
  (running/exclusive/stems/juceMode/elementSong/want/mode)
- [asio-diag] setSink: every sink flip with ctx state + rate

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

Adds a shared debug gate for audio routing diagnostics, logs JUCE device payloads on output-type changes, logs renderer sink flips, and records changed renderer-bus decision vectors to suppress duplicate diagnostics.

Changes

Audio routing diagnostics

Layer / File(s) Summary
JUCE diagnostic gate and device logging
static/app.js
Initializes the shared asio-diag flag, exposes window._asioDiagEnabled(), and logs the full JUCE device payload when exclusive-output type changes.
Renderer-bus decision diagnostics
static/app.js
Logs renderer sink transitions and change-gated decision vectors using the shared debug state and window._lastRendererBusDecision.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the debug ASIO routing diagnostics added to the static bundle.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch diag/asio-routing-debug

Comment @coderabbitai help to get the list of available commands.

@OmikronApex
OmikronApex changed the base branch from feat/renderer-bus-phase2 to main July 10, 2026 22:14
main already contains the renderer-bus Phase 2 feeder; conflicts were
the [asio-diag] insertions vs identical upstream context — kept ours.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.

2 participants