schreibfaul1 / ESP32-audioI2S

Play mp3 files from SD via I2S
GNU General Public License v3.0
1.15k stars 291 forks source link

Not using PSRAM #678

Closed codegrue closed 8 months ago

codegrue commented 9 months ago

I confirmed that the audio buffer is using the heap not the available PSRAM. What might be the cause of it not thinking there is PSRAM available?

I'm using the Arduino framework in Platformio on an ESP32-S3 with 2MB of PSRAM.

In Platformio.ini I have:

build_flags = 
      -D BOARD_HAS_PSRAM
      -mfix-esp32-psram-cache-issue

and in my board.json I have:

    "extra_flags": [
      "-DBOARD_HAS_PSRAM",

When I call this in main it returns true:

psramInit()

**Looking at your code for AudioBuffer, m_f_psram gets assigned in the AudioBuffer::init() method. Which requires m_buffSizePSRAM to be greater than zero.

if(psramInit() && m_buffSizePSRAM > 0) {

So how can setBufSize get called before the creation of the buffers on the heap if I am creating the entire object set with just:

Audio audio;

codegrue commented 9 months ago

I tried the suggestions in this article and that didn't allow the PSRAM to be seen by ESP32-audioI2S.

https://thingpulse.com/esp32-how-to-use-psram/#:~:text=It%20turns%20out%20that%20we%20need%20to%20enable,to%20the%20platformio.ini%3A%20build_flags%20%3D%20-DCORE_DEBUG_LEVEL%3D5%20-DBOARD_HAS_PSRAM%20-mfix-esp32-psram-cache-issue

github-actions[bot] commented 8 months ago

This issue is stale because it has been open for 30 days with no activity.