Esp-idf: i2s_read with external I2S microphone always returns zero (IDFGH-1805)

Created on 4 Sep 2019  路  5Comments  路  Source: espressif/esp-idf

I've spent weeks trying dozens of variation but cannot seem to get i2s_read to return anything but zeros when reading from ICS-43434. My code is very similar to an ESP32 Arduino 1.0.2 example that works, and even if I use i2s_read_bytes to match it even more closely I cannot get it to work, which has me wondering if newer versions of the IDF have a bug related to external I2S inputs.

Environment

Problem Description

i2s initialization goes as expected but when i2s_read, or i2s_read_bytes are called, they always return zero.

Expected Behavior

Get non-zero response

Actual Behavior

Zeros

My test case that does not work against the IDF listed above.
https://gitlab.com/morganrallen/i2s-test-case
Although this code when compiled against Arduino ESP32 1.0.2 works as expected.
https://github.com/maspetsberger/esp32-i2s-mems/blob/master/examples/VUMeterDemo/VUMeterDemo.ino

Most helpful comment

Solved: using latest platform must swap left and right channel in configuration structure
i2s_config_t i2s_config = {
...
.channel_format = I2S_CHANNEL_FMT_ONLY_LEFT,
...

while in older platform works using I2S_CHANNEL_FMT_ONLY_RIGHT

All 5 comments

@morganrallen Thanks for reporting the issue, we will look into it.

I see the same problem.

Hi, @morganrallen
If the DIN pin is connected to vcc, is the read data still 0?

thanks !!

Me too having this issue after rebuilding an old working project.
for the moment I solved rolling back to espressif platform version 1.9.0.
In platform.ini set:
platform = [email protected]
using later platforms (1.10.0 or 1.11.0 or latest 1.11.1) makes my I2S microphone not working.

Solved: using latest platform must swap left and right channel in configuration structure
i2s_config_t i2s_config = {
...
.channel_format = I2S_CHANNEL_FMT_ONLY_LEFT,
...

while in older platform works using I2S_CHANNEL_FMT_ONLY_RIGHT

Was this page helpful?
0 / 5 - 0 ratings