fluid-dev
[Top][All Lists]
Advanced

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

Re: [fluid-dev] What is the best way start fluidsynth with zero/low late


From: Pedro Lopez-Cabanillas
Subject: Re: [fluid-dev] What is the best way start fluidsynth with zero/low latency?
Date: Fri, 22 May 2009 12:16:55 +0200
User-agent: KMail/1.9.6 (enterprise 20070904.708012)

On Thursday, May 21, 2009, Joan Quintana wrote:
> if you avoid Jack and use alsa directly, I have my doubts in setting
> latency (help is appreciated):
>
> $ fluidsynth -a alsa -m alsa_seq -l AI-APiano02trans.sf2
>
> > settings
>
> audio.periods            16
> audio.period-size        64
> synth.sample-rate        44100.000
> -> 64 * 16 / 44100 = 23.2 ms
> these are default values. But if I try my own settings, I find the same
> settings.
>
> $ fluidsynth -m alsa_seq -a alsa -o synth.sample-rate=44100.000
> audio.periods=2 audio.periods-size=32 -l  AI-APiano02trans.sf2
>
> > settings
>
> audio.periods            16
> audio.period-size        64
> synth.sample-rate        44100.000
>
> How can I tune and control real latency using -a alsa?

If you want to use directly the option names in the FS command line, you need 
to  give -o for each one, for instance:

$ fluidsynth -a alsa -r 48000 -o audio.period-size=64 -o audio.periods=2 \
             -o audio.alsa.device=hw:0 xxx.sf2

But it is exactly the same using this (much shorter) syntax:

$ fluidsynth -a alsa -r 48000 -z 64 -c 2 -o audio.alsa.device=hw:0 xxx.sf2

Note that the real hardware buffer size may also depend on the software layer. 
If you access the device directly (-o audio.alsa.device=hw:0) the driver 
tries to use the provided sizes, but if you use the layer "plughw:x" the real 
buffers may be larger. In both cases ALSA may decide to use different values, 
if the provided ones are outside the allowed boundaries. You can watch the 
ALSA hardware parameters, looking a control file:

$ cat /proc/asound/card0/pcm0p/sub0/hw_params
access: RW_INTERLEAVED
format: S16_LE
subformat: STD
channels: 2
rate: 48000 (48000/1)
period_size: 64
buffer_size: 128

The above command was executed after running FluidSynth with the following 
command line:

$ fluidsynth -a alsa -r 48000 -c 2 -z 64 -o audio.alsa.device=hw:0,0 

Regards,
Pedro




reply via email to

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