Re: [linux-audio-dev] MTC, SMPTE, etc.

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

Subject: Re: [linux-audio-dev] MTC, SMPTE, etc.
From: Paul Winkler (slinkp23_AT_yahoo.com)
Date: Sat Jul 22 2000 - 01:47:47 EEST


Paul Barton-Davis wrote:
(snip)
> .... How can they ever drift this far apart ? This is a rhetorical
> question: I'm not doubting for a moment that they do. I just don't
> quite understand how this can happen. I can understand that they are
> not using the same sample clock, and so 44100 samples from one card
> might represent an elapsed "wall clock" time of 1.02 seconds and 0.98
> seconds on the other. But what has actually happened here ? Stretch
> this out until we have, say, a full 1 second out-of-sync. Ah, I
> see. We've read, say, 441,000 samples from both cards, but the last
> sample (in particular) from each card is derived from the analog
> signal sampled at a completely different time.

That sounds right to me.
 
> Note, interestingly, how bad this is for the idea of using audio
> devices as a timer for, say, the ALSA sequencer ...

Well, only if you use one audio device for your timer and another
for audio at the same time. But people might very well do just that,
since they might have one card with a nicer synth and another with a
nicer ADC & DAC.

The frustrating thing is that many cheap soundcard codecs (e.g.
Crystal CS-4237B and probably many others) have a clock sync
capability, but soundcard manufacturers never provide a jumper for
running one soundcard off another one's clock. I don't know why the
hell not. Probably because the number of people who really want to
use two soundcards at one time seems pretty marginal to them. You'd
have to do some scary soldering and maybe some driver hacking to get
it to work.
 
In theory, you could resample data from one card to sync it to the
other card. But then you're mucking about with the audio from one of
the cards... you wouldn't care about that for SMPTE, but then you
have to ask if burning that CPU time is better than using an extra
channel of your nice soundcard for SMPTE.

And for there to be any point in trying to resample, you'd have to
*very* accurately measure the difference between the soundcard
clocks. You could probably measure it with some procedure like:

--plug output of card A into input of card B
--send an audio stream to card A, with a big peak at the beginning
and one at the end.
--record samples from card B
--count samples between peaks recorded from card B; compare to known
count sent to soundcard A.

Also I don't know how stable crystal oscillators are -- i assume
pretty stable, but to what degree of accuracy? If the clocks drift
at all, you're going to have to repeat this procedure frequently.

-- 
.................    paul winkler    ..................
slinkP arts:   music, sound, illustration, design, etc.
        web page:  http://www.ulster.net/~abigoo        
      A member of ARMS:   http://www.reacharms.com
               or http://www.mp3.com/arms


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

This archive was generated by hypermail 2b28 : Sat Jul 22 2000 - 06:12:25 EEST