You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I tried to use fluidsynth on a Raspberry Pi Zero 2 w with 512 MB RAM as a piano sampler and quickly ran into issues because of SF2 files that are larger than the available RAM. fluidsynth will load a very long time because the system starts to swap.
I made some workarounds and now it works reasonably well with almost no hiccups/delays, even with a very large 780 MB piano SF2 file. I just wanted to share what i did, maybe there is some interest in supporting such use cases:
since all samples of all presets are loaded at the start, i tried using synth.dynamic-sample-loading=1 as a workaround. this works for large files, but not for the piano SF2 file where one instrument is already too large.
i used memory mapping in fluid_sffile_read_wav to map the file data instead of reading it. this is of course a total hack but works with the main fluidsynth command line tool since fluid_sffile_read_wav is only called once to load all sample data.
patched out fluid_voice_optimize_sample because it takes a very long time to iterate over all samples from the slow sd card.
disabled loading 24 bit data by adding sf->sample24pos=0; sf->sample24size = 0; at the end of fluid_sffile_open. this should also improve the performance when unused notes are paged in automatically when accessing the sample data because the memory pattern is less erratic.
added -o synth.lock-memory=0 because the mlock command leads to a SIGKILL because it uses too much memory.
maybe my use case is too epxerimental, just wanted you to know that there are some hurdles to take when using fluidsynth in this way.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
I tried to use fluidsynth on a Raspberry Pi Zero 2 w with 512 MB RAM as a piano sampler and quickly ran into issues because of SF2 files that are larger than the available RAM. fluidsynth will load a very long time because the system starts to swap.
I made some workarounds and now it works reasonably well with almost no hiccups/delays, even with a very large 780 MB piano SF2 file. I just wanted to share what i did, maybe there is some interest in supporting such use cases:
synth.dynamic-sample-loading=1
as a workaround. this works for large files, but not for the piano SF2 file where one instrument is already too large.fluid_sffile_read_wav
to map the file data instead of reading it. this is of course a total hack but works with the main fluidsynth command line tool sincefluid_sffile_read_wav
is only called once to load all sample data.fluid_voice_optimize_sample
because it takes a very long time to iterate over all samples from the slow sd card.sf->sample24pos=0; sf->sample24size = 0;
at the end offluid_sffile_open
. this should also improve the performance when unused notes are paged in automatically when accessing the sample data because the memory pattern is less erratic.-o synth.lock-memory=0
because the mlock command leads to a SIGKILL because it uses too much memory.maybe my use case is too epxerimental, just wanted you to know that there are some hurdles to take when using fluidsynth in this way.
Beta Was this translation helpful? Give feedback.
All reactions