Work around jack input monitoring
This works around JACK not allowing to directly access physical input buffers by creating an explicit connection. Ardour access input-buffers directly without connection for input meters and AFL. This work in general since data on those ports are always read unconditionally at the start of each process cycle. jack_port_get_buffer (jack_port_by_name (c, "system:capture_1"), n); However with jack this fails if the given port is not connected. Due to an internal jack optimization collecting input data is skipped for ports that have no connections.
This commit is contained in:
parent
d4a80c18c5
commit
954edb7bd8
@ -47,6 +47,12 @@ CONFIG_VARIABLE (AutoConnectOption, output_auto_connect, "output-auto-connect",
|
|||||||
CONFIG_VARIABLE (AutoConnectOption, input_auto_connect, "input-auto-connect", AutoConnectPhysical)
|
CONFIG_VARIABLE (AutoConnectOption, input_auto_connect, "input-auto-connect", AutoConnectPhysical)
|
||||||
CONFIG_VARIABLE (bool, strict_io, "strict-io", true)
|
CONFIG_VARIABLE (bool, strict_io, "strict-io", true)
|
||||||
|
|
||||||
|
/* Connect all physical inputs to a dummy port, this makes raw input data available.
|
||||||
|
* `jack_port_get_buffer (jack_port_by_name (c, "system:capture_1") , n_samples);`
|
||||||
|
* nees to work for input-monitoring (recorder page).
|
||||||
|
*/
|
||||||
|
CONFIG_VARIABLE (bool, work_around_jack_no_copy_optimization, "work-around-jack-no-copy-optimization", true)
|
||||||
|
|
||||||
/* Naming */
|
/* Naming */
|
||||||
CONFIG_VARIABLE (TracksAutoNamingRule, tracks_auto_naming, "tracks-auto-naming", UseDefaultNames)
|
CONFIG_VARIABLE (TracksAutoNamingRule, tracks_auto_naming, "tracks-auto-naming", UseDefaultNames)
|
||||||
|
|
||||||
|
@ -737,6 +737,16 @@ PortManager::reestablish_ports ()
|
|||||||
set_pretty_names (port_names, DataType::MIDI, false);
|
set_pretty_names (port_names, DataType::MIDI, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
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);
|
update_input_ports (true);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user