pschatzmann / arduino-audio-tools

Arduino Audio Tools (a powerful Audio library not only for Arduino)
GNU General Public License v3.0
1.27k stars 199 forks source link

Example "streams-audiokit-webserver_mp3" doesn't build anymore #1517

Closed dl9sec closed 1 month ago

dl9sec commented 1 month ago

Problem Description

The example "streams-audiokit-webserver_mp3" doesn't build anymore and ends up with the error message:

c:/users/thors/appdata/local/arduino15/packages/esp32/tools/xtensa-esp32-elf-gcc/esp-2021r2-patch5-8.4.0/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld.exe: C:\Users\thors\AppData\Local\Temp\arduino_build_452742/streams-audiokit-webserver_mp3.ino.elf section `.dram0.bss' will not fit in region `dram0_0_seg'
c:/users/thors/appdata/local/arduino15/packages/esp32/tools/xtensa-esp32-elf-gcc/esp-2021r2-patch5-8.4.0/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld.exe: DRAM segment data does not fit.
c:/users/thors/appdata/local/arduino15/packages/esp32/tools/xtensa-esp32-elf-gcc/esp-2021r2-patch5-8.4.0/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld.exe: DRAM segment data does not fit.
c:/users/thors/appdata/local/arduino15/packages/esp32/tools/xtensa-esp32-elf-gcc/esp-2021r2-patch5-8.4.0/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld.exe: region `dram0_0_seg' overflowed by 600 bytes
collect2.exe: error: ld returned 1 exit status

Device Description

ESP32 AudioKit 2.2 A402

Sketch

examples/examples-audiokit/streams-audiokit-webserver_mp3/streams-audiokit-webserver_mp3.ino

Other Steps to Reproduce

auduino-audio-tools, arduino-audio-driver and arduino-liblame pulled yesterday evening from the repos.

What is your development environment

Arduino 1.8.19 with latest updates for LIBs and BSPs ESP32 Dev Module, PSRAM: "Enabled", Partition Scheme: "Huge APP ..."

I have checked existing issues, discussions and online documentation

pschatzmann commented 1 month ago

Did you read the README of the liblame and try to set USE_MEMORY_HACK to 0 ? You could also install an older core which uses less memory...

dl9sec commented 1 month ago

Hi Phil,

sure, you set this to 0 by default. Do you mean an ESP32 core?

pschatzmann commented 1 month ago

Yes, the newer, the less memory you have available...

dl9sec commented 1 month ago

Ok, thanks. Tried it with 2.0.14 and it builds fine again. It's a pitty, that that newer versions of the ESP32 core a more and more hungry for memory and there is no possibility to take influence on that in the board parameters...

pschatzmann commented 1 month ago

Anyhow, I would not recommend the combination of MP3 encoding and WIFI! This is somehow too close to the limits...

The WAV encoder does not need any memory at all and it is very efficient because we can just copy the data as is...

dl9sec commented 1 month ago

Yes, I am aware of the situation. Maybe I will go back from MP3 to WAV..

pschatzmann commented 1 month ago

I found some big arrays that were statically allocated in liblame: pow43 and adj43 were using 32832 bytes! I changed them to be allocated on the heap (or PSRAM).

This should resolve the issue...

dl9sec commented 1 month ago

Oh wow, great stuff! Thank you so much for your effort. Builds perfect with ESP32 core 2.0.15 and RAM usage decreases a lot :-)