On Monday, May 25, 2009, address@hidden wrote:
Quoting Pedro Lopez-Cabanillas <address@hidden>:
> On Saturday, May 23, 2009, Louis B. wrote:
>> Thanks for the info. I have just update the wiki with information on
>> how to run fluid on a netbook. see
>> http://fluidsynth.resonance.org/trac/wiki/LowLatency. Please correct
>> it if it is wrong or you want to add anything else.
>
> "Also halving the sample rate with the flag '-r22050' helps a lot."
>
> I doubt the above advice would be beneficial for latency. On the
> contrary, running FluidSynth with a native sound card sample rate will
> give the better results, because reducing the sample rate requires ALSA
> to perform software interpolation (by the plughw: layer) to transform the
> buffers into the native frequency before sending it to the hardware. This
> requires larger buffers and consumes CPU cycles. On the other hand, using
> the native frequency allows you to use the hw: interface directly.
>
> By the way, which netbook are we talking about? Which Linux distro?
>
> Regards,
> Pedro
If the system is running out of CPU and the sound card actually works
with 22050 natively, then it could help reduce CPU usage, thus
preventing CPU starvation. Another idea is to decrease
synth.polyphony in that case though.
Louis said that he is using an eeepc 901. According to my sources this device
has an integrated Intel HDA sound card:
http://array.org/ubuntu/status.html?model=eeepc-901
The HDA cards allow only a very restricted set of native sample rates,
typically only above 44.1 KHz, so I found very improbable that sr=22050 is
natively supported. This can be verified compiling and running the attached
program. Here are some results obtained on my Asus laptop:
$ ./alsa-rate
supported sample rates for hw:0,0 : min=44100, max=192000
$ ./alsa-rate dmix
supported sample rates for dmix : min=48000, max=48000
$ ./alsa-rate plughw
supported sample rates for plughw : min=4000, max=4294967295
$ ./alsa-rate default
supported sample rates for default : min=4000, max=4294967295
Note that "dmix", "plughw" and "default" are not native, they are software
conversion layers.
Regards,
Pedro