Minimum reasonable latency Was: Re: ZynAddSubFX was: Re: [linux-audio-dev] some new soundfiles on-line

Alfons Adriaensen fons.adriaensen at
Thu May 19 15:40:41 UTC 2005

On Thu, May 19, 2005 at 05:25:37PM +0200, Florian Schmidt wrote:

> ...
> The keypress cannot be scheduled for period N+1 (with constant delay) as
> the process_n() (which prepared the buffer that will be audible during
> period N+1) is already done. It can be put into the buffer by
> process_n+1(). This buffer will be audible after Irq N+2

> This breaks afaics the rule of _reliably_ constant delay. OTOH i don't
> qute grok it. Care to roll it out?

You shouldn't check for events int jack_process(), but in a separate
thread, linked to jack_process() using a lock-free circular buffer for
the [event+timestamp] data.

To get really accurate timing in all cases, this thread should even have
higher priority than the one created by jackd (*), otherwise all events that
occur while a jack_process() is running will be delayed until the end
of all processing for the current cycle.

(*) but lower than jackd's master thread. This is currently not possible
since the difference in priorities is just 1.


More information about the Linux-audio-dev mailing list