Issue with Audio Memory

Hi everyone,

I can do in my code: AudioMemory(1420) and I am monitoring the memory usage via AudioMemoryUsage(). I am using some delays. Everything is working fine until the audio memory usage shows that the program reaches 891 (sometimes it shows 892). This acts as a limit and it starts to sound like buffer underruns. Has anyone experienced this same situation?

Thanks in advance.
 
You can ask for 1420 blocks, but without editing the library you won’t be able to access more than 896 … the rest are allocated but wasted.

I have a PR in place that once nearly got merged, so it may get another chance during the Teensyduino 1.60 campaign. That allows you to use heap, PSRAM or an array for delay memory, using the AudioEffectDelayExternal object. It's obviously a bit less flexible because you have to determine the maximum possible delay length at compile time, but it does allow for insane delay lengths.
 
In AudioStream.cpp, right? There's 512kB of DMAMEM, and the existing limit is about half of that ... so you reduce the amount of heap available for the rest of your sketch. Whether that causes problems is rather dependent on what else you might allocate...
 
Back
Top