7.6 KiB
7.6 KiB
Implementation Plan
Current Cut Line
Mimir is now a C# app/runtime plus native reservoir project. The live stream machine must be direct-driver and native-buffer first:
src/Mimir.Apphosts Aquarium Engine for windowing, rendering, and the D3D12 bridge.src/Mimir.Runtimeowns stream descriptors, source polling, direct push ingest, one rolling buffer per configured audio/video stream, and the synchronization hub Aquarium can inspect.- The default five-second window is an intentional latency/memory trade: use it to line up streams and extract the volumetric audio/video field before OBS sees program output.
native/reservoirowns the lower native rolling-buffer invariant for Aquarium/Faust integration.- PowerShell/FFmpeg/SRT remains a bridge utility for LAN OBS feeds. It is not the synchronized program authority.
The old script stack is gone. Do not add a compatibility edge unless it protects a named invariant that the native runtime cannot protect yet.
Implemented
- Mimir public identity, branding, and Face memory.
Mimir.slnxwithsrc/Mimir.Appandsrc/Mimir.Runtime.- Aquarium host bootstrapping from
Mimir.App. MimirSynchronizationHub,MimirRollingStreamBuffer, stream descriptors, andIMimirStreamSource.- Configurable five-second default rolling buffers for local and network audio and video streams.
MimirNativeIngestStreamSourcefor direct push ingest into runtime buffers.MimirProcessStreamSourcefor bridge/network command edges.MimirFrameEventProcessStreamSourcefor temporary JSON-line frame metadata from native probes into the same rolling buffers Aquarium inspects. One probe process can accept multiple emittedsourceIdvalues so it does not reopen the same camera set once per stream.src/Mimir.BufferSmokeloads the runtime config, polls the synchronization hub, and prints the actual rolling buffers. Use--require-sampleswhen an empty declared sensor buffer should fail the run. Use--chirplet-self-testto render the canonical timeline into memory and verify that the constrained decoder recovers sub-frame anchors without hardware.native/probes/wasapi_audio_cadencecaptures WASAPI mic or render-loopback block metadata and emitsaudio-blockJSON events for the diagnostic runtime adapter.MimirChirpletTimelineowns the structured birdsong-like calibration stream, PCM segment rendering, matched timing trace, and per-band response kernels. The default timeline is an order-3 de Bruijn symbol sequence over 32 time/frequency constellation symbols, so any three consecutive correctly detected symbols identify a timeline event inside the current operating horizon. Symbol identity is carried by start band, glide shape, duration, and following inter-chirp gap.MimirChirpletSymbolCodebookowns the 32 symbol definitions. Each symbol has a unique chirp shape, with inter-chirp rhythm as additional code evidence.MimirChirpletStreamDecoderis the first constrained chirplet-transform receiver. It owns a bounded PCM window, emits transform frames with multiple phase-invariant symbol candidates and per-candidate refined sample offsets, decodes code-valid triplet anchors through a local trellis that requires gap and clock coherence, and fits a per-source sample clock from those anchors.MimirAudioSynchronizationAnalyzerports the first live sync measurement: sample-bearing audio blocks are resampled into the Scarlett loopback timeline. The analyzer derives delay only from matched decoded triplet timeline anchors. A source without at least three matched anchors has no timing report for that window.MimirAudioSynchronizationStateTrackerowns the first smoothed per-source sync state: latest fractional delay, smoothed delay, confidence, per-band response evidence, and delay-slope/SRO estimate in ppm.MimirRuntimeupdates audio sync analysis online as a bounded rotating service and can emit live sync telemetry withMIMIR_SYNC_TELEMETRY_SECONDS. UI and telemetry read cached reports/states; they do not run synchronization analysis.MimirRuntimequeues chirplet timeline PCM through Aquarium audio when the active timing witness is allowed.MimirAudioSynchronizationSettings.Modeselectschirp-only,passive, orhybrid; passive disables active emission, and hybrid emits the active pilot only while passive confidence is below threshold.MimirPassiveAudioSynchronizationEstimatoris the first program-audio timing path. It estimates loopback-to-mic delay with PHAT-weighted cross-spectrum correlation so music can act as the default timing witness before any audible watermark is needed.MimirChirpBinTimelineis the active hybrid watermark path. It renders a fixed-slope chirp-bin codebook and decodes symbols with one dechirp plus fixed Goertzel bins, then feeds the same de Bruijn triplet timeline-anchor machine. Use--chirp-bin-self-testto prove this path without hardware.MimirVideoFrameDescriptorfor dimensions, pixel format, stride, device timestamp, and native/GPU handle metadata.IMimirVideoCaptureDriverandMimirVideoCaptureDriverSourceas the live driver-facing seam for Leap, Media Foundation, DirectShow, libusb, LeapC, or shared texture capture.native/reservoirwith one shared-edge rolling buffer, typed views, C ABI, source-id hashing, producer helpers, and typed audio/render payload descriptors.- Windows bridge scripts for sender discovery/start/stop and simple OBS Media Source ingest.
- Documentation for OBS receiver setup, native rebuild boundaries, the viable stream app, and the Mimir Face.
Temporary
- Audio and video may still traverse separate OBS/SRT endpoints during bridge testing so OBS can preserve independent controls.
- Process-backed stream sources are only acceptable for network bridge feeds or diagnostics. Six-camera local ingest belongs behind direct capture drivers.
- Frame-event process sources are diagnostic only. They prove source cadence and runtime plumbing without dragging stdout bytes into the pixel hot loop.
- Calibration artifacts may remain on disk as evidence, but live state must be in memory inside Mimir/Aquarium/native runtime surfaces.
Next
- Replace the frame-event diagnostic bridge with concrete direct capture drivers for Leap stereo IR first, then the other cameras.
- Feed those drivers into
MimirVideoCaptureDriverSourceand prove sustained frame cadence in the rolling buffers. - Replace the WASAPI frame-event diagnostic bridge with native audio capture workers for local mic, loopback, and network audio feeds.
- Add the synchronization actuator: drive a variable-rate resampler and
fractional delay line per non-reference stream from the smoothed
MimirAudioSynchronizationState. First, prove the constrained chirplet decoder through real loopback and microphone paths so every correctly heard triplet becomes a deterministic timeline anchor before the actuator moves samples. - Prove the chirp-bin hybrid fallback through real loopback and microphones with probe durations long enough to keep loopback and mic windows live.
- Bind Aquarium UI to the synchronization hub so buffer depth, stream cadence, source timestamps, and output settings are visible and adjustable.
- Move GPU feature extraction, fusion, material fitting, render budgeting, and Spout2 publication into Aquarium.
- Move mic alignment, room suppression, voice separation, spatialization, and stem generation into Faust/native DSP.
- Keep the OBS bridge witness ledger as evidence before expanding receiver machinery.