esp-adf icon indicating copy to clipboard operation
esp-adf copied to clipboard

i2s_stream does not zero DMA buffer in 32 bits mode (AUD-600)

Open hallgrim opened this issue 7 years ago • 2 comments

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 avatar Jan 07 '19 23:01 hallgrim

@hallgrim Yes, plz. And thanks for report this issue.

jason-mao avatar Jan 09 '19 09:01 jason-mao

@jason-mao I have created a pull request #110.

hallgrim avatar Feb 05 '19 22:02 hallgrim