[linux-audio-dev] Re: [alsa-devel] Re: Timestamping

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

Subject: [linux-audio-dev] Re: [alsa-devel] Re: Timestamping
From: David Olofson (audiality_AT_swipnet.se)
Date: pe loka   29 1999 - 18:18:37 EDT


On Thu, 28 Oct 1999, Paul Barton-Davis wrote:
> i am a little sceptical of SGI's implementation, however - its not
> clear whether they are doing kernel/driver timestamping or
> inferencing. also, the fact that you cannot use read(2)/write(2)
> anymore is always a negative from my perspective, but hey, alsa-lib
> challenges that model already. i will just be sad to have to abandon
> read/write for MIDI in order to get timestamps, but i see no other way
> of doing it.

Well, an ioctl() that returns the timestamp of the next sample you'll
get from read() or write() seems possible to me, as a first idea...
What am i missing?

> i am very intrigued by their description of when the timestamp is done
> for audio. they claim to timestamp analog data at "the instant the
> voltage is sampled or produced" and digital data at the "edge of the
> recovered sample clock from the input signal or the driving sample
> clock for the output signal".
>
> do we have any hope of doing this ? does SGI ? :)

It's possible to do within a few µs (worst case 25 µs on a P120;
around 3 on a Celeron) with RTLinux drivers, if the hardware is well
known and/or calibrated. I don't know the figure for standard Linux
with the lowlatency patch, but the "average" case should be about the
same as with RTL. Drivers with slow IRQ handlers will make the worst
case orders of magnitude worse, though.

Calibration at this level is non-trivial, at least to the average
user; you need to be able to generate and measure signals with some
device with known, or at least very low latency. A driver, a buffer
and two probes connected to the parallel port shold do.

Of course, we could measure the latencies of all hardware we can get
at, and build reasonable defaults into the drivers. Should hit within
some .1 ms or so, probably better.

//David

 ·A·U·D·I·A·L·I·T·Y· P r o f e s s i o n a l L i n u x A u d i o
- - ------------------------------------------------------------- - -
    ·Rock Solid David Olofson:
    ·Low Latency www.angelfire.com/or/audiality ·Audio Hacker
    ·Plug-Ins audiality_AT_swipnet.se ·Linux Advocate
    ·Open Source ·Singer/Composer


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:28:00 EST