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/ardour/export_channel.h | |
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/ardour/export_channel.h')
-rw-r--r-- | libs/ardour/ardour/export_channel.h | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/libs/ardour/ardour/export_channel.h b/libs/ardour/ardour/export_channel.h index 2d002ee1e4..ca23eadc67 100644 --- a/libs/ardour/ardour/export_channel.h +++ b/libs/ardour/ardour/export_channel.h @@ -50,7 +50,8 @@ class LIBARDOUR_API ExportChannel : public boost::less_than_comparable<ExportCha virtual ~ExportChannel () {} - virtual void set_max_buffer_size(samplecnt_t) { } + virtual samplecnt_t common_port_playback_latency () const { return 0; } + virtual void prepare_export (samplecnt_t max_samples, sampleoffset_t common_latency) { } virtual void read (Sample const *& data, samplecnt_t samples) const = 0; virtual bool empty () const = 0; @@ -74,7 +75,8 @@ class LIBARDOUR_API PortExportChannel : public ExportChannel PortExportChannel (); ~PortExportChannel (); - void set_max_buffer_size(samplecnt_t samples); + samplecnt_t common_port_playback_latency () const; + void prepare_export (samplecnt_t max_samples, sampleoffset_t common_latency); void read (Sample const *& data, samplecnt_t samples) const; bool empty () const { return ports.empty(); } @@ -171,7 +173,7 @@ class LIBARDOUR_API RouteExportChannel : public ExportChannel static void create_from_route(std::list<ExportChannelPtr> & result, boost::shared_ptr<Route> route); public: // ExportChannel interface - void set_max_buffer_size(samplecnt_t samples); + void prepare_export (samplecnt_t max_samples, sampleoffset_t common_latency); void read (Sample const *& data, samplecnt_t samples) const; bool empty () const { return false; } |