I2S audio and DMA it’s a mysterious world. What are these parameters: dma_buf_count and dma_buf_len? What are they for? And what values should they be set to?

Thanks to PCBWay for sponsoring this video, PCBWay offer PCB Production, CNC and 3D Printing, PCB Assembly and much much more. You can find their details here: https://www.PCBWay.com/?from=atomic

In this video, we try and answer the question around dma_buf_count and dma_buf_len.

I’m going to be focussing on I2S, streaming sample data to and from the CPU to microphones and speakers.

There are two critical parameters: dma_buf_count and dma_buf_len - and it’s not always obvious what values to use.

What is DMA? DMA stands for Direct Memory Access. It allows peripherals to directly access the system memory without involving the CPU.

When using DMA, the CPU initiates a transfer between memory and the peripheral. The transfer is all taken care of by the DMA controller and the CPU is free to go off and do other work.

You can find detailed information about the DMA system that is used on the ESP32 here: https://www.espressif.com/sites/default/files/documentation/esp32_technical_reference_manual_en.pdf

I’ve also got a whole series around audio on the ESP32 which you can find here along with links to sample code: https://www.youtube.com/playlist?list=PL5vDt5AALlRfGVUv2x7riDMIOX34udtKD

You can pick up an I2S Amplifier (MAX98357) here: https://amzn.to/3cg88Z5 An INMP441 I2S Microphone here: https://amzn.to/3cicuiv Or my own ICS-43434 I2S Microphone here: https://www.tindie.com/products/21519/ And ESP32 Dev board: https://amzn.to/3gb6fyc

Patreon: https://www.patreon.com/atomic14 ko-fi: https://ko-fi.com/atomic14