fix(plip): ES8388 ADC unmute (ADCCONTROL6=0x00) + full ADC power-up (ADCPOWER=0x00)
ADCCONTROL6 (reg 0x0E) reset default = 0x30 which has ADCSMUTE=1 (bit5) — ADC output muted by default. Writing 0x00 unmutes. Without this, ADCINSEL=0x50 (LIN2) is selected but the signal is suppressed at the ADC output stage → peak=0. ADCPOWER (reg 0x03) changed from 0x09 (intermediate Espressif open state) to 0x00 (full power-up: all power-down bits cleared). Value 0x09 = bits 0+3 set (ADCPD_L + MICBIAS_PD) — MICBIAS_PD in particular means the internal microphone bias is powered off, which can starve the SLIC line-in path. 0x00 is the correct end state for recording mode per Espressif esp8388_start(ES_MODULE_ADC) reference. sdkconfig.defaults: add CONFIG_PLIP_HOOK_GPIO=23 / CONFIG_PLIP_HOOK_ACTIVE_HIGH=y as explicit defaults so clean builds use the SLIC SHK pin without menuconfig.
This commit is contained in:
@@ -160,6 +160,7 @@ esp_err_t es8388_init(void)
|
||||
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 */
|
||||
if (i2c_write_reg(0x0E, 0x00) != ESP_OK) return ESP_FAIL; /* ADCCONTROL6: clear ADCSMUTE bit5 (reset default 0x30 = ADC output muted) */
|
||||
if (i2c_write_reg(ES8388_ADC_CTL8, 0x00) != ESP_OK) return ESP_FAIL; /* ADC vol L 0dB */
|
||||
if (i2c_write_reg(ES8388_ADC_CTL9, 0x00) != ESP_OK) return ESP_FAIL; /* ADC vol R 0dB */
|
||||
|
||||
@@ -202,9 +203,12 @@ esp_err_t es8388_init(void)
|
||||
/* 13. DAC power: power up DAC L+R. */
|
||||
if (i2c_write_reg(ES8388_DAC_POWER, 0x3C) != ESP_OK) return ESP_FAIL;
|
||||
|
||||
/* 14. ADC power: power up ADC (0x09 per Espressif reference).
|
||||
* Must come AFTER DACCONTROL21 state machine restart and all ADC register writes. */
|
||||
if (i2c_write_reg(ES8388_ADC_POWER, 0x09) != ESP_OK) return ESP_FAIL;
|
||||
/* 14. ADC power: full power-up (all Pdn bits cleared = 0x00).
|
||||
* 0x09 is the intermediate state (Espressif es8388_open end-state), but
|
||||
* the full ADC + analog input power-up requires 0x00 (Espressif es8388_start(ADC)).
|
||||
* Must come AFTER DACCONTROL21 state machine restart and ADCCONTROL6 unmute. */
|
||||
if (i2c_write_reg(ES8388_ADC_POWER, 0x00) != ESP_OK) return ESP_FAIL;
|
||||
vTaskDelay(pdMS_TO_TICKS(10)); /* let ADC analog settle after full power-up */
|
||||
|
||||
/* 15. Enable PA (power amplifier for speaker). */
|
||||
gpio_set_direction(PLIP_PA_ENABLE, GPIO_MODE_OUTPUT);
|
||||
|
||||
@@ -35,6 +35,10 @@ CONFIG_ESP_TASK_WDT_TIMEOUT_S=15
|
||||
# when I2S/WiFi interrupts spill into idle stack on original ESP32.
|
||||
CONFIG_FREERTOS_IDLE_TASK_STACKSIZE=2048
|
||||
|
||||
# SLIC hook GPIO — SHK on GPIO23 (A1S KEY4, active-HIGH: HIGH = off-hook)
|
||||
CONFIG_PLIP_HOOK_GPIO=23
|
||||
CONFIG_PLIP_HOOK_ACTIVE_HIGH=y
|
||||
|
||||
# WiFi credentials — set via `idf.py menuconfig` (PLIP Voice Configuration)
|
||||
# or override locally in sdkconfig (NOT committed).
|
||||
# CONFIG_PLIP_WIFI_SSID="..."
|
||||
|
||||
Reference in New Issue
Block a user