Track chirplet audio sync state

This commit is contained in:
Meta Vens 2026-05-22 12:46:51 +01:00
commit 1cf46ef97b
12 changed files with 150 additions and 14 deletions

View file

@ -78,6 +78,13 @@ estimation: loopback carries what was emitted, each mic carries what survived
speaker, air, room, and capsule, and the ratio over repeated chirplet phrases
becomes gain/phase correction evidence.
`MimirAudioSynchronizationStateTracker` turns per-phrase observations into
state. It confidence-gates reports, smooths fractional delay per source, and
estimates delay slope as sampling-rate offset in ppm. This is the control input
for the coming actuator. The state can survive a brief weak report, but it is
not a license to run blind: loopback must keep receiving the emitted phrase or
fresh reports will stop.
## Chirplet Calibration Model
```mermaid
@ -89,9 +96,10 @@ flowchart TD
D --> F["mic rolling buffers"]
E --> G["matched chirplet traces"]
F --> G
G --> H["delay + SRO estimates"]
G --> H["delay observations"]
H --> L["smoothed sync state + SRO"]
G --> I["per-band response estimates"]
H --> J["fractional delay / resampler actuator"]
L --> J["fractional delay / resampler actuator"]
I --> K["frequency response normalization"]
```

View file

@ -51,6 +51,9 @@ a named invariant that the native runtime cannot protect yet.
- `MimirSynchronizationHub.BuildAlignedAudioFrame` exposes the first
provisional aligned mono frame for loopback-referenced audio channels that
clear the confidence gate.
- `MimirAudioSynchronizationStateTracker` owns the first smoothed per-source
sync state: latest fractional delay, smoothed delay, confidence, per-band
response evidence, and delay-slope/SRO estimate in ppm.
- `MimirRuntime` emits short calibration chirplets through Aquarium audio so the
loopback and acoustic mic buffers carry a shared timing witness.
- `MimirVideoFrameDescriptor` for dimensions, pixel format, stride, device
@ -86,10 +89,10 @@ a named invariant that the native runtime cannot protect yet.
frame cadence in the rolling buffers.
3. Replace the WASAPI frame-event diagnostic bridge with native audio capture
workers for local mic, loopback, and network audio feeds.
4. Add the synchronization actuator: smooth delay/SRO estimates, then drive a
variable-rate resampler and fractional delay line per non-reference stream.
The current aligned frame is integer-delay only and should not pretend to be
the final DSP path.
4. Add the synchronization actuator: drive a variable-rate resampler and
fractional delay line per non-reference stream from the smoothed
`MimirAudioSynchronizationState`. The current aligned frame is integer-delay
only and should not pretend to be the final DSP path.
5. Bind Aquarium UI to the synchronization hub so buffer depth, stream cadence,
source timestamps, and output settings are visible and adjustable.
6. Move GPU feature extraction, fusion, material fitting, render budgeting, and