Fluidsynth DSSI plugin (linux)

Hello everyone, it’s been a while since i posted here!

I haven’t been tracking much lately, but i often use Renoise as a powerful plugin host… anyway, i have this bug concerning the Fluidsynth DSSI plugin. The same thing happened yesterday with the Pianoteq (VST) plugin, that happened once, randomly, can’t reproduce. This one with Fluidsynth howerver, happens every time trying to load an old .xrns - see attachments. The file is simply a conversion of an old midi file, in which (iirc) i replaced each instrument (midi device output) with an instance of Fluidsynth.

Reproduced here too. I’m pretty sure there is a bug (in renoise or fluidsynth dssi, I don’t know) where you can’t load more than one instance of fluidsynth dssi, I’ve also come across it before. Actually, you can load more than one instance but if you load one, then add a SF2 to it, then try to open another instance you get the same message.

Check. I’d say it’s probably a bug in 64bit versions of renoise, because it used to work on my old 32bit setup, when i was using renoise 2.8… just tested 2.8.2 64bit and it also crashes. Though multiple instances of fluidsynth-dssi looks like it’s working fine in rosegarden (64bit)…

/* edit */ …mkay, futzing around with pianoteq and fluidsynth in renoise 3.0.1, the whole renoise (not just the plugin) just crashed completely :confused:

/*edit2 */ Ok, try this:

Load an instance of fluidsynth as instrument 1
Add a soundfont to instrument 1’s fluidsynth instance
Load an instance of fluidsynth as instrument 2
(oops bug illustrated above)
Right click instrument 1, select “clear”
Either undo,or load an instance of fluidsynth as instrument 1

Result: entire renoise interface becomes unresponsive. (in my previous “crashed completely” i meant it seems like a segfault, but now it just hangs there)

Terminal output: http://www.deimos.ca/miscjunk/renoise-fluidsynth-log.txt

“”“Renoise LOG> DSSI: Warning: Plugin ‘FluidSynth-DSSI’ provides no ‘run_synth’ but only a ‘run_multiple_synths’ processing function, which is not supported by Renoise. Running multiple instances of this plugin may result into crackles or crashes…”""

This seems to be the problem - the cause. It’s the plugin which crashes and not Renoise.

If I remember well “run_multiple_synths” can not safely be used in a multi-core environment when multiple instances of a synth are calculated concurrently in multiple threads (multiple cores). We’re calling “run_multiple_synths” with just one synth instance as parameter then.

So we’d either need to disable multi-core processing of such DSSIs or ask theFluidSynth devs to add a “run_synth” proc too. Need to research this a bit first.

Ah, thank you very much for the information Taktik! I had indeed noticed that line in the log file, just a while after i made the above post. Anyway, i forwarded this information to the author of fluidsynth-dssi, hoping it could be of use in debugging this…

For now you could also try disabling multi-CPU processing of fluidsynth viahttp://tutorials.renoise.com/wiki/Plugin#Plugin_Compatibility_Options

If that helps, we’ll disable this option by default for fluidsynth and other DSSIs which do not provide a “run_synths”.

But songs with multiple fluidsynth instances will then obviously alsoperform slower on multi-cpu setups.

It’s already disabled, that’s what i don’t get. I had completely forgotten about that setting, until i got a reply from the developer of fluidsynth, and hexter, which also gives a similar compatibility problem of crackling, but at least it doesn’t crash… anyway, here’s what he said:

_> “”"Renoise LOG> DSSI: Warning: Plugin ‘FluidSynth-DSSI’ provides no

‘run_synth’ but only a ‘run_multiple_synths’ processing function,
which is not supported by Renoise. Running multiple instances of
this plugin may result into crackles or crashes…“”"

This seems to be the problem - the cause. It’s the plugin which
crashes and not Renoise._

That’s exactly right. The plugin is crashing because Renoise is calling
it in a manner explicitly forbidden by the DSSI API.

_> If I remember well “run_multiple_synths” can not safely be used in

a multi-core environment when multiple instances of a synth are
calculated concurrently in multiple threads (multiple cores). We’re
calling “run_multiple_synths” with just one synth instance as
parameter then.

So we’d either need to disable multi-core processing of such DSSIs
or ask the FluidSynth devs to add a “run_synth” proc too._

A bit of background: run_multiple_synths was added to DSSI in large
part to support FluidSynth, which expects to be able to process all
synth instances in one function call. In contrast, some synth hosts
need to be able to call each instance’s process function in graph
order–rearranging the call graph to allow a single call to FluidSynth
is either impossible or just way too ugly. So three things come to mind:

  1. If the Renoise devs can rearrange things so as to only call
    run_multiple_synths once for all instances, that’s great, but I’m
    guessing that it would be more work than it’s worth. If that’s not
    possible, they should disallow creation of more than one instance of a
    DSSI plugin that does not provide run_synths (currently only
    FluidSynth-DSSI and hexter fall into this category) or make that
    warning more prominent (a pop-up window instead of just a log entry).

  2. Realisticly, FluidSynth will never be rewritten to support what the
    host->DSSI_plugin->FluidSynth system needs for run_synths.

  3. FluidSynth-DSSI could be rewritten to provide run_synths, but it
    would be a major hack, and I’m not likely to get to that any time soon.

Wish I could be of more help on this,

-Sean

…so, i’m guessing we’d need a global switch in the prefs window to disable multi-core support for such DSSI plugins, right?

This used to work on my old setup, at first i suspected it was a new bug in Renoise 3.0.1 or 3.0.0, when i tested and saw that wasn’t the case i then thought it might be 32bit vs 64bit, i had completely forgotten about the multi-core thing.

Update: Enabling edit -> preferences -> plug/misc -> “Run all plugins in sandboxes” seems to temporarily fix the problem, except each instance loads its own copy of the soundfont file, if several ones are using the same one - which means much slower loading of fluidsynth-heavy modules, and more memory usage.

wow, it works. thanks. no more crashes. great!