Skip to content
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 mic not working with 2.0.4 #7177

Closed
1 task done
MikeBailleul opened this issue Aug 24, 2022 · 15 comments
Closed
1 task done

I2S mic not working with 2.0.4 #7177

MikeBailleul opened this issue Aug 24, 2022 · 15 comments
Assignees
Labels
Area: ESP-IDF related ESP-IDF related issues Area: Peripherals API Relates to peripheral's APIs.
Milestone

Comments

@MikeBailleul
Copy link

Board

ESP32 Dev Module

Device Description

Attached to an INMP441 MEMS microphone

Hardware Configuration

INMP441 is configured as follow:
WS -> 25
SCK -> 32
SD -> 33
L/R -> GND
GND -> GND
VDD -> 3.3V

Version

v2.0.4

IDE Name

Arduino & PlatformIO

Operating System

macOS 12.5.1

Flash frequency

40Mhz

PSRAM enabled

no

Upload speed

460800

Description

Microphone does not work anymore with version 2.0.4.
When switching back to 2.0.3, it works normally.

Sketch

https://github.com/atomic14/esp32-i2s-mic-test/blob/main/i2s_mic_test/i2s_mic_test.ino

Debug Message

None

Other Steps to Reproduce

No response

I have checked existing issues, online documentation and the Troubleshooting Guide

  • I confirm I have checked existing issues, online documentation and Troubleshooting guide.
@MikeBailleul MikeBailleul added the Status: Awaiting triage Issue is waiting for triage label Aug 24, 2022
@MikeBailleul MikeBailleul changed the title I2S mic not working anymore I2S mic not working with 2.0.4 Aug 24, 2022
@SuGlider
Copy link
Collaborator

@PilnyTomas - Could you please help to triage this issue?

@PilnyTomas
Copy link
Contributor

Not much to work with here. There was no change in the top-level library, maybe IDF problem.
@MikeBailleul Please post a complete and minimal sketch + picture of your connection.
The clock pin is by default set to GPIO 14 and data input is default to GPIO 35 but I assume you have changed that since you are connecting to 32 and 33.

@PilnyTomas PilnyTomas added Resolution: Awaiting response Waiting for response of author and removed Status: Awaiting triage Issue is waiting for triage labels Aug 24, 2022
@PilnyTomas PilnyTomas moved this from Todo to Under investigation in Arduino ESP32 Core Project Roadmap Aug 24, 2022
@Jason2866
Copy link
Collaborator

@MikeBailleul Can you try with the branch https://github.com/espressif/arduino-esp32/tree/idf-release/v4.4 ? We are using a i2s mic for Tasmota and it does work. See example For Tasmota we use our own Arduino framework build which is based on a later IDF version than the actual core 2.0.4. Thats why i suggested to try the newest build.

@MikeBailleul
Copy link
Author

@PilnyTomas the sketch and pins in my first post are the one I use.
I have tried this setup by changing only the arduino-esp32 version (from 1.0.0 to 2.0.4) and the only one that does NOT work and produce unexpected output is 2.0.4.
Also, I am not the only having this issue: atomic14/esp32-i2s-mic-test#2 (comment)

@Jason2866 sure I will be happy to test it out, could you explain how to use this specific release into Arduino software?
As of now, my choices are limited to the one already built/released:
CleanShot 2022-08-24 at 18 49 05@2x
I have used the doc that has those URLs:

https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json
https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_dev_index.json

@Jason2866
Copy link
Collaborator

@MikeBailleul Do not ask me about ArduinoIDE ;-) I never used it. I do everything with VSC and PlatformIO. With Platformio it is easy, i just reference the branch and if needed the specific commit.

@MikeBailleul
Copy link
Author

The only reason I still use ArduinoIDE sometimes is for the plot feature (I'm not aware of such a feature in PlatformIO, maybe you know?), this is handy when working with sound, for visualisation :)

I had no idea I could reference the branch/commit in platformIO, neat feature.
Not sure if the syntax I use is correct though:

platform = espressif32
platform_packages = platform_packages @ https://github.com/espressif/arduino-esp32.git#idf-release/v4.4

If this is correct, the issue persists.
Can you provide the syntax to use a specific commit? I can try to identify from which commit the issue appears.

@Jason2866
Copy link
Collaborator

The syntax is not correct. Use

platform = espressif32
platform_packages = framework-arduinoespressif32 @ https://github.com/espressif/arduino-esp32.git#idf-release/v4.4

@Jason2866
Copy link
Collaborator

And for a commit

....https://github.com/espressif/arduino-esp32.git#d22bcb765b35f8a1869a5ed185886eec77e3fa21

@Jason2866
Copy link
Collaborator

If serial plotter is the only reason https://community.platformio.org/t/plotting-using-platformio/6597/8

@MikeBailleul
Copy link
Author

I identified it, from this commit, the microphone stops working: 666c66d

I also tried the branch you suggested with the more recent IDF but it does not work.

@Jason2866
Copy link
Collaborator

Jason2866 commented Aug 25, 2022

This is the correction of flash modes. Before always the same boot loader was flashed.
So always the same flash mode was used. Try all flash modes for your board.
Can be set in your platformio.ini to override the default

[env:esp32]
platform = https://github.com/......
platform_packages = framework-arduinoespressif32 @ https.....
board = esp32dev
board_build.flash_mode = qio
framework = arduino
monitor_speed = 115200

EDIT: Forget the above, that was the major change of using IDF calls instead own Arduino code.

@PilnyTomas
Copy link
Contributor

Sketch

https://github.com/atomic14/esp32-i2s-mic-test/blob/main/i2s_mic_test/i2s_mic_test.ino

Sorry, I missed that.
I see that you are using IDF original I2S driver. So that rules out Arduino ... I suggest opening issue in IDF: https://github.com/espressif/esp-idf/issues/new/choose

@PilnyTomas PilnyTomas added Area: ESP-IDF related ESP-IDF related issues and removed Resolution: Awaiting response Waiting for response of author labels Aug 25, 2022
@vernonet
Copy link

I have a similar problem, I had to add the code:

#if ESP_ARDUINO_VERSION >= ESP_ARDUINO_VERSION_VAL(2, 0, 4)
  #define I2S_MIC_CHANNEL            I2S_CHANNEL_FMT_ONLY_RIGHT 
#else
  #define I2S_MIC_CHANNEL            I2S_CHANNEL_FMT_ONLY_LEFT
#endif  
........
i2s_config_t i2s_config = {
........
  .channel_format = I2S_MIC_CHANNEL, 
........
};

That is, you need to replace "I2S_CHANNEL_FMT_ONLY_LEFT" with "I2S_CHANNEL_FMT_ONLY_RIGHT"

@PilnyTomas
Copy link
Contributor

Seeing that the IDF team took responsibility for this issue, I am closing this one.

Repository owner moved this from Under investigation to Done in Arduino ESP32 Core Project Roadmap Nov 9, 2022
@BlueAndi
Copy link
Contributor

Is this solved meanwhile in the release/v2.0.x branch?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: ESP-IDF related ESP-IDF related issues Area: Peripherals API Relates to peripheral's APIs.
Projects
Development

No branches or pull requests

7 participants