miketeachman / micropython-esp32-i2s-examples

Usage and examples for I2S support on the ESP32 microcontroller
MIT License
156 stars 29 forks source link

Support record stero MIC to file currently? #27

Open water5 opened 3 years ago

water5 commented 3 years ago

I try to connect two INMP441, and change channelformat = I2S.RIGHT_LEFT, rise error below:

E (39778) I2S: Error malloc dma buffer /home/miket/micropython_projects/esp-idf-v4-0-2-e5f754b/components/freertos/queue.c:1802 (vQueueDelete)- assert failed! abort() was called at PC 0x40091e37 on core 0

Is it support record stero MIC to file currently?

miketeachman commented 3 years ago

The I2S implementation works with two MICs. The error you see might be caused by the ESP32 running out of DMA capable memory when I2S is initialized. You can try to fix the problem by reducing the values of dmalenand dmacount in the I2S initialization call. That change will reduce the amount of DMA capable memory that is allocated during initialization.

water5 commented 3 years ago

It works after reduce NUM_SAMPLES_IN_DMA_BUFFER, but what affect after change dmalen, dmacount?

miketeachman commented 3 years ago

Thanks for the followup. I'm glad you got it working. Reducing dmalenand dmacount reduces the amount of DMA capable memory that is used. I'm surprised that reducing NUM_SAMPLES_IN_DMA_BUFFER fixed the problem as the error message message you got does not suggest this fix would work.