[alsa-devel] What is the required accuracy of audio sampling rate?

James Courtier-Dutton james.dutton at gmail.com
Wed Feb 17 13:52:57 CET 2010

On 16 February 2010 23:58, Yiliang Bao <yiliangb at gmail.com> wrote:
> Hi,
> I have a PCI-e audio card that does not give very accurate sampling rate
> (about -0.2% error, i.e., if I set the sampling rate to 8K, I got only 7984
> samples per second on average). It caused various synchronization problems
> in applications like gstreamer.
> Since there will be some difference from one clock domain to another, I am
> wondering if there is any defined tolerance on the sampling rate, and where
> the right place is to correct this kind of error. I would really appreciate
> if someone can point me to the related documents/links.

There is no defined tolerance on sampling rate.
Audio apps should be able to deal with a certain amount of error.
xine uses the system clock for its synchronization, and resamples the
audio output if the audio hardware is running at a different rate.
Other apps might use the audio clock and sync to that. In that case,
it might get the problems you describe.
Try playing your media in xine and see if the problem disappears.

Kind Regards


More information about the Alsa-devel mailing list