summaryrefslogtreecommitdiff
path: root/libs/ardour/route.cc
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2020-04-25 17:52:54 +0200
committerRobin Gareus <robin@gareus.org>2020-04-25 17:52:54 +0200
commitb196cef2c4443ca2a6e7d26b03b3691d0ad706c5 (patch)
tree7efb4797d645ff56eaf586be5e31332e9ad02d99 /libs/ardour/route.cc
parent7751841b784856e66c7bf0d61d134cdf69cf3855 (diff)
Prevent delay-line reconfiguration while processing
Various backends have different strategies for updating latencies, and different thread semantics for latency update callbacks. With jack2 it is possible that processing happens concurrently while port latencies are being changed. Ardour internal backends emit the latency callback from the main process thread, serializing latency changes with processing. Various user actions can also trigger latency changes. e.g. with a stopped engine it is possible to re-order plugins.
Diffstat (limited to 'libs/ardour/route.cc')
-rw-r--r--libs/ardour/route.cc13
1 files changed, 8 insertions, 5 deletions
diff --git a/libs/ardour/route.cc b/libs/ardour/route.cc
index c50b4aab25..e9e2e4604b 100644
--- a/libs/ardour/route.cc
+++ b/libs/ardour/route.cc
@@ -2202,6 +2202,8 @@ Route::reorder_processors (const ProcessorList& new_order, ProcessorStreams* err
_pending_processor_order.clear ();
setup_invisible_processors ();
+ update_signal_latency (true);
+
processors_changed (RouteProcessorChange ()); /* EMIT SIGNAL */
set_processor_positions ();
} else {
@@ -2226,6 +2228,12 @@ Route::reorder_processors (const ProcessorList& new_order, ProcessorStreams* err
}
lm.release();
+
+ /* update processor input/output latency (total signal_latency does not change).
+ * delaylines may changes, so the Engine Lock is required.
+ */
+ update_signal_latency (true);
+
lx.release();
processors_changed (RouteProcessorChange ()); /* EMIT SIGNAL */
@@ -2240,11 +2248,6 @@ Route::reorder_processors (const ProcessorList& new_order, ProcessorStreams* err
g_atomic_int_set (&_pending_process_reorder, 1);
}
- /* update processor input/output latency
- * (total signal_latency does not change)
- */
- update_signal_latency (true);
-
return 0;
}