Skip to content

medialink: hands-free listening ignores the microphone's opening click - #364

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

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

Conversation

@bdbarnett

Copy link
Copy Markdown
Contributor

A hands-free Intercom took a turn of nothing back every time the peer finished talking. On a Waveshare ESP32-P4-WIFI6-Touch-LCD-4B talking hands-free to a computer that answered each turn, every answer was followed by a 1.1 s turn from the board with nothing in it; when the computer answered that turn too ("I didn't catch that"), the two sides kept trading empty turns until the run ended (seven in a row).

The cause is the microphone, not the speaker. Each time it opens, its first 20 ms frame peaks far over the room (720 to 16,406 against a room of about 200), whether a turn has just played or the board sat quiet for two seconds. audiodsp's speech detector marks the next 160 ms as speech, and with hold_ms that becomes a turn.

Intercom now throws away the first settle_ms (60 ms by default) each time hands-free listening opens the microphone, before the voice activity hears it. The guide's hands-free section says so.

On the board. The same run with the change: three spoken sentences each took one turn and got their answer, and no turn followed an answer (4 turns in 70 s, against 10 before). The one extra turn came at the start, when the microphone first opened; that is a separate thing, below. 502 frames played with 0 underruns, 173 ms late (max 257).

Test. test_the_microphones_opening_click_is_not_speech gives a warmed-up level detector a microphone whose first frame is a click. It fails on main (the click takes a turn) and passes with the change; with settle_ms=0 it takes the turn again.

Not fixed here: on this board, the first time the microphone opens after boot, the speech detector hears about 3.4 s of speech in a quiet room. A second open a moment later hears none. A hands-free example whose peer is already there takes one empty turn as it starts.

@bdbarnett
bdbarnett merged commit 5c520cb into main Oct 31, 2026
9 checks passed
@bdbarnett
bdbarnett deleted the fix/handsfree-mic-settle branch October 31, 2026 07:25
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.

1 participant