Re: [linux-audio-dev] best method for timing

New Message Reply About this list Date view Thread view Subject view Author view Other groups

Subject: Re: [linux-audio-dev] best method for timing
From: Juan Linietsky (coding_AT_reduz.com.ar)
Date: Wed Apr 17 2002 - 03:49:20 EEST


On Tue, 16 Apr 2002 09:34:21 -0400
Paul Davis <pbd_AT_Op.Net> wrote:

> >I need to do some timing code - for some basic kind of sequencing..
> >Since ive not written this kind of stuff before, i'm unsure as to the best app
> >roach for accurate timing.
> >
> >I've played around with using signals for this - with setitimer(..) and then c
> >atching the signal, but it doesnt look too good - it can be 1000s of usecs out
> >..
> >
> >What approaches have people used, and how successful were they?
>
> poll(2) on /dev/rtc. You will need to be root, or have CAP_RESOURCE,
> to set the frequency of the clock to a useful value, and you will need
> to run SCHED_FIFO to not have the kernel scheduler mess things up.
>
> ardour and softwerk (which doesn't compile right now) both have code
> for the RTC. In fact, I'll include ardour's below - its very simple
> really. Any parts that are not clear are almost certainly not
> necessary :)

RTC is cool, but has the problem that only one program can use it
at the same time. Do you know if there is any patch aviable to
make RTC shareable? I know RTC works by using int 8 in x86
and that high timings in a very old machine can hog the cpu due to the high amount of irq calls. But in the case of nowadays computers, i dont see why it should be a problem to have rtc enabled by default to the max speed and give each client frequencies based on divisors of it.

regards.

Juan Linietsky


New Message Reply About this list Date view Thread view Subject view Author view Other groups

This archive was generated by hypermail 2b28 : Wed Apr 17 2002 - 03:35:58 EEST