Page 1 of 1

[Bug] ADPCM Encoder outputs silence (zeros) with Raw Stream input (16kHz/Mono) without WAV header

Posted: Thu Nov 20, 2025 3:40 pm
by Wellan72
[Bug] ADPCM Encoder outputs silence (zeros) with Raw Stream input (16kHz/Mono) without WAV header
Body (Corps du message)
Environment:
Chip: ESP32-S3
ADF Version: (Latest master or v2.6 - specify yours if known)
IDF Version: v5.x
Audio Board: ES8388 / Custom
Description:
I am trying to build a simple pipeline that reads a Raw PCM file from internal flash, encodes it to ADPCM, decodes it back to PCM, and plays it via I2S.
The flow is: raw_stream -> adpcm_encoder -> adpcm_decoder -> i2s_stream.
The Problem:
The adpcm_encoder consumes the input data but outputs only zeros (0x00) bytes.
I have verified this by adding a diagnostic print in the _process function of a custom audio element placed after the encoder.
Configuration:
Input: Raw PCM, 16000 Hz, 1 Channel, 16-bit signed (Embedded binary file).
Encoder Config:
sample_rate = 16000
channel = 1
contain_wav_adpcm_header = false (This is crucial, I want raw ADPCM).
Debugging Steps Taken (Results):
Bypass Test (raw -> i2s): WORKS. Clear sound is played. This proves the PCM data is valid and I2S/Hardware configuration is correct.
Resample Filter: Added rsp_filter between raw and encoder to ensure proper block alignment. Result: FAIL (Still outputs zeros).
Explicit Config: Used audio_element_setinfo on all elements and explicit struct initialization. Result: FAIL.
Frequency: Tried 16kHz and 48kHz. Result: FAIL.
It seems libesp_adpcm.a fails to process raw 16-bit PCM when contain_wav_adpcm_header is set to false and input comes from a raw_stream (fragmented reads).