diff options
author | Robin Gareus <robin@gareus.org> | 2020-03-05 21:17:25 +0100 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2020-03-06 01:49:48 +0100 |
commit | 751f9f96540e6b1517725b0a75a4e416df04af58 (patch) | |
tree | 69ce60eeafe323afb729e0d3fc3a4b21509c392d /libs/ardour/export_handler.cc | |
parent | 18514408637c9b49a1858443a4f1a37023244599 (diff) |
Fix export alignment (#7916)
Ardour's playback is aligned to master-out:
"When the playback clock reads 01:00:00:00, the sample corresponding
to 01:00:00:00 is audible at the speaker(s)"
When exporting, and grabbing data from output ports, the signal
is offset by the master-bus physical playback latency. This was
compensated for, but lead to initial silence in the exported file.
New approach is to start capturing export data during pre-roll,
at the time when playback is written to the output buffers.
To also shaves off a common offset to make this work with
realtime export. Effectively this emulates processing with
disconnected master-output port, while still keeping any
latency of effects on the master-bus itself.
Last but not least: jack updates latencies when freewheeling,
(setting HW latency to zero). The callback arrives asynchronously
some time after enabling freewheeling, but after Export
Ports have been configured. Those callbacks are ignored.
Diffstat (limited to 'libs/ardour/export_handler.cc')
-rw-r--r-- | libs/ardour/export_handler.cc | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/libs/ardour/export_handler.cc b/libs/ardour/export_handler.cc index 76869c7a79..df64e87154 100644 --- a/libs/ardour/export_handler.cc +++ b/libs/ardour/export_handler.cc @@ -299,12 +299,13 @@ ExportHandler::process_timespan (samplecnt_t samples) samples_to_read = samples; } - process_position += samples_to_read; - export_status->processed_samples += samples_to_read; - export_status->processed_samples_current_timespan += samples_to_read; - /* Do actual processing */ - int ret = graph_builder->process (samples_to_read, last_cycle); + samplecnt_t ret = graph_builder->process (samples_to_read, last_cycle); + if (ret > 0) { + process_position += ret; + export_status->processed_samples += ret; + export_status->processed_samples_current_timespan += ret; + } /* Start post-processing/normalizing if necessary */ if (last_cycle) { @@ -318,7 +319,7 @@ ExportHandler::process_timespan (samplecnt_t samples) } } - return ret; + return 0; } int |