-
Notifications
You must be signed in to change notification settings - Fork 290
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
ESP32-audioI2S crashes on arduino-esp32 v3.0.7 #875
Comments
The Arduino version 3.0.7 was released recently. I have tested this version in VSCode nit PIO and have not been able to reproduce the error. According to your log, there is a memory violation during an if query. Strange, maybe the error only occurs under certain configurations? |
Hi schreibfaul1, If I disable PSRAM, my code works fine on arduino-esp32 v3.0.7. Looks like problem is related to the latest changes in arduino PSRAM:
This is my PSRAM configuration when everything crashes on v3.0.7 (the same settings work OK on arduino-esp32 v3.0.5): |
hi, I have exactly the same crashes with version 3.07. I went back to version ESP32-audioI2S-3.0.12f to work with 3.07. |
I have now tested V3.0.7 in the Arduino IDE. @enjoyneering is right, PSRAM is not initialised correctly. This leads to an "out of memory". Arduino V3.0.5 works. |
The problem is not in Arduino, but in the library constructor: https://github.com/schreibfaul1/ESP32-audioI2S/blob/master/src/Audio.cpp#L161 It is allocating and dealing with memory BEFORE the memory is properly initialized. All that code should be executed in It worked before, because it ran before any PSRAM was touched, thus acting like PSRAM is not there at all. |
I don't think the timing of the PSRAM initialisation is the problem, it hasn't been since V1. The Arduino version 3.0.7 (IDF 5.1.4) runs flawlessly in PlatformIO. I only have the error in the Arduino IDE |
This does not change the fact that in the constructor (which runs before PSRAM is added to heap and anything else is started and prepared) there are many things done that should not be done there. All that should happen in the constructor is basic class variables setup. All other memory operations should be done later in |
This has not been a problem so far, because PSRAM was initialized AFTER |
@me-no-dev Thanks for the explanation. The PSRAM will now be initialised at a later time, everything is perfect, and in the Arduino IDE it is now also running. |
Hi schreibfaul1,
The latest ESP32-audioI2S v3.0.13d crashes on arduino-esp32 v3.0.7. Same code works OK on arduino-esp32 v3.0.5. I'm not an expert, but I think the problem is related to the latest changes in arduino PSRAM. The Exception Decoder points to Audio::setDefaults().
The hardware I use:
ESP32-S3 R8N2 at 240Mhz with 8MB flash at 80MHz (QIO) & 2MB PSRAM (QSPI).
The text was updated successfully, but these errors were encountered: