Ongoing work on latency compensation
authorRobin Gareus <robin@gareus.org>
Thu, 28 Sep 2017 04:31:12 +0000 (06:31 +0200)
committerRobin Gareus <robin@gareus.org>
Fri, 29 Sep 2017 03:03:48 +0000 (05:03 +0200)
commit8139becb1898187729b0ea57f145302d4975bf3a
tree79638d87c587765784fe56eeb530ff792442e0c5
parent8ff3b5ecf6bd2b7d69b8f154ba8d21eb4fe86304
Ongoing work on latency compensation

The general goal is to align transport-sample to be the audible frame
and use that as "anchor" for all processing.

transport_sample cannot become negative (00:00:00:00 is the first audible
frame).

Internally transport pre-rolls (read-ahead) before the transport starts
to move. This allows inputs and disk to prefill the pipeline.

When starting to roll, the session counts down a global "remaning preroll"
counter, which is the worst-latency from in-to-out.
Each route in turn will start processing at its own output-latency.

Route::process_output_buffers() - which does the actual processing
incl disk i/o - begins by offsetting the "current sample" by the
route's process-latency and decrements the offset for each latent
processor.  At the end of the function the output will be aligned
and match  transport-sample - downstream-playback-latency (if any).

PS. This commit is a first step only: transport looping & vari-speed have
not yet been implemented/updated.
libs/ardour/ardour/route.h
libs/ardour/ardour/session.h
libs/ardour/auditioner.cc
libs/ardour/disk_reader.cc
libs/ardour/disk_writer.cc
libs/ardour/route.cc
libs/ardour/session.cc
libs/ardour/session_process.cc
libs/ardour/session_transport.cc
libs/ardour/track.cc