From f03156b65e0b03c08ea97635d8088ab926ae2e96 Mon Sep 17 00:00:00 2001 From: electron-rare Date: Mon, 15 Jun 2026 09:51:15 +0200 Subject: [PATCH] =?UTF-8?q?fix(plip):=20ES8388=20ADC=20input=20LIN2/RIN2?= =?UTF-8?q?=20=E2=80=94=20SLIC=20handset=20mic=20(voice=20captured,=20was?= =?UTF-8?q?=20reading=20floating=20LIN1)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plip_voice/main/es8388.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/plip_voice/main/es8388.c b/plip_voice/main/es8388.c index 623d8c7..37a2ebb 100644 --- a/plip_voice/main/es8388.c +++ b/plip_voice/main/es8388.c @@ -152,10 +152,10 @@ esp_err_t es8388_init(void) * - ADCCONTROL5 (0x0D) = 0x02: ADCFsMode SINGLE SPEED RATIO=256 (16kHz@MCLK 4.096MHz) * - ADCCONTROL8/9 (0x10/0x11) = 0x00: ADC digital volume 0dB */ if (i2c_write_reg(ES8388_ADC_CTL1, 0xBB) != ESP_OK) return ESP_FAIL; /* PGA +24dB L+R */ - /* ADCCONTROL2 (0x0A): LINSEL/RINSEL = 0x00 → LINPUT1/RINPUT1 (LINE IN header on A1S kit) - * 0x00 = LIN1/RIN1 differential (standard LINE IN jack where AG1171 SLIC audio is wired) - * 0x50 = LIN2/RIN2 single-ended (onboard mic path — no SLIC signal here) */ - if (i2c_write_reg(ES8388_ADC_CTL2, 0x00) != ESP_OK) return ESP_FAIL; /* LIN1/RIN1 differential (LINE IN / AG1171 SLIC) */ + /* ADCCONTROL2 (0x0A): input select. The K50835F SLIC handset transmit audio is + * wired to LIN2/RIN2 on this bench — PROVEN: speech captured (ACrms 196, crest 10.3) + * on 0x50, vs DC-only floating offset on 0x00 (LIN1). */ + if (i2c_write_reg(ES8388_ADC_CTL2, 0x50) != ESP_OK) return ESP_FAIL; /* LIN2/RIN2 — SLIC handset mic */ if (i2c_write_reg(ES8388_ADC_CTL3, 0x02) != ESP_OK) return ESP_FAIL; /* DS filter sel */ if (i2c_write_reg(ES8388_ADC_CTL4, 0x0C) != ESP_OK) return ESP_FAIL; /* I2S 16-bit */ if (i2c_write_reg(ES8388_ADC_CTL5, 0x02) != ESP_OK) return ESP_FAIL; /* RATIO=256 */ -- 2.54.0