Subject: Re: [linux-audio-dev] MCS: 64 bit timestamps? [simplified]
From: David Olofson (audiality_AT_swipnet.se)
Date: ti loka 12 1999 - 01:38:14 EDT
On Tue, 12 Oct 1999, Roger Larsson wrote:
> > tsc_t current_cycle_counter;
> > tsc_t cycle_diff;
> > msc_time_t now;
> >
> > current_cycle_counter = read_tsc ();
> > cycle_diff = current_cycle_counter -
> > cycle_counter_at_start_of_control_loop;
>
> What happens when the cycle_diff starts to wrap :-)
As long as we make sure to use the right data types, the wrapping
will magically disappear from the result! Ever programmed Amiga mice
or other quadrature encoders with hardware counters? :-)
> What 'samples_per_cycle' the requesting plugins, or a master, or ...
The timing master audio card. That is, the one that the engine is
synchronized to.
> Do we really like to have float calculations here? At least we should
> make it double to handle the 64 bit cycle_diff.
Clever integer manipulation works fine as well. However, it's easier
to do in asm than in C...
> Note: this is not SMP safe if people uses processors with
> different speeds... some are...
Hmm... *S*MP is not the correct term in that case. :-)
Anyway, that's why the OS should provide wrappers for this kind of
things.
> And I think there have been some issues with unsynchronised
> cycle counters...
If both CPUs are clocked from the same osc, it shouldn't be a
problem. Unless it's caused by a flawed APM implementation or
something. (Lowering the clock frequency when sleeping...)
//David
·A·U·D·I·A·L·I·T·Y· P r o f e s s i o n a l L i n u x A u d i o
- - ------------------------------------------------------------- - -
·Rock Solid David Olofson:
·Low Latency www.angelfire.com/or/audiality ·Audio Hacker
·Plug-Ins audiality_AT_swipnet.se ·Linux Advocate
·Open Source ·Singer/Composer
This archive was generated by hypermail 2b28 : pe maalis 10 2000 - 07:27:13 EST