Linux and Latency
geiger at epy.co.at
Thu Aug 19 16:34:32 CEST 1999
Miller Puckette writes:
> Hi Guenter & Reine,
> Well, I hacked pretty hard on the sound support for 0.26 (so
> making "-audiobuf" use the GETISPACE/GETOSPACE ioctls for instance.)
> On drivers that support those features (like my Creative PCI driver)
> this works great, but apparently I really should be offering a
> "-stupid-linux-audio-driver" flag to go back and do it the 0.25
> way with -setfragsize or whatever. I confess I don't know what the
> fragment size business even does, but on PCI128 it's nowhere as good
> as using GETISPACE/GETOSPACE.
Ah, I see. (the following is some technical blurb ...)
I didn't dig too much into the code and therefore didn't
realize what the GETISPACE/GETOSPACE business is really about.
I just never thought of solving the audiobuffer problem this way.
Apparently this works very good for bus master PCI cards, like the PCI128,
but it may give problems with ISA cards, because they use the PC's
DMA to transfer data.
Information how much data is already transported can only be given
accurately blockwise (or rather fragment wise).
In other situations some drivers ask the DMA how much data is
transferred, which is, considering the slowness of ISA DMA suboptimal.
Some drivers may just give you numbers rounded up/down to the
In this situation it is better to use small fragmentsizes, and
more fragments. Fragmentsize times fragmentnumber gives you the
number of bytes in your audiobuffer.
The whole fragmentsize/fragmentnumber business is sort of alchemy,
and nobody knows which is the perfect combination of size and number.
(Reine lately supposed a setting which was used in Bill Schottsteads
snd program and is working good for his setup).
</end of blurb>
My proposal is therefore to use "-fragmentnumber" and "-fragmentsize"
for the OSS version, together with a README file which lists some
settings for different soundcards. (We can collect them here at the list).
.... and work on the ALSA interface
More information about the Pd-list