[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [fluid-dev] JACK connection problems with fluidsynth

From: David Henningsson
Subject: Re: [fluid-dev] JACK connection problems with fluidsynth
Date: Tue, 24 May 2011 08:52:27 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv: Gecko/20110424 Thunderbird/3.1.10

On 2011-05-23 16:51, Shamus wrote:
Hi David,

I'm using JACK for audio and ALSA for MIDI, but it doesn't matter if I
use JACK for both--the result is the same. If I run JACK in non-realtime
mode there is no kick-out anywhere, but this is an unacceptable mode of
operation as I use this setup for multi-track recording. I have an
M-Audio Delta Audiophile 2496, which is an ICE1712 based card.

The latency on JACK is 11.6 msec, according to QJackCtl, and this is
already skating on the high side of things. I have it set to 256 frames,
2 periods/buffer at a sample rate of 44.1KHz.

So resetting would take more than ~ 5 ms then...that's pretty much, I guess. Would be interesting to make a profile of that and see what's taking so long.

JACK version is 0.120.1.

As a side note, JACK2 is more forgiving towards applications not returning in time, but FS should work with both JACK versions.

If fluidsynth is just a wrapper around libfluidsynth, then I'm not sure
why Qsynth doesn't work correctly as it's basically just a GUI wrapper
around libfluidsynth. But perhaps it's related to the problem with
resetting fluidsynth from the command line: All the cases where kick-out
happens haven't been addressed yet.

Qsynth/fluidsynth used to work in the past with this configuration (I've
been using it for a few years at least!), so I'm not sure why it doesn't
work correctly anymore. :-/

It probably stopped working when we started caring about thread safety...

But I *do* know that the patch that was
posted to this list *does* work; apparently it just needs to be applied
to some other code paths (like the "reset" code).

Unfortunately it is not that simple - applying the patch as it was applied to the initialisation can only be done when the audio engine is not running in parallel. When you do a system reset, the audio can get calls in parallel, which ruins thread safety.

Looking into fluid_synth_system_reset in particular, it seems it might do some time intensive tasks in fluid_rvoice_mixer_reset_fx that could cause the timeout. In this case I guess we might have to move parts of the reverb and chorus to the non-realtime thread or something :-/

// David

BTW, Qsynth/fluidsynth are the only programs that exhibit this kick-out
behavior. All of the other JACK aware programs that I use (Rosegarden,
Ardour, Hydrogen) *do not* exhibit this kind of behavior.

Warmest regards,

-- Shamus

On 05/22/11 07:32, David Henningsson wrote:
Hi Shamus,

Being kicked out by Jack is essentially an optimization problem; Jack
kicks Fluidsynth out if it does not respond in time. I think this
timeout is configurable. Could it be that you're on the edge and just
need to adjust the timeout up a little bit, or increase the latency? In
general, it doesn't make sense that libfluidsynth would behave different
than the fluidsynth executable since the executable is just a wrapper
around libfluidsynth.

Also, are you using Jack for MIDI as well as audio, or do you use Jack
audio + alsa MIDI?

// David

reply via email to

[Prev in Thread] Current Thread [Next in Thread]