Technology has known calibration for quite a long time, so the cards (the sampling rate correction code rather) can be precalibrated. That is. before real palyback certain numbers of junk (zero filled ?) can be player in order to measure sampling frequency difference.
Now, even in real time of real playback interrupt handlers may still register interrupt occurrence times using that same RTC and to slowly adjust values in the sampling rate correction code. Yes, it is painful, but, I think, it's exactly the same problem as the one solved by NTP. I mean, signals propagate through network with essentially random delay, but it is still possible to calculate average drift, provided the drift itself does not change quickly. On Sat, 31 Dec 2005 13:44:14 -0500 [EMAIL PROTECTED] (Ross Vandegrift) wrote: > 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 > [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