-
Notifications
You must be signed in to change notification settings - Fork 7.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
i2s_read with external I2S microphone always returns zero (IDFGH-1805) #4015
Comments
@morganrallen Thanks for reporting the issue, we will look into it. |
I see the same problem. |
Hi, @morganrallen thanks !! |
Me too having this issue after rebuilding an old working project. |
Solved: using latest platform must swap left and right channel in configuration structure while in older platform works using I2S_CHANNEL_FMT_ONLY_RIGHT |
Not sure why this was closed as it is a bug that was fixed in other versions. I'll re-open the issue to see if the Espressif team will fix it in v4.0.2 |
Yes I am experiencing the same problem when trying to read I2S MEMS Microphone data,. |
Hi @miketeachman @Younes-SadatNejad , Have you tried @leleb 's solution above? And could you please provide the IDF version you are using, and maybe a simple piece of code to reproduce the issue? If you are working on the Arduino, please also provide details for that. It will help us locate the issue more quickly. |
Hi @ginkgm, For me, changing to I2S_CHANNEL_FMT_ONLY_RIGHT is a workaround to this bug. I submitted a new issue on the bug. I discovered this bug while writing an I2S driver for MicroPython. I was able to add two lines of low-level C code to fix the problem:
|
Hello @ginkgm , #include <stdio.h> #define TAG "I2teSt" static char* i2s_read_buff; int32_t sample=0; const i2s_config_t i2s_config = { const i2s_pin_config_t pin_config = { err = i2s_driver_install(I2S_NUM, &i2s_config, 0, NULL); void app_main() { size_t bytes_read; i2s_read_buff = (char*) calloc(I2S_READ_LEN, sizeof(char)); i2s_start(I2S_NUM); while(1) {
} |
Is this issue fixed? I still experience this issue on ESP32-S2 (lolin S2 mini) in Arduino esp32 board version 2.09 (based on IDF 4.4.4), Microphone INMP441. I have to set |
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
The text was updated successfully, but these errors were encountered: