Re: [linux-audio-dev] precise event timer examples (HPET?)

From: Clemens Ladisch <clemens@email-addr-hidden>
Date: Tue May 30 2006 - 10:23:58 EEST

Alex wrote:
> Does anyone have any examples that use HPET (or any other high
> resolution event) timers? I've built HPET support into my kernel but
> I cannot figure out how to compile the example given in the
> documentation :
> /usr/src/linux-2.6.12/Documentation/hpet.txt

/dev/hpet didn't quite work in kernels before about 2.6.15 because of
various bugs.

The example program uses a kernel header that probably isn't available
to user space programs.

And if you got it to compile, it probably wouldn't run because the third
timer is the only one available (the first two are used for the system
timer and for RTC emulation, respectively), and most BIOSes don't
initialize the third interrupt.

> I'd like to have micro-second precision and I'm wondering if there is
> a better way then polling the time of day?

When HPET is enabled, gettimeofday() uses it.
What is the output of "dmesg | grep -i hpet"?

If you want to avoid the syscall overhead, you can try to call mmap() on
/dev/hpet and read the timer directly. In that case, you don't need to
use any header.

HTH
Clemens
Received on Tue May 30 12:15:08 2006

This archive was generated by hypermail 2.1.8 : Tue May 30 2006 - 12:15:08 EEST