ESP32-audioI2S icon indicating copy to clipboard operation
ESP32-audioI2S copied to clipboard

PSRAM leakage?

Open SanZamoyski opened this issue 1 year ago • 6 comments

Hi!

I think that something is not ok here. When song ends or is rewinded to next my free PSRAM lowers. I've left my player overnight and result is recorded in attached txt file.

[24.03.19]-mod.txt

I can not provide at the moment right software version, since it was modified since then. But I'll try to give You some useful informations. I'm using platformio:

platformio.ini.txt UAP_PinDef.inch.txt UAP_SdArrays.inc.txt UAP_DBG.inc.txt main.cpp.txt UAP_CoreLoop.inc.txt

Can we delete those files after solving/nofix this problem?

Is there anything wrong in my source or this is a bug? Sorry for the mess in source.

All my audio files are full-albums flac.

Best regards!

SanZamoyski avatar Mar 28 '24 12:03 SanZamoyski

The memory leak will have existed for a long time, the samplesBuffer was not released correctly. Thanks for the tip.

schreibfaul1 avatar Mar 28 '24 14:03 schreibfaul1

Can You provide some workaround? I.e. what should I do if PSRAM gets too low to play another song?

if(ESP.getFreePsram() < 32*1024){
  //do something smart here...
}

Currently I'm rebooting ESP when I realise there is PSRAM shortage.

SanZamoyski avatar Mar 28 '24 14:03 SanZamoyski

The loss was about 64KB at each initialisation of the FLAC decoder. I used ESP.getFreePsram() too to plug the leak.

schreibfaul1 avatar Mar 28 '24 14:03 schreibfaul1

but how?

SanZamoyski avatar Mar 28 '24 20:03 SanZamoyski

@SanZamoyski he has committed a correction or i'm not understandign what you are asking for?

image

Marco1971Repo avatar Mar 31 '24 18:03 Marco1971Repo

I have checked it. Still free PSRAM lowers each time I play next flac.

PMKrol avatar Apr 03 '24 10:04 PMKrol

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

github-actions[bot] avatar May 04 '24 02:05 github-actions[bot]

Updated libraries, it is in fact working now. Thanks!

SanZamoyski avatar May 06 '24 19:05 SanZamoyski