esp32-s31-korvo-1: AFE output corrupted (constant-level noise) with esp-sr 2.4.7 — fixed by upgrading to 2.5.5
Board: ESP32-S31-Korvo-1 (espressif/esp32-s31-korvo-1)
Target: esp32s31 (preview), ESP-IDF 6.2 (master)
Firmware: xiaozhi 2.5.0
Symptom
- Wake-word detection works (device reacts to "你好小智" and replies with its greeting voice prompt).
- But after wake-up the device gets stuck in "Listening..." forever — the server never recognises any speech.
- The audio uploaded to the server is constant-level noise (a "da-da-da" / drill-like sound). This was verified by capturing the raw PCM received by the server: it has energy but is not speech.
Root cause
The board's AFE (AFE_TYPE_FD + AFE_MODE_LOW_COST, input format "MM") produces corrupted audio on ESP32-S31 when using esp-sr 2.4.7.
Diagnostics added along the audio path (esp_codec_dev_read → AfeAudioEngine::Feed → AFE output → opus encode → server):
- Raw microphone read (
esp_codec_dev_read): fine — RMS varies with speech. - AFE input (
AfeAudioEngine::Feed): fine — both channels show speech-correlated level. - AFE output (
result->datainHandleVoiceResult): broken — RMS stays constant (~662) and does not change with speech. - Same board running Espressif
factory_demo(which does not use esp-sr/AFE, just raw capture/playback) records and plays back correctly, so the hardware/codec/I2S path is fine.
So the corruption is produced inside the AFE, not in the codec/I2S/transport.
Fix
Upgrade the espressif/esp-sr dependency from ==2.4.7 to 2.5.5 in main/idf_component.yml:
espressif/esp-sr: 2.5.5After the upgrade, the AFE output is correct and the device works normally (speech is recognised, two-way conversation works).
Relevant esp-sr changelog entries:
2.5.0— Improve BSS performance (BSS is the AFE spatial/beam-forming stage)2.5.5— Update AFE interface
Extra note
On ESP-IDF 6.2, espressif/esp-dl (pulled in by esp-sr) also needs:
CONFIG_COMPILER_DISABLE_DEFAULT_ERRORS=yotherwise the build fails on new warnings promoted to errors.
Suggestion
- Bump the pinned esp-sr version for the
esp32-s31-korvo-1board (or generally), or at least document the minimum working version for ESP32-S31.
Thanks!
Source: 78/xiaozhi-esp32