-
-
Notifications
You must be signed in to change notification settings - Fork 8.2k
ESP32-C3 I2S #8641
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
Comments
It looks like I2S support for the C3 was incomplete in ESP-IDF itself at the time of the initial commits to MicroPython, but it arrived shortly afterwards. In principle it could just be a case of toggling it on in the config file for the base ESP32-C3 build and testing it. I don’t have anything that I know of in my kit box that is specific for I2S, otherwise I’d be happy to help here! |
latest updat
8000
e, I've attempted to toggle it on in the file ports/esp32/boards/GENERIC_C3/mpconfigboard.h |
I have been fiddling with I2S using the Seeed XIAO ESP32C3 (GPIO 6,7,8).
Caveats:
I have no other ESP32 board, so not at all exhaustive test. |
We have now switched to IDF v5.0.2. The above two fixes (defining DR_REG_I2S_BASE and updating the conditional to include C3) are still required. I tested them with a GENERIC_C3 build on a ESP32-C3-DevKitC and I2S output works. |
I wonder if the noise issue is the same one that I discovered in #11245 Can you try the fix there and see if it solves the noise issue? |
Thanks so much for this pointer- I haven't done exhaustive testing but setting the My current modifications using ESP IDV v5 are: (all in
I still get a ESP32 message (not micropython) when restarting I2S
but this doesn't seem to impact performance. The first message is when switching I2S from stereo to monitor and changing frequency, the second is after a soft reset (I assume clearing the existing I2S instance) Thanks again- |
…n-main Translations update from Hosted Weblate
It's been 2 years since this was mentioned, I2S is still not included in the main firmware build. What problem is keeping this issue from being resolved? The C3 is getting more and more popular, it's weird that this module that has been ported already for the other esp32 ports is still missing here. |
Try the latest development release for the C3, which includes I2S. The next official release (1.23?) should have it. See pull request #13727 from early March this year which is now merged into main code base. |
@ricksorensen thanks for the response. I had hope for a second, but I tried the latest preview build of 1.23.0 preview 379 (16 may 2024) from the micropython website. |
Could this be it? Maybe this line should be changed, otherwise it is still not going to be included in the next build.
|
Yes indeed. I had forgotten that I have this defined by default in my case (using a SEEED XIAO ESP32C3)
// This configuration is for a generic ESP32C3 board with 4MiB (or more) of flash.
// modified for my ESP32C3
#define MICROPY_HW_BOARD_NAME "ESP32C3 XIAO"
#define MICROPY_HW_MCU_NAME "ESP32C3"
#define MICROPY_HW_ENABLE_SDCARD (0)
#define MICROPY_PY_MACHINE_DAC (0)
#define MICROPY_PY_MACHINE_I2S (1) |
@ricksorensen I've been struggling for 2 days now to get this to build with the latest dev branch and run, with the machine_I2S flag enabled. I finally got a firmware out of the build processes, but after flashing, it just goes in a boot loop, mentioning a load access fault. With the new I2S version what all was necessary to get it to run? Still all you mentioned a year ago? I hoped it was just a simple case of changing that line of code and rebuilding, possibly even submitting a pr. It's very possible I'm overlooking something completely unrelated. Because even just getting the source to build was a multi hour head inducing struggle (not helped by not being very familiar with Linux) If it's not to much to ask, could I try out your firmware binary? Setting up audio with the esp32-c3 was supposed to be a small part of this project I'm working on, but it's already become a 3 day frustrating rabbit hole. And I've gotten no further on the rest of the project. If you have the time, my email is on my profile. |
I'll try to get a version of my firmware to you, possibly tonight. I'll also try to document my build process better. I build with IDF v5.04 - if I use v5.2 my builds sometimes work but I have not successfully gotten them to start. |
Here is a path to some of my examples (largely from Mike Teachman's notes and repositories): Here is may XIAO ESP32C3 binary: built with IDF 5.04 |
Thank you very much! I hope this can eventually be sorted out for the official binaries |
If I2S works with the MICROPY_PY_MACHINE_I2S set to 1 for the ESP32-C3, please provide a merge request - and the chances for it being included in the next versions goes up dramatically :) |
I think this is covered in current release via the ESP IDF 5.2 at least. See: and from the esp32 tools directory:
But the two C3 board definitions (LOLIN and GENERIC) override the MICROPY_PY_MACHINE_I2S definition to disabled (0) |
I actually tried to do that so I can avoid having to compile it myself in the future, but not sure how successful my merge request is going to be... It seems like doing merge requests is harder than compiling micropython itself... :) |
Hi,
Is there any technical reason why I2S is missing from the ESP32-C3 build? Is there a likelihood it will be included in the future?
Many thanks
The text was updated successfully, but these errors were encountered: