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

2002-04-18 Thread Takashi Iwai
At Wed, 17 Apr 2002 09:14:32 -0400, Paul Davis wrote: > > >the best way is to retrieve the corresponding macro (e.g. get_cycles) > >for each architecture from asm/timex.h, and merge it into your > >source (or create a local header file). > > "#include " > > doesn't tell you where the header liv

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

2002-04-17 Thread Tim Goetze
Juan Linietsky wrote: >Well, besides that i just tried it and my test program doesnt go above >0.00%, and sometimes 0.01% on my duron 850, I agree that it would be ki >nda overkill anyway. Still that's not the most practical behavior to sh >aring rtc between programs, what I meant to say with ma

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

2002-04-17 Thread Juan Linietsky
On Wed, 17 Apr 2002 13:01:00 +0200 (CEST) Tim Goetze <[EMAIL PROTECTED]> wrote: > Juan Linietsky wrote: > > >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

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

2002-04-17 Thread Takashi Iwai
At Tue, 16 Apr 2002 19:14:27 -0400, Paul Davis wrote: > > Sure (thanks to Kai for pointing out > > -- > > #include > >... >cycles_t cycles = get_cycles(); >... > > --

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

2002-04-16 Thread xk
> I think he meant using it for measuring the time between calls, > in unixes we have gettimeofday for this, but in windows there isnt really any way to do it, since there's no way to get high res timing beyond 10ms. Actually there is (QueryHighPerformanceCounter). It's accuracy it's better that

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

2002-04-16 Thread Juan Linietsky
On Wed, 17 Apr 2002 01:14:28 +0200 (CEST) Tim Goetze <[EMAIL PROTECTED]> wrote: > xk wrote: > > >In Windows I use the rdtsc assembler instruction. It returns a 64 bit > >integer (in EAX:EDX I think) which represent the amount of processors cycles > >that have passed from the last reset. Computin

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

2002-04-16 Thread Juan Linietsky
On Tue, 16 Apr 2002 09:34:21 -0400 Paul Davis <[EMAIL PROTECTED]> 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 sign

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

2002-04-16 Thread Tim Goetze
xk wrote: >In Windows I use the rdtsc assembler instruction. It returns a 64 bit >integer (in EAX:EDX I think) which represent the amount of processors cycles >that have passed from the last reset. Computing the difference between two >values and taking into account the freq of the CPU (you have

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

2002-04-16 Thread Paul Davis
>one remark on the code paul posted: occasionally interrupts can be >dropped if a higher priority thread is present on your system >(RT audio on a single processor for example); so you cannot just >assume time has advanced by 1 / rtc_frequency seconds per poll >return. the assumption in the cod

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

2002-04-16 Thread Paul Davis
>In Windows I use the rdtsc assembler instruction. It returns a 64 bit >integer (in EAX:EDX I think) which represent the amount of processors cycles >that have passed from the last reset. Computing the difference between two >values and taking into account the freq of the CPU (you have to figure i

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

2002-04-16 Thread Tim Goetze
Nick D wrote: >On Tue, 16 Apr 2002 09:34:21 -0400 >Paul Davis <[EMAIL PROTECTED]> wrote: > >> >I need to do some timing code - for some basic kind of sequencing.. >> > [..] >> >What approaches have people used, and how successful were they? >> >> poll(2) on /dev/rtc. You will need to be root, or

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

2002-04-16 Thread xk
In Windows I use the rdtsc assembler instruction. It returns a 64 bit integer (in EAX:EDX I think) which represent the amount of processors cycles that have passed from the last reset. Computing the difference between two values and taking into account the freq of the CPU (you have to figure it ou

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

2002-04-16 Thread Nick D
On Tue, 16 Apr 2002 09:34:21 -0400 Paul Davis <[EMAIL PROTECTED]> wrote: > >I need to do some timing code - for some basic kind of sequencing.. > > [..] > >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, > t

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

2002-04-16 Thread rm
On Tue, Apr 16, 2002 at 01:27:49PM +, Nick D wrote: > Hi all, > > 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 approach >for accurate timing. > > I've played around with using signals for thi

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

2002-04-16 Thread Paul Davis
>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

[linux-audio-dev] best method for timing

2002-04-16 Thread Nick D
Hi all, 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 approach for accurate timing. I've played around with using signals for this - with setitimer(..) and then catching the signal, but it doesnt l