Add audio synchronization mode policy

This commit is contained in:
Meta Vens 2026-05-22 18:49:01 +01:00
commit 7e4348bfe7
12 changed files with 205 additions and 18 deletions

View file

@ -52,3 +52,4 @@
{"ts": "2026-05-22T17:34:45+01:00", "type": "verification", "status": "ok", "note": "Aquarium WASAPI resampler used int multiplication for source.Length * targetSampleRate; a 60s 48k chirplet batch overflowed and queued one 44.1k output frame. Switching to double-length arithmetic restored 2,646,000 output frames and audible chirplets."}
{"ts": "2026-05-22T18:08:51+01:00", "type": "verification", "status": "partial", "note": "Release live chirplet decoder test: Scarlett loopback->Scarlett mic produced repeated runtime reports in ~230-335 ms per 2s analysis window, typically 3-5 matched timeline events. Pair tests also produced reports for Kiyo mic. Kiyo Pro and both USB Camera mics showed chirplet energy but failed to form valid triplet anchors in this pass. Six-audio-source fan-out exposed process-probe buffer continuity/overlap failures, with many candidates rejected as insufficient-window."}
{"ts": "2026-05-22T18:34:16+01:00", "type": "research", "status": "ok", "note": "Archived chirplet decoder research under research/chirplet-sync-decoder. Distilled conclusion: current BuildChirpletEnergyTrace is dense sliding matched filtering; for Mimir's controlled sync beacon, redesign symbol codebook for dechirp+FFT/Goertzel classification so code constraints shape the receiver before expensive scoring."}
{"ts": "2026-05-22T18:47:44+01:00", "type": "implementation", "status": "ok", "note": "Added runtime-owned audio sync mode selection for chirp-only, no-chirp, and hybrid. Config/env now expose MIMIR_AUDIO_SYNC_MODE plus audioSync.mode/referenceSourceId/calibrationGain; no-chirp disables active calibration and reports passive sync as not wired yet, while hybrid currently uses the active pilot until passive confidence gating and shaped watermark emission are implemented. dotnet build and chirplet self-test passed."}

View file

@ -93,7 +93,11 @@ accepted_design:
ppm. `MimirRuntime` now runs this analysis online as a bounded rotating
service on a fixed cadence, while UI and telemetry read cached reports/states
instead of invoking analysis. `MIMIR_SYNC_TELEMETRY_SECONDS` prints live
buffer/report/state telemetry.
buffer/report/state telemetry. `MimirAudioSynchronizationSettings.Mode`
now owns the active evidence policy: `chirp-only` emits the calibration
witness, `no-chirp` stays silent until passive program-audio sync exists,
and `hybrid` currently uses the active pilot until the passive confidence
gate and shaped watermark are built.
- `IMimirVideoCaptureDriver` and `MimirVideoCaptureDriverSource` are the live
seam for Leap, Media Foundation, DirectShow, libusb, LeapC, or shared
texture capture.