For starters, one may start measuring average frequency of interrupt requests generated by both cards provided both of the play the same length buffer.
The measure of the average frequency will be the computers RTC. I am not saying that it is simple, and yes, prior knowledge, like NTP, should be reused. On Fri, 30 Dec 2005 17:36:28 -0500 [EMAIL PROTECTED] (Ross Vandegrift) wrote: > On Fri, Dec 30, 2005 at 12:45:48PM +1000, Adam Nielsen wrote: > > I've always wondered about this. Fair enough that two cards would play > > back sound at slightly different speeds, but why can't you just drop a > > sample or two every few milliseconds or so, to keep the sound roughly in > > sync? > > How do you know how much to slew the playback by? > > Say I have two sound cards in my box. Each sound card has an > independent crystal that generates a clock for timekeeping. The > crystals are rated to resonate at some fixed frequency, but there will > always be a margain of error. Even two "identical" parts from the > same manufacturer will produce different errors in their clock. > > At first, the issue isn't a big deal, since the difference may be > small. But as time ticks by, many small differences begin to add up > to bigger and bigger difference. This type of error is called drift. > > In addition, a crystal is a physical process, and so occasionally > there are abberant ticks. This causes sudden loss of time tracking. > This type of error is called jitter. > > The two together are a deadly combination. You need some way of > mitigating both to keep stuff in sync. One way is to use some > out-of-band data to slave one card to the other card's timesource. > Lots of pro gear does this with word clock, spdif links, and the like. > > You can solve the problem for your PC's internal clock with NTP. > Moreover, if you're interested in timekeeping issues like this, the > NTP research papers are an amazing source of a huge amount of > information on this kind of stuff. > > -- > Ross Vandegrift > [EMAIL PROTECTED] > > "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 > ------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click _______________________________________________ Alsa-user mailing list Alsa-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/alsa-user