Csound Csound-dev Csound-tekno Search About

[Csnd-dev] jack autoconnect

Date2021-08-16 23:08
FromEduardo Moguillansky
Subject[Csnd-dev] jack autoconnect
Hi,

I just sent a PR (https://github.com/csound/csound/pull/1514) to fix 
some problems related with jack autoconnect. In the original code, when 
csound was presented with an option of the form -odac:pattern, it would 
try to connect each channel to a corresponding port of the form 
pattern1, pattern2, etc. This would be done so independently of such 
ports existing or not, which would misconnect if the client's ports 
started with 0 and would fail if the client used some other pattern for 
naming its ports, like client_FL, client_FR, etc. This last situation is 
particularly problematic when using pipewire in linux, where, under 
certain profiles, many clients present ports based on configurations 
such as 4.0, 5.1, etc, where the ports are not numbered.

With this PR, ports are naturally sorted (port_out2 comes before 
port_out10), so for clients using numbered ports, the result is exactly 
the same as the previous behaviour. For not numbered ports, the sorting 
provides a reliable order.

The PR provides also fixes for situations where csound would crush if 
the numbered dac/adc would exceed the number of ports, warning the user 
and failing to auto-connect.

cheers,

Eduardo