From 0e6561b0098ee25cf65dc71a571eabe20805134e Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Sat, 22 Jan 2022 04:20:32 +0100 Subject: [PATCH] Fix Thread & Lock issues when adding Triggerbox w/sidechain Track::init() must not call `add_processor` directly. The track is not in the process graph, yet and hence various calls (e.g. lock graph, update latency etc) are not applicable. Furthermore ::add_midi_sidechain() calls IO::add_port() which takes the process-lock. The solution is to create the Triggerbox early on and let Route::init deal with it like any other internal processors. --- libs/ardour/track.cc | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/libs/ardour/track.cc b/libs/ardour/track.cc index 0eaabbb365..9a84262864 100644 --- a/libs/ardour/track.cc +++ b/libs/ardour/track.cc @@ -87,6 +87,12 @@ Track::~Track () int Track::init () { + if (!is_auditioner()) { + _triggerbox = boost::shared_ptr (new TriggerBox (_session, data_type ())); + _triggerbox->set_owner (this); + _triggerbox->add_midi_sidechain (); + } + if (Route::init ()) { return -1; } @@ -105,13 +111,6 @@ Track::init () * patchbays and elsewhere (or special-case code in those places) */ - if (!is_auditioner()) { - boost::shared_ptr tb (new TriggerBox (_session, data_type ())); - tb->set_owner (this); - add_processor (tb, _polarity); - tb->add_midi_sidechain (); - } - set_align_choice_from_io (); boost::shared_ptr rp (boost::dynamic_pointer_cast (shared_from_this()));