Re: [Jack-Devel] how often should one call jack_port_get_latency_range()

PrevNext  Index
DateWed, 13 Jul 2011 10:01:41 -0400
From Paul Davis <[hidden] at linuxaudiosystems dot com>
ToRobin Gareus <[hidden] at gareus dot org>
CcJACK Mailing List <[hidden] at lists dot jackaudio dot org>
In-Reply-ToRobin Gareus Re: [Jack-Devel] how often should one call jack_port_get_latency_range()
On Wed, Jul 13, 2011 at 9:57 AM, Robin Gareus <[hidden]> wrote:
> On 07/13/2011 03:34 PM, Paul Davis wrote:
>> On Wed, Jul 13, 2011 at 9:30 AM, Robin Gareus <[hidden]> wrote:
>>> G'day!
>>>
>>> I have a JACK client with a single audio-input-port (no output). This
>>> input is used to parse Linear-Time-Code. For synchronization the
>>> application needs to know the capture-latency of said audio-port.
>>>
>>> So the question is: how often should the application call
>>> jack_port_get_latency_range() ?
>>>
>>> Currently it does so in every process_callback.
>>>
>>> Is this the correct solution?
>>
>> no.
>>
>>> The overhead may be minimal, but still it feels somewhat wrong to poll
>>> it during every process() cycle. Is there a callback that can be
>>> subscribed to to get notified of changes to port-latencies?
>>
>> From the documentation of jack_set_latency_callback():
>>
>>  * Tell the Jack server to call @a latency_callback whenever it
>>  * is necessary to recompute the latencies for some or all
>>  * Jack ports.

sorry, i was not thinking straight.

you should use a graph reorder callback for your purpose. it is always
called *after* latency computations are done.
PrevNext  Index

1310565715.17007_0.ltw:2,a <CAFa_cKmt3Obs9Vt-Urym=mRme1F3_0NUznjpMhLtcZ1S_fWmjQ at mail dot gmail dot com>