13
0

Fix jack2 input-port monitoring

Port_connect must be called with correct order (src, dst),
and may only be called after the client is active.

jack2 reported errors:
> Destination port in attempted (dis)connection of ardour:physical_input_monitor_enable and system:capture_1 is not an input port
> Cannot connect ports owned by inactive clients: "ardour" is not active
This commit is contained in:
Robin Gareus 2021-06-13 17:40:34 +02:00
parent 95215ff405
commit f196256604
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04

View File

@ -740,11 +740,6 @@ PortManager::reestablish_ports ()
if (Config->get_work_around_jack_no_copy_optimization () && AudioEngine::instance()->current_backend_name() == X_("JACK")) {
PortEngine::PortHandle ph = port_engine().register_port (X_("physical_input_monitor_enable"), DataType::AUDIO, ARDOUR::PortFlags (IsInput|IsTerminal|Hidden));
std::vector<std::string> audio_ports;
get_physical_inputs (DataType::AUDIO, audio_ports);
for (std::vector<std::string>::iterator p = audio_ports.begin(); p != audio_ports.end(); ++p) {
port_engine().connect (ph, *p);
}
}
update_input_ports (true);
@ -787,6 +782,15 @@ PortManager::reconnect_ports ()
}
}
if (Config->get_work_around_jack_no_copy_optimization () && AudioEngine::instance()->current_backend_name() == X_("JACK")) {
std::string const our_name = AudioEngine::instance()->make_port_name_non_relative (X_("physical_input_monitor_enable"));
std::vector<std::string> audio_ports;
get_physical_inputs (DataType::AUDIO, audio_ports);
for (std::vector<std::string>::iterator p = audio_ports.begin(); p != audio_ports.end(); ++p) {
port_engine().connect (*p, our_name);
}
}
return 0;
}