[nama] Re: Latency compensation
- From: "S. Massy" <lists@xxxxxxxxxxxx>
- To: nama@xxxxxxxxxxxxx
- Date: Thu, 3 May 2012 14:22:55 -0400
On Wed, May 02, 2012 at 05:51:26PM -1000, Joel Roth wrote:
> Hi,
>
> I've finished a rough cut of coding for
> latency *measurement*.
>
> I need to go over it again, because there
> is a problem with units: LADSPA plugins
> return latency in milliseconds; JACK
> clients report latency in frames,
> where one frame is 1/sample rate.
>
> We'll need some work and creativity
> to test all this work, but for now
> if anyone has time to look over the code,
> I'm sure it will help.
It's fairly straightforward code: the only bit I couldn't wrap my
(admittedly small) mind around is this cascading assignment:
$setup->{sibling_latency}->{$_->wet_name}
= $setup->{sibling_latency}->{$_->dry_name}
= $setup->{track_latency}->{$_->wet_name}
= track_ops_latency($::tn{$_->wet_name})
+ $additional_latency
The code indeed needs to be fixed for mismatched units, as you say. Note
that frame/srate will give you a value in microseconds, not miliseconds,
so the code in loop_device_latency needs to be modified. Perhaps it
would make more sense to tally latency in samples separately and convert
it to miliseconds just once?
Cheers,
S.M.
Other related posts: