< Back to IRCAM Forum

Fluidsynth audio configuration (linux)

Hello,

I’m trying OM 7.7 in Linux Mint 22.2 and I would like to know if it’s possible to change FluidSynth’s audio settings when it runs inside OpenMusic. In particular, I’m interested in increasing the audio period size, similar to using fluidsynth -z 256 in the terminal, which seems to improve playback smoothness in my case.

I would also like to adjust the default gain of fluidsynth at startup, like with the -g flag in the terminal.

Is there a way to change these settings directly in OpenMusic at startup, or is there a recommended workaround?

Thank you for your help! :slight_smile:
rc

Dear RC,

Yes it is possible. Here is a patch:
fluid_period.lisp (2.0 KB)

Of course it would be nice to put this in the fluid preferences?

I am not very sure about the period-size if it is taken into account.

Tell me.

Best
K

Dear K,

Thanks for the quick reply and patch!
I tested it on a new workspace and it seems that it doesn’t make any difference, for example if I reduce the gain to 0.1 or if I change the bufsize between 64 and 512, it all sounds the same (crackling noises).

OTOH i continue testing fluidsynth settings outside om. In my case I get the same result if I open it with fluidsynth -a alsa -z 256 and fluidsynth -a jack -z 64. In both cases the noises are gone.

So i returned to om, created a new workspace without the fluid_period patch and loaded fluidsynth with jack driver. It worked fine with clean sound.

Now, if I reopen the same workspace with the autoload synth option checked, the noises are back, even if the fluid driver appears as jack in the om preferences. If i manually delete the synth and load it again (without touching the fluid driver jack) it sounds fine. To my eyes it seems that the autoload occurs with alsa, despite having jack saved as driver, but I’m just assuming this since I have no way to prove it.

Is there a way to check which fluid driver is loaded with the autoload synth option checked after restarting om?

best
rc

Dear rc

This patch sorry works WITHOUT autoload synth option. And only on startup BEFORE any synth is loaded. And yes sorry, forgot to integrate jack driver (it was only for alsa) since it is a test patch and not definitive.

Ok so here one with both, jack and alsa
fluid_period1.lisp (1.9 KB)

In order to get the values correct once change, evaluate the patch before loading any synth.
Then test.
Unload synth
Change values if needed
Evaluate patch
load synth
test
etc.

Of course if this works for you, (on my side it is working), i can put the variables (gain and period) as parameters in the fluid preferences Meaning these values will be taken in account BEFORE lodaing any synth.

Keep me informed.

Best
K

PS: sorry forgot. To know which driver fluid is using evaluate this expression:

om::*jack-alsa*

Dear K,

Wow thanks, that was quick!
Something is not working here and it seems that I’m doing things wrong.
Just to corroborate, could you send instructions on how to proceed please, for ex specify where should i copy the patch and how to evaluate it?
I’m testing om with pipewire for the first time and im a bit confused :slight_smile: :upside_down_face:

best
rc

Dear rc,

I have been using pipewire on my debian 13 and no problem encoutered.

What is the nature of your problems? Is it specifically OM/fluid related or more general audio/linux config?

Best
K

Dear K,

currently i’m having problems routing pipewire, esp when switching between my laptop sound card and external audio interfaces. For example, even if all my audio apps are properly routed to my external interface on qpwgraph, some of them are still sounding on my laptop speakers. I think it has to do with the autoconnect policies of pipewire, which makes things difficult, especially for live situations. With Jack this didn’t happen at all. But this is other thing not related with om. Sorry for the OT!

Returning to OM and Fluidsynth. The patch works fine and I can change the gain and buffer size. Thank you very much!

Now, I have a strange behavior when opening Openmusic with autoload synth activated. I can reproduce it this way:

  1. open om, create new workspace, open preferences and on the MIDI tab:
    default score player: fluidsynth
    force score player checked
    on the Fluidsynth tab:
    Autoload synths checked
    Auto Microtune checked
    Fluid Driver: jack
    Load one synth manually
    Apply and close

  2. create new patch with chord-seq (add some pitches just to test playback). The playback sounds good. Save all and close

  3. open om again and test the same chord-seq (synth with jack driver was auto loaded). The sound is bad, stuttering or crackling.

  4. If I open the preferences, manually delete and reload synth, the playback is now correct without any problems.

So autoload synth (with jack as fluid driver) sounds bad but manually deleting and reloading corrects the sound.

sorry for the long message. I hope it is clear, otherwise i can make a video showing the problem.

best
rc

Thanx for the detailed report.
I will look into this related jack issue and get back to you.

Best
K