fix(plip): mute earpiece during capture

This commit is contained in:
clement
2026-06-16 19:18:45 +02:00
parent d71453d32e
commit 8dffe14972
+10 -2
View File
@@ -311,11 +311,19 @@ static void conv_task(void *arg)
vTaskDelay(pdMS_TO_TICKS(50));
}
if (!s_offhook) break;
vTaskDelay(pdMS_TO_TICKS(100)); /* line settle after playback (was 200) */
vTaskDelay(pdMS_TO_TICKS(200)); /* let the I2S DMA tail drain */
/* Capture player utterance — nothing is playing now. */
/* Kill the earpiece amp during capture: at full volume + 24 dB
* mic gain the playback couples into the handset mic at ~50 %
* FS and swamps the caller's voice (capture transcribed empty).
* PA off = no echo path; restored before the reply plays. */
audio_pa_set(false);
vTaskDelay(pdMS_TO_TICKS(60)); /* PA mute settle */
/* Capture caller utterance — earpiece muted, nothing plays. */
int n = audio_capture_wav(cap_buf, cap_max,
cap_ms, CAPTURE_SILENCE_MS);
audio_pa_set(true); /* restore for filler/reply */
if (!s_offhook) break; /* hung up during capture */
if (n <= 44) {