Add structured chirplet calibration phrase

This commit is contained in:
Meta Vens 2026-05-22 12:40:30 +01:00
commit bbb052a8ba
12 changed files with 392 additions and 136 deletions

View file

@ -33,3 +33,5 @@
{"ts":"2026-05-22T11:39:31+01:00","type":"verification","status":"partial","note":"Chirplet-backed sync smoke used Scarlett speaker loopback as timing authority with 9-16 kHz calibration chirps playing, resampled 48 kHz mics into the 44.1 kHz loopback timeline, and built an aligned audio frame with 4 channels: loopback, mic-focusrite-local delaySamples=-768 confidence=0.160, mic-kiyo delaySamples=-256 confidence=0.119, and mic-kiyo-pro delaySamples=-1664 confidence=0.118. Both PS3 Eye audio buffers were empty in this run while both PS3 Eye camera buffers were live, so PS3 Eye audio remains enumeration/runtime-fragile rather than solved."}
{"ts":"2026-05-22T11:48:37+01:00","type":"verification","status":"ok","note":"After replugging the PS3 Eyes, full Mimir.BufferSmoke with --require-samples proved both PS3 Eye audio buffers were live again: mic-usb-camera-0 count=324 and mic-usb-camera-1 count=210, each reporting 2ch 48000Hz Float32 480-frame WASAPI blocks. Both PS3 Eye camera buffers were live at the same time. Loopback-referenced sync reports included mic-usb-camera-0 delaySamples=2368 confidence=0.095 and mic-usb-camera-1 delaySamples=-2304 confidence=0.152; only mic-usb-camera-1 cleared the current aligned-frame confidence gate in that run."}
{"ts":"2026-05-22T11:58:15+01:00","type":"verification","status":"ok","note":"Delay signs were suspect because MimirAudioSynchronizationAnalyzer compared latest sample tails from buffers with different edge timestamps. The analyzer now estimates each pair at a shared timestamp edge and BuildAlignedAudioFrame chooses an output edge all positive-late channels can supply. Controlled 9-16 kHz chirplet smoke after the fix reported positive loopback-relative PS3 Eye delay: mic-usb-camera-1 delaySamples=704, delayMs=15.964, confidence=0.166, and the aligned frame contained loopback plus mic-usb-camera-1."}
{"ts":"2026-05-22T12:38:53+01:00","type":"implementation","status":"ok","note":"Documented the chirplet calibration model and started the structured implementation. MimirChirpletCalibrationPhrase now owns a harmonic-ish phrase around 8 kHz, 10 kHz, 12 kHz, and 16 kHz, PCM rendering for Aquarium emission, matched chirplet timing traces, and per-band matched-energy response hooks. MimirRuntime emits that shared phrase instead of a separate hard-coded sweep, and MimirAudioSynchronizationAnalyzer uses the same phrase for loopback-referenced delay analysis with 16-sample hops and parabolic fractional peak interpolation. BufferSmoke output now includes fractionalDelaySamples and per-band energy."}
{"ts":"2026-05-22T12:42:00+01:00","type":"verification","status":"ok","note":"Built Mimir.slnx with zero warnings after structured chirplet changes. A 4-second Mimir.BufferSmoke run against the full probe config printed fractional delays and band energy, and built a 5-channel aligned frame: loopback plus mic-focusrite-local fractionalDelaySamples=2239.233 confidence=0.105, mic-kiyo fractionalDelaySamples=1859.505 confidence=0.496, mic-usb-camera-0 fractionalDelaySamples=2338.772 confidence=0.395, and mic-usb-camera-1 fractionalDelaySamples=1934.795 confidence=0.183. This run verifies report plumbing; the final response normalizer and fractional-delay actuator are still future work."}

View file

@ -65,12 +65,15 @@ accepted_design:
runtime rolling buffers; it does not carry pixels/audio payloads or own the
final local-device hot path.
- The diagnostic audio path can optionally carry base64 float sample payloads
for sync smoke tests. `MimirAudioSynchronizationAnalyzer` now treats
for sync smoke tests. `MimirChirpletCalibrationPhrase` owns the structured
harmonic-ish calibration phrase, PCM rendering, matched timing kernel, and
per-band response kernels. `MimirAudioSynchronizationAnalyzer` now treats
`loopback-scarlett-speakers` as timing authority, resamples candidate mic
windows into that timeline, projects loopback and mic windows through the
emitted chirplet shape, and estimates current delay from chirplet-energy
emitted chirplet phrase, and estimates current delay from chirplet-energy
traces at a shared timestamp edge. Positive delay means the candidate mic is
late relative to loopback. `MimirSynchronizationHub.BuildAlignedAudioFrame`
late relative to loopback. Reports include rounded delay, fractional delay,
confidence, and per-band matched energy. `MimirSynchronizationHub.BuildAlignedAudioFrame`
exposes the first provisional loopback-referenced aligned mono frame for
channels that clear the confidence gate.
- `IMimirVideoCaptureDriver` and `MimirVideoCaptureDriverSource` are the live