Audio: operator re-measure + format override (host<->hook op channel)

Add a per-stream op channel in AudioRingHeader (op_seq + op_* fields, version
2): the host posts re-measure / override commands, the hook applies them and
re-publishes (bumping format_generation), and the host rebuilds its render
client live on the change. The Audio panel (under Debug details) gains a
"Re-measure rate" button and a rate/channels/bit-depth/format override -- for
when detection is wrong or the channels/bit-depth were unrecoverable.

Also add a debug-only IPC test harness (-DCOOP_TEST_HARNESS, off by default,
absent from the shipped host): a file-based command channel that drives the
host's real UI code paths (inject / audio / re-measure / override / screenshot
/ status) for scripted validation, instead of unreliable synthetic mouse input.
Used to validate live: late-attach to coop_tone@44100 -> measured 44100,
promoted to hooked; override -> 2ch state, re-measure -> reconverge.

Trim the README roadmap to what's left; document the harness + rate_estimator_test.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-06-22 01:46:59 +02:00
parent c24bfdd64f
commit 90f40ae479
13 changed files with 607 additions and 111 deletions

View File

@@ -19,10 +19,21 @@ add_executable(coop_host WIN32
src/capture/window_capture.cpp
src/capture/shared_texture.cpp
src/audio/audio_loopback.cpp
src/audio/process_loopback_capture.cpp)
src/audio/process_loopback_capture.cpp
src/test_harness.cpp)
target_include_directories(coop_host PRIVATE src)
# Debug-only IPC test harness: lets a script drive the real UI code paths (inject /
# audio / override / ...) and read state back, instead of simulating mouse input. OFF
# by default, so the shipped host never contains it (the source compiles to nothing
# without the macro). Enable with -DCOOP_TEST_HARNESS=ON for a debuggable build.
option(COOP_TEST_HARNESS "Build the host with the debug IPC test harness (dev only)" OFF)
if(COOP_TEST_HARNESS)
target_compile_definitions(coop_host PRIVATE COOP_TEST_HARNESS)
message(STATUS "Host test harness ENABLED (debug IPC driver)")
endif()
# Process-loopback capture (AUDIOCLIENT_ACTIVATION_TYPE_PROCESS_LOOPBACK) needs the
# Windows 10 20H1 (NTDDI_WIN10_CO) headers; raise the target SDK version for it.
target_compile_definitions(coop_host PRIVATE NTDDI_VERSION=0x0A00000B)