Skip to content

medialink: voice activity passes over a starting microphone's digital silence - #366

Merged
bdbarnett merged 1 commit into
mainfrom
fix/mic-boot-settle
Oct 31, 2026
Merged

bdbarnett merged 1 commit into
mainfrom
fix/mic-boot-settle

Conversation

@bdbarnett

Copy link
Copy Markdown
Contributor

Fixes #365.

The first time a P4 board's ES7210 opens after power-up, the first 100 to 280 ms of the stream is digital silence: a run of one repeated sample, then exact zeros, before the room comes through. Both detectors learn the room's quiet from the first frames they hear (audiofeatures primes its floor on the mean of its first 16 slices), so the floor started far below the room, and the room's own hiss read as speech until the floor climbed back, about 3.4 s. Later opens have no silent stretch, which is why only the first one did it.

VoiceActivity.feed() now passes over a frame in which every sample is the same (no real microphone gives 20 ms of that) without feeding it to the detector.

Measured on the P4 panel after a fresh boot, from the first open's recording replayed through VoiceActivity: frames 15 to 185 voiced before, none after. A 25 s recording with no silent stretch gives identical flags old and new. With the peer connected, the old code took a 4.5 s empty turn at startup; the new code took none.

The #364 test's click was a frame of one repeated sample, which this now passes over as silence; it is an alternating click now, and still needs settle_ms.

@bdbarnett
bdbarnett merged commit 8e07de6 into main Oct 31, 2026
9 checks passed
@bdbarnett
bdbarnett deleted the fix/mic-boot-settle branch October 31, 2026 08:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Hands-free: the first microphone open after boot reads as 3 s of speech on the P4 panel

1 participant