List Info

Thread: Basic question: frame time vs. last frame time vs. real time




Basic question: frame time vs. last frame time vs. real time
user name
2006-05-26 11:21:39
Greetings,

I probably just lack reading comprehension or have been
thinking about 
this for too long, but I managed to confuse myself
thoroughly trying 
to figure out how to relate non-audio events to the audio
stream time 
frame. I'd love to get an authoritative answer on whether
the 
following is correct, and if so, which parts of it are
guaranteed by 
the API and which parts are just incidental:

In the process function of a jack client application c with
an input 
port pi, an output port po and buffer size nframes, in the
absence of 
xruns or buffer size changes, the following statements are
true:

1. A sample that was audible when jack_frame_time(c) == t1
will 
(within reason, ignoring A/D etc.) end up in pi's input
buffer when 
jack_last_frame_time(c) <= t1 + jack_get_total_latency(c,
pi) && t1 + 
jack_get_total_latency(c, pi) < jack_last_frame_time(c) +
nframes at 
index jack_last_frame_time(c) - (t1 +
jack_get_total_latency(c, pi))

2. conversely, a sample written into po's output buffer at
index i 
when jack_last_frame_time(c) == t2 will (again within
reason) become 
audible when  jack_frame_time(c) == t2 +
jack_get_total_latency(c, 
po) + i

Also, if I were to save the result of jack_frame_time(c)
from the 
previous process call in llft, typically, in the current
process 
call, I could expect llft + nframes ==
jack_last_frame_time(c). If 
this were not the case, either
 - an xrun occurred, or
 - the graph was suspended (same thing really), or
 - the accumulated drift between nominal and actual sample
rate became
   greater than half a frame.
In the last case, barring truly exceptional circumstances,
the delta 
will be 1 or -1. In the other cases, the delta is at least 
approximately related to the duration of the xrun or graph 
suspension.

Thanks a whole lot in advance,

Daniel.


-------------------------------------------------------
All the advantages of Linux Managed Hosting--Without the
Cost and Risk!
Fully trained technicians. The highest number of Red Hat
certifications in
the hosting industry. Fanatical Support. Click to learn more
http://sel.as-us.falkag.net/
sel?cmd=lnk&kid=107521&bid=248729&dat=121642
_______________________________________________
Jackit-devel mailing list
Jackit-devellists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jackit-dev
el
[1]

about | contact  Other archives ( Real Estate discussion Medical topics )