From alsa-devel-owner@alsa.jcu.cz  Fri Nov 27 20:51:11 1998
Received: from mail.alphalink.com.au (mail.alphalink.com.au [203.24.205.7])
	by marvin.jcu.cz (8.9.1a/8.9.1) with ESMTP id UAA27652
	for <alsa-devel@jcu.cz>; Fri, 27 Nov 1998 20:49:25 +0100
Received: from alphalink.com.au (andrew@ppp12-14-Melbourne.alphalink.com.au [202.164.244.43]) by mail.alphalink.com.au (8.8.8/8.6.9) with ESMTP id GAA07610 for <alsa-devel@jcu.cz>; Sat, 28 Nov 1998 06:49:23 +1100
Message-ID: <365F022C.69E3D584@alphalink.com.au>
Date: Sat, 28 Nov 1998 06:49:00 +1100
From: Andrew Clausen <clausen@alphalink.com.au>
MIME-Version: 1.0
To: alsa-devel@jcu.cz
Subject: Re: Linux sound cards latency
References: <Pine.LNX.3.96.981127135700.4886B-100000@entry.jcu.cz>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Reply-To: alsa-devel@alsa.jcu.cz
Sender: alsa-devel-owner@alsa.jcu.cz
Precedence: list

Jaroslav Kysela wrote:

> On Fri, 27 Nov 1998, Thomas Sailer wrote:
>
> > Two things to keep in mind about latency:
> >
> > If there is IDE activity and you haven't
> > set hdparm -u 1 /dev/hd*, you loose.
> > (Int latency will be horrendously high).
> >
> > Also, some cards have a very long audio path
> > delay in hardware (usually depending on the
> > sampling rate), so the time a signal
> > arrives at its connectors may well be several
> > ms longer. This is an OS invariant.
> >
> > Some cards, such as ESS, also have rather deep
> > FIFO's (128 samples or so).
>
> Yes, all things are true. Maybe I forgot add notice that my test program
> measures only OS latency, not hardware latency. I don't know how to
> measure complete latency without some analog device which will be
> connected to soundcard's line-in and line-out.

Could you just measure the time between a peak on a feedback loop?  ie,
program the sound card in full-duplex mode, send a beep, and wait for it to
come back.  Ask the user to place the microphone as close to the speaker as
possible.  This should give some kind of indication...

> In most cases hardware have FIFO's up to 256 samples (in most hardware is
> FIFO around 16 bytes). This means that delay is by format 44100Hz, Signed
> Endian 16-bit, stereo:

> FIFO size               | Delay
> ------------------------+-------------------------------
> 256                     | 0.0014512472sec

> 16                      | 0.00009070294sec

Andrew Clausen


