Ongoing work on latency compensation

Multimedia / Ardour - Robin Gareus [gareus.org] - 28 September 2017 23:03 EDT

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.

8139bec Ongoing work on latency compensation
libs/ardour/ardour/route.h | 22 +--
libs/ardour/ardour/session.h | 8 +-
libs/ardour/auditioner.cc | 2 +-
libs/ardour/disk_reader.cc | 18 ++-
libs/ardour/disk_writer.cc | 61 ++++----
libs/ardour/route.cc | 328 ++++++++++++++++++++++++++++++---------
libs/ardour/session.cc | 139 +++++------------
libs/ardour/session_process.cc | 41 ++++-
libs/ardour/session_transport.cc | 34 +++-
libs/ardour/track.cc | 2 +-
10 files changed, 421 insertions(+), 234 deletions(-)

  • Share