[linux-audio-dev] Re: Hammerfall latency confusion in german"Keyboards" articles ?

Ivica Bukvic ico at fuse.net
Sun Nov 2 01:30:26 UTC 2003


> -----Original Message-----
> From: linux-audio-dev-bounces at music.columbia.edu
[mailto:linux-audio-dev-
> bounces at music.columbia.edu] On Behalf Of Benno Senoner
> Sent: Saturday, November 01, 2003 5:03 PM
> To: linux-audio-dev at music.columbia.edu
> Subject: [linux-audio-dev] Re: Hammerfall latency confusion in
> german"Keyboards" articles ?
> 
> hmmm, I'll try to respond to my own question:
> 
> (hoping having done the math correctly):
> alsa-kernel/pci/rme9652/hdsp.c:
> hdsp->period_bytes = 1 <<
((hdsp_decode_latency(hdsp->control_register)
> + 8));
> 
> latency register is 3 bit long, set all 3 bit to 0 and you get the
> lowest possible latency:
> period_bytes=1 << (0+8) = 256
> we are talking about 32bit words (24bit audio embedded in 32bit words)
> thus we need to divide bytes / 4
> we get 64.
> one period = one fragment thus I assume the minimum buffer size = 2 x
64
> = 128 samples which
> at 44100 = 3msec.  (the keyboards test were done at 44.1kHz).

All that seems to be correct. However AFAIK, the higher the sampling
rate the lesser amount of time do those 128 samples encompass. Hence if
you have double the sampling rate 88200Hz, then 128 samples ends up
being only ~1.5ms. Of course you could go really crazy and do 192000, in
which case latencies would be sub-millisecond. There is obviously still
a question whether any kernel on the face of earth would be able to
provide soundcard with data in time in order to avoid dropouts...

Ico





More information about the Linux-audio-dev mailing list