Closed flynnsbit closed 3 years ago
Thanks!
I know the cause of this, and it shouldn't occur on Pi 4. It could occur if any kind of large file greater than around 32MB is in the directory.
The MT-32 ROM loader will try to read the entire file into memory, but fail because it won't be able to allocate more than ~32MB. This is because the amount of heap memory remaining for libc malloc()
/new
is around ~32MB after the custom allocator used by FluidSynth reserves the majority of the Pi's RAM.
Valid MT-32 ROMs can never be more than 1MB in size (the largest ROM is the CM-32L PCM ROM at 1MB), and so an easy fix would be to simply skip files >1MB in the ROM scanner. I'll implement this for the next release.
This issue may come back again if anything else needs to do a large malloc()
however - so the true long-term fix is to completely replace the Circle memory allocator with the custom one.
Exodos default install includes an mt32 folder which has both the mt-32 roms as well as a SoundCanvas.sf2 file. If user copies the entire folder over to the mt32-pi sd card for mt32 roms it will cause this issue.