Re: [Alsa-user] Keeping multiple cards in sync (was: Assertion `snd_pcm_format_linear(slv->format)'
Brought to you by:
perex
From: <ro...@lu...> - 2005-12-31 18:44:21
|
On Sat, Dec 31, 2005 at 02:11:19PM +0200, Sergei Steshenko wrote: > - I have already suggested to measure average interrupt request frequency. > > If a card is playing N samples buffer with actual sampling frequency Fs, then > time between interrupts per buffer empty is (N / Fs), i.e. for two cards it will be > (N /Fs1), (N/Fs2) respectively. > > That is, average interrupt request frequency will be (Fs1/N), (Fs2/N) > respectively. > > The device to measure the time can be the computer RTC (Real Time Clock) > which is independent from both Fs1, Fs2. Hmmm, wouldn't this approach require constant playback? You need a way to track and correct jitter, and if you're not actively playing audio (ie, generating interrupts to be measured), you won't know anything about what jitter has affected your time source. This would probably work really well on multi-channel cards - dedicated one channel to playback silence all the time and use the results to sync playback across the two clocks. But that still prevents people from getting a lot of channels from cheap cards. That's the great thing about the RTC clock - it's job is just to tick! -- Ross Vandegrift ro...@lu... "The good Christian should beware of mathematicians, and all those who make empty prophecies. The danger already exists that the mathematicians have made a covenant with the devil to darken the spirit and to confine man in the bonds of Hell." --St. Augustine, De Genesi ad Litteram, Book II, xviii, 37 |