From 1b9210251f56da710f7ae34fd733402238ebfad1 Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Sun, 24 May 2026 23:10:25 +0100 Subject: [PATCH] Record second physical packet run --- .../bioacoustic-contestants-2026-05-24.md | 50 +++++++++++++++++++ src/Mimir.BufferSmoke/Program.cs | 14 ++++-- state/evidence.jsonl | 1 + 3 files changed, 61 insertions(+), 4 deletions(-) diff --git a/research/bioacoustic-contestants-2026-05-24.md b/research/bioacoustic-contestants-2026-05-24.md index 2d4bb33..284487b 100644 --- a/research/bioacoustic-contestants-2026-05-24.md +++ b/research/bioacoustic-contestants-2026-05-24.md @@ -344,6 +344,56 @@ packet-local decoding takes over. The important architectural result still stands: acquisition and tracking are separate states. Once the clock offset is known, the streaming packet hot loop is tiny and exact. +### Second Physical ASIO Packet Receipt + +After placing both microphones, the same 192 kHz packet run was repeated: + +```powershell +dotnet run --no-build --project .\src\Mimir.BufferSmoke\Mimir.BufferSmoke.csproj -- --render-contestant-f32 --song canary-packet-trill --output artifacts/asio/canary-packet-192k-f32.raw --sample-rate 192000 --seconds 4 +.\native\probes\asio_audio_cadence\build\Release\asio_audio_cadence.exe --set-sample-rate 192000 --play-f32-mono artifacts\asio\canary-packet-192k-f32.raw --record-f32-interleaved artifacts\asio\scarlett-canary-packet-192k-rerun-f32.raw --play-gain 1.0 +``` + +Capture: + +```text +sampleRate=192000 frames=765952 channels=4 +input[0]="Input 1" input[1]="Input 2" input[2]="Loopback 1" input[3]="Loopback 2" +source rms=0.00694 peak=0.02913 +ch0 rms=0.02612 peak=0.32488 +ch1 rms=0.01530 peak=0.21927 +ch2/ch3 rms=0.00692 peak=0.02913 +correlation lags: ch0=2519, ch1=2122, ch2=1623, ch3=1623 samples +``` + +With the loopback acquisition offset (`1623` samples), loopback remained +perfect and the two mic channels showed partial lock: + +```text +ch0 events=14/37 payload=0.162 timing=0.745 delayUs=8500.880 +ch1 events=23/37 payload=0.135 timing=0.706 delayUs=8445.016 +ch2 events=37/37 payload=1.000 timing=1.000 delayUs=8453.125 +ch3 events=37/37 payload=1.000 timing=1.000 delayUs=8453.125 +``` + +With per-channel acquisition offsets, the co-streamer shotgun mic on channel 1 +locked: + +```text +ch1 offset=2122 events=37/37 payload=1.000 timing=0.828 delayUs=11166.397 maeSamples=9.952719 +``` + +The cardioid/near mic on channel 0 improved but remained unreliable: + +```text +ch0 offset=2519 events=26/37 payload=0.595 timing=0.726 delayUs=13075.222 maeSamples=18.120421 +``` + +The channel correlations were negative for both mic inputs, so the streaming +packet scorer now treats polarity as a nuisance variable in the packet-local +path. That is a real-world acoustic invariant, not a broad decoder patch: mic, +preamp, wiring, and room reflections can flip the sign of a narrow waveform +template without changing the packet identity. + ### Obsolete Schedule-Entangled Receipt The best current receipt is: diff --git a/src/Mimir.BufferSmoke/Program.cs b/src/Mimir.BufferSmoke/Program.cs index 9186bf5..da242e3 100644 --- a/src/Mimir.BufferSmoke/Program.cs +++ b/src/Mimir.BufferSmoke/Program.cs @@ -2333,7 +2333,7 @@ static IReadOnlyList DecodeStreamingPacketRazorWords( var template = contestant.RenderEventMonoFloat((ulong)eventIndex, sampleRate, payload); for (var offset = start; offset <= end; offset += 2) { - var score = ScoreContestantOffset(samples, template, offset, motifSamples); + var score = ScoreStreamingPacketOffset(samples, template, offset, motifSamples); if (score > bestScore) { bestScore = score; @@ -2376,15 +2376,21 @@ static double RefineStreamingOffset( } var template = contestant.RenderEventMonoFloat(eventIndex, sampleRate, payload); - var left = ScoreContestantOffset(samples, template, bestOffset - 1, motifSamples); - var center = ScoreContestantOffset(samples, template, bestOffset, motifSamples); - var right = ScoreContestantOffset(samples, template, bestOffset + 1, motifSamples); + var left = ScoreStreamingPacketOffset(samples, template, bestOffset - 1, motifSamples); + var center = ScoreStreamingPacketOffset(samples, template, bestOffset, motifSamples); + var right = ScoreStreamingPacketOffset(samples, template, bestOffset + 1, motifSamples); var denominator = left - 2.0 * center + right; return Math.Abs(denominator) <= 1.0e-12 ? bestOffset : bestOffset + Math.Clamp(0.5 * (left - right) / denominator, -0.5, 0.5); } +static double ScoreStreamingPacketOffset(float[] samples, float[] template, int offset, int motifSamples) +{ + var score = ScoreContestantOffset(samples, template, offset, motifSamples); + return double.IsFinite(score) ? Math.Abs(score) : score; +} + static double ScoreContestantOffset(float[] samples, float[] template, int offset, int motifSamples) { if (offset < 0 || offset + motifSamples > samples.Length) diff --git a/state/evidence.jsonl b/state/evidence.jsonl index 75d93c0..0d9bbb6 100644 --- a/state/evidence.jsonl +++ b/state/evidence.jsonl @@ -92,3 +92,4 @@ {"ts": "2026-05-24T22:46:18+01:00", "type": "experiment", "status": "ok", "note": "Built packet-razor-streaming-faust: schedule-owned local packet windows with four payload hypotheses and tiny timing refinement, plus Faust front-end lowering target. Arena result on canary-packet-trill: best language score 1121.012 on logmel-blur-light, 62.6x realtime, 6/6 events, 100% payload. Lesson: wide MFCC search is acquisition/reference; hot loop should lock clock then inspect scheduled local packet windows."} {"ts": "2026-05-24T22:47:10+01:00", "type": "verification", "status": "ok", "note": "Verified faust/mimir_packet_razor_frontend.dsp with Faust 2.85.5 C++ generation. The DSP front-end exposes 16 log-spaced resonant band-energy outputs plus 16 positive-flux outputs for the packet razor streaming receiver lowering target."} {"ts": "2026-05-24T23:04:57+01:00", "type": "experiment", "status": "partial", "note": "First real-world packet razor ASIO test: rendered canary-packet-trill at 192 kHz, played through Focusrite ASIO, captured four inputs. Corrected probe needed --set-sample-rate 192000; first run stayed at 44.1 kHz. Loopback channels 2/3 correlated at +1623 samples and decoded 37/37 events with payload=1.000, timing=1.000, delay=8453.125 us. Acoustic channel 1 decoded only 1/37 and channel 0 none, so room/mic path still needs acquisition/level/channel work."} +{"ts": "2026-05-24T23:10:02+01:00", "type": "experiment", "status": "partial", "note": "Second physical 192 kHz packet run with cardioid and co-streamer shotgun: loopback channels 2/3 still decode 37/37 payload=1.000 at offset 1623 samples. Shotgun channel 1 locks with per-channel offset 2122 samples: 37/37 payload=1.000, timing=0.828, delay=11166.397 us. Cardioid channel 0 partially decodes at offset 2519: 26/37 payload=0.595. Added polarity-invariant scoring for the streaming packet-local path because mic correlations were inverted."}