Re: [linux-audio-dev] Latency .. fullduplex case

New Message Reply About this list Date view Thread view Subject view Author view Other groups

Subject: Re: [linux-audio-dev] Latency .. fullduplex case
From: Eli Brandt (eli_AT_v.gp.cs.cmu.edu)
Date: ti syys   14 1999 - 20:52:04 EDT


sbenno_AT_gardena.net wrote:
> On Tue, 14 Sep 1999, Benjamin GOLINVAUX wrote:
> > Could we safely assume that the iolatency is two times the one shot latency
> > with two threads, one for audio in and one for audio out ? Any sync issues ?
>
> No that is not true, IO-latency is not 2* output-latency, since
> you read/write 1 fragment at time, you can just add one single fragment
> to the buffer to keep things reliably.

Let me take a whack at this as see if I get the same result. The
important time here is the worst-case latency from when a blocking I/O
call is done to when my program gets control back.

start with input empty, output full.
        action timespan
read() is done F fragment length in msec
return from read() L worst-case interrupt-to-running time
new fragment is computed a*F a is realtime ratio, 0 < a < 1.
call write()

total time (1+a)F + L, which approaches 2F + L.
we need N fragments buffered, where NF > 2F + L, so N > 2 + L/F.

we're using 32-frame fragments, F = 0.73 ms.
L = 1.4 ms (yeehaw).
so N > 2 + 1.92, i.e. N = 4 fragments (2.8 ms actually).
great, same result -- if you like formulas, here you got 'em.

-- 
     Eli Brandt  |  eli+@cs.cmu.edu  |  http://www.cs.cmu.edu/~eli/


New Message Reply About this list Date view Thread view Subject view Author view Other groups

This archive was generated by hypermail 2b28 : pe maalis 10 2000 - 07:27:12 EST