esp-adf
esp-adf copied to clipboard
i2s_stream does not zero DMA buffer in 32 bits mode (AUD-600)
When I stop playing a 32 bit sample I get a lot of noise. This is due to not zeroing the DMA buffer completely.
In i2s_stream.c function _i2s_close(audio_element_handle_t self):
uint8_t *buf = audio_calloc(1, i2s->config.i2s_config.dma_buf_len * 4);
dma_buf_len is in number of samples. For 16bit/stereo multiple with 4 is fine. For 32bit/stereo it should be 8.
I tried to change the code to call i2s_zero_dma_buffer(i2s->config.i2s_port) instead and the noise disappears. Do you want a pull-request?
@hallgrim Yes, plz. And thanks for report this issue.
@jason-mao I have created a pull request #110.