From 543bb85157181cc442ad8d538ded14c879b8f8a3 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Fri, 3 Jun 2022 22:49:56 +0200 Subject: [PATCH] Use process-graph for silencing routes during audition Route::silence() runs plugins. With a heavy session that relies on multi-core processing, sending silence to processors will have to be done in parallel. Otherwise it can result in large DSP load and xruns. This may allow to revert b3497b3f8f65b63, which was a prior attempt to resolve this, before understanding the actual cause. --- libs/ardour/session_process.cc | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/libs/ardour/session_process.cc b/libs/ardour/session_process.cc index e989671b0b..c50223f5a2 100644 --- a/libs/ardour/session_process.cc +++ b/libs/ardour/session_process.cc @@ -758,9 +758,18 @@ Session::process_audition (pframes_t nframes) SessionEvent* ev; boost::shared_ptr r = routes.reader (); - for (RouteList::iterator i = r->begin(); i != r->end(); ++i) { - if (!(*i)->is_auditioner()) { - (*i)->silence (nframes); + boost::shared_ptr graph_chain = _graph_chain; + if (graph_chain) { + /* Ideally we'd use Session::rt_tasklist, since dependency is irrelevant. + * However the RTTaskList process threads have no ProcessThread buffers + * nor a SessioEvent thread_pool. + */ + _process_graph->silence_routes (graph_chain, nframes); + } else { + for (RouteList::iterator i = r->begin(); i != r->end(); ++i) { + if (!(*i)->is_auditioner()) { + (*i)->silence (nframes); + } } }