[LAD] [Jack-Devel] How is the TSC calibration accuracy on dual core 2 computers? (And what about HPET?)

Jussi Laako jussi at sonarnerd.net
Tue Apr 28 20:09:48 UTC 2009

Kjetil S. Matheussen wrote:
> I've looked at the HPET code in jack, but am unsure how accurate it is,
> and whether there are any overhead using it?

Resolution on my machine is 1 / 14.318180 MHz. Frequency can vary
typically from 12 to 16 MHz. Access is usually rather fast through MMIO.
Accuracy can vary depending on hardware and environment, same applies
even more for TSC.

> that's the accuracy of usleep(). So it looks promising, but
> I need at least 0.1ms accuracy...

In my opinion, clock_gettime() with CLOCK_MONOTONIC is pretty good if
kernel is using reasonably good clock source. You can check the current
one by "cat
/sys/devices/system/clocksource/clocksource0/current_clocksource". Over
rather long periods, CLOCK_REALTIME with good NTP sync would probably be
a good choice.

Over what time span you would need that 0.1 ms accuracy?

	- Jussi

More information about the Linux-audio-dev mailing list