-
Notifications
You must be signed in to change notification settings - Fork 259
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] Fluidsynth randomly accepts or rejects a certain soundfont #1457
Comments
Which version of libsndfile are you using? I'll try to look into it in the following days. |
|
Interesting. So the loading of a Soundfont is parallelized in fluidsynth since version 2.2.0. This particular SF however uses multiple individual uncompressed samples, which hasn't been tested or considered before. Because of that, this function: fluidsynth/src/sfloader/fluid_sffile.c Line 2206 in 4579469
Will be called multiple times concurrently, where as for a regular SF2 file it would only be called once. The threads mess up the shared FILE handle of the SF file, because there is no synchronization built in here yet. If you set |
Well, according to Fluid's own RFC, mixed compression is supported. |
I know that. But Fluidsynth 2.2.0 was developed and released before that RFC was drafted. Hence, it has neither been considered, nor tested during development. |
I see. Thanks. Also just a quick, somewhat related question: Since fluidsynth uses sndfile, does that mean that it can load a soundfont containing any compression that libsndfile supports? (like flac or opus for example) |
I haven't tested it - but yes, to my knowledge, there are no restrictions in fluidsynth's code that should prevent that from working. |
Merging it now, thanks for the report. |
FluidSynth version
Execute
fluidsynth --version
and provide the output.Describe the bug
Okay, so this is a very strange bug:
The attached sf3 soundfont sometimes loads and sometimes doesn't as demonstrated in the video.
It reports "failed to read sample data" while other times it loads? Also the samples seem to be mismatched, especially the drums. Again, it's random.
I have set up a fallback soundfont and that's when the piano can be heard, meaning that Calm 4 has failed to load.
https://github.com/user-attachments/assets/35a15ffa-8506-468b-94f8-8fecef4b2179
Expected behavior
It should either fail 100% of the time or load 100% of the time. The file doesn't change (unless fluid modifies it somehow?) so it should be deterministic.
Steps to reproduce
.zip
, it's just a soundfont, not an archive)Note: I used this command:
fluidsynth Downloads/Calm\ 4.sf3 Downloads/Persona4\ Specialist.mid -o audio.driver=pulseaudio
Omitting audio.driver or using a different MIDI file don't make a difference.
Additional context
This soundfont has mixed samples. Both compressed and uncompressed. And it crashes Polyphone, so it's probably a bit messed up. Though spessasynth loads it 100% of the time.
The text was updated successfully, but these errors were encountered: