fluid-dev
[Top][All Lists]
Advanced

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

Re: [fluid-dev] How to optimize Fluidsynth latency in Windows?


From: Pedro Lopez-Cabanillas
Subject: Re: [fluid-dev] How to optimize Fluidsynth latency in Windows?
Date: Sun, 18 Apr 2010 14:13:17 +0200
User-agent: KMail/1.9.6 (enterprise 20070904.708012)

On Friday, April 16, 2010, EarMaster - Hans Jakobsen wrote:
> The default value on Windows is Audio.periods=8 and Audio.Period-Size=512,
> which gives an unacceptable high measured latency (>100 ms).

It may be unacceptable depending on the usage. Pipe organ players must learn 
to live with even bigger values. You can adapt, with proper training.

To put this in perspective, the speed of sound in dry air at 20 ÂșC is 343 
meters per second. So 100 ms is equivalent to a distance by air of 34.3 
meters from the ear to the sound source. If you put your speakers at a 
distance of 3.43 meters from your head, the latency is 10 ms.

> How can I reduce the latency on Windows?
>
> (I did see the Wiki about Latency, but it focuses only on Linux)

The wiki page has specific tips for ALSA, but most of the information is 
independent of the platform. The most important factors that limit the lowest 
artifact free latency that can be achieved are:

1. The hardware audio device
2. The operating system drivers for the hardware audio device.

If you need professional quality, you need professional grade components.

> Are there better combinations of periods and Period-Size? - or other
> parameters I can adjust?
>
> I believe some of the latency is caused by the use of Directsound, but what
> are the alternatives?
>
> I see that ASIO support is not yet implemented, but how much improvement
> can I expect from ASIO compared to the 80 ms with DirectSound?

I've tested FluidSynth 1.1.1 with two audio devices in my Asus laptop using 
Windows XP, and here are the results using 48 KHz (native sample rate). If 
you don't use a native sample rate for the audio device, the OS may need to 
resample the audio streams, using additional buffers and generating bigger 
latency.

* With the internal sound device, identified as "Realtek HD Audio", the 
minimum is 3 periods x 1024 bytes. Latency = 3x1024/48000 = 64 ms.

* With a set of external USB speakers, the minimum is 4 periods x 512 bytes, 
latency about 43 ms.

I've also tested in a friend's computer a SoundBlaster X-FI Titanium 
Professional, and for my surprise the minimum was 2 periods x 256 bytes, 
about 10 ms at 48 KHz. 

So, using DirectSound and the native sample rate of the audio interface it is 
possible to achieve low latency with adequate audio hardware and operating 
system drivers, even without ASIO (provided only by professional sound cards, 
anyway). The best settings depend on the audio card and drivers.

Regards,
Pedro




reply via email to

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