From 40e3364c663fca2542c6d54e3e20f27d83103a6b Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Mon, 30 Mar 2020 17:58:35 +0200 Subject: [PATCH] Always delegate meter-point positioning to rt-thread Previously set_state() -> set_meter_point() acquired the process-lock to change meter-position, usually causing x-runs when setting route-state. This also fixes an issue introduced in fd414ec158. After populating the processor list, force setting the meter-position looks up the output streams of the processor before the meter. However the processors are not configured. That will only happen later from Session::post_engine_init(). --- #3 0x00007ff07b7d4102 in __GI___assert_fail at assert.c:101 #4 0x00007ff080d3224a in ARDOUR::PluginInsert::output_streams() const at ../libs/ardour/plugin_insert.cc:289 #5 0x00007ff080de8c30 in ARDOUR::Route::set_meter_point_unlocked() at ../libs/ardour/route.cc:4106 #6 0x00007ff080de8699 in ARDOUR::Route::set_meter_point(ARDOUR::MeterPoint, bool) at ../libs/ardour/route.cc:4037 #7 0x00007ff080ddfad3 in ARDOUR::Route::set_state(XMLNode const&, int) at ../libs/ardour/route.cc:269 --- libs/ardour/ardour/route.h | 2 +- libs/ardour/route.cc | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/libs/ardour/ardour/route.h b/libs/ardour/ardour/route.h index a24d102555..959448881f 100644 --- a/libs/ardour/ardour/route.h +++ b/libs/ardour/ardour/route.h @@ -190,7 +190,7 @@ public: void set_denormal_protection (bool yn); bool denormal_protection() const; - void set_meter_point (MeterPoint, bool force = false); + void set_meter_point (MeterPoint); bool apply_processor_changes_rt (); void emit_pending_signals (); MeterPoint meter_point() const { return _pending_meter_point; } diff --git a/libs/ardour/route.cc b/libs/ardour/route.cc index 7c653b6fe1..d420824219 100644 --- a/libs/ardour/route.cc +++ b/libs/ardour/route.cc @@ -2693,7 +2693,7 @@ Route::set_state (const XMLNode& node, int version) MeterPoint mp; if (node.get_property (X_("meter-point"), mp)) { - set_meter_point (mp, true); + set_meter_point (mp); if (_meter) { _meter->set_display_to_user (_meter_point == MeterCustom); } @@ -4022,13 +4022,13 @@ Route::emit_pending_signals () } void -Route::set_meter_point (MeterPoint p, bool force) +Route::set_meter_point (MeterPoint p) { - if (_pending_meter_point == p && !force) { + if (_pending_meter_point == p) { return; } - if (force || !AudioEngine::instance()->running()) { + if (!AudioEngine::instance()->running()) { bool meter_visibly_changed = false; { Glib::Threads::Mutex::Lock lx (AudioEngine::instance()->process_lock ());