13
0

Collect and queue processor latency updates

This is only relevant when automating a plugin-bypass, due to
ActiveChanged the following could happen from the realtime thread:

#2 ARDOUR::Session::update_latency_compensation (false, false)
#3 PBD::Signal0<void, PBD::OptionalLastValue<void> >
#4 ARDOUR::AutomationControl::actually_set_value
#5 ARDOUR::PluginInsert::PluginControl::actually_set_value
#6 ARDOUR::PluginInsert::connect_and_run
#7 ARDOUR::PluginInsert::automate_and_run

In this specific case the update_latency_compensation()
is called with process-lock held but the caller lied:
  called_from_backend=false
When a delayline update is needed, this can lead to a deadlock,
since the process-lock is acquired again.

Simply postponing the update is preferable since this also
postpones the change when actively recording.

PS. This may need special casing for freewheel export.
This commit is contained in:
Robin Gareus 2020-09-22 23:35:48 +02:00
parent 105c358494
commit 4601507165
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04

View File

@ -1139,7 +1139,7 @@ Route::add_processors (const ProcessorList& others, boost::shared_ptr<Processor>
(*i)->activate ();
}
(*i)->ActiveChanged.connect_same_thread (*this, boost::bind (&Session::update_latency_compensation, &_session, false, false));
(*i)->ActiveChanged.connect_same_thread (*this, boost::bind (&Session::queue_latency_recompute, &_session));
boost::shared_ptr<Send> send;
if ((send = boost::dynamic_pointer_cast<Send> (*i))) {
@ -1598,7 +1598,7 @@ Route::replace_processor (boost::shared_ptr<Processor> old, boost::shared_ptr<Pr
sub->enable (true);
}
sub->ActiveChanged.connect_same_thread (*this, boost::bind (&Session::update_latency_compensation, &_session, false, false));
sub->ActiveChanged.connect_same_thread (*this, boost::bind (&Session::queue_latency_recompute, &_session));
}
reset_instrument_info ();
@ -3138,7 +3138,7 @@ Route::set_processor_state (const XMLNode& node, int version)
for (ProcessorList::const_iterator i = _processors.begin(); i != _processors.end(); ++i) {
(*i)->set_owner (this);
(*i)->ActiveChanged.connect_same_thread (*this, boost::bind (&Session::update_latency_compensation, &_session, false, false));
(*i)->ActiveChanged.connect_same_thread (*this, boost::bind (&Session::queue_latency_recompute, &_session));
boost::shared_ptr<PluginInsert> pi;