SC_JACK_DEFAULT env too long

hi, i have a problem with the “SC_JACK_DEFAULT_OUTPUT”.setenv( String).
I need to run this long string (= 1055 char) :

"firewire_pcm:000a9200c6100511_Output 1L_out,firewire_pcm:000a9200c6100511_Output 2R_out,firewire_pcm:000a9200c6100511_Output 3L_out,firewire_pcm:000a9200c6100511_Output 4R_out,firewire_pcm:000a9200c6100511_Output 5L_out,firewire_pcm:000a9200c6100511_Output 6R_out,firewire_pcm:000a9200c6100511_Output 7L_out,firewire_pcm:000a9200c6100511_Output 8R_out,firewire_pcm:000a9200c7030496_Output 1L_out,firewire_pcm:000a9200c7030496_Output 2R_out,firewire_pcm:000a9200c7030496_Output 3L_out,firewire_pcm:000a9200c7030496_Output 4R_out,firewire_pcm:000a9200c7030496_Output 5L_out,firewire_pcm:000a9200c7030496_Output 6R_out,firewire_pcm:000a9200c7030496_Output 7L_out,firewire_pcm:000a9200c7030496_Output 8R_out,firewire_pcm:000a9200c0000774_Output 1L_out,firewire_pcm:000a9200c0000774_Output 2R_out,firewire_pcm:000a9200c0000774_Output 3L_out,firewire_pcm:000a9200c0000774_Output 4R_out,firewire_pcm:000a9200c0000774_Output 5L_out,firewire_pcm:000a9200c0000774_Output 6R_out,firewire_pcm:000a9200c0000774_Output 7L_out,firewire_pcm:000a9200c0000774_Output 8R_out"

The connection fail for the last port; the max size of the string seems to be 1023 char
“SC_JACK_DEFAULT_OUTPUT”.getenv.size → 1023.
How can i fix this problem ?
thank you

Never found this way of working with JACK to be all that useful. Have you considered using a series of jack_connect commands? You might need to install it though…

[
   ["from_here", "to_there"],
   ["from_here", "to_there"],
].do({|v|  format("jack_connect % %", *v).unixCmd })

Merci !
I didn’t know the jack_connect command. I will try this as soon as possible. it seems perfect.

this is great for me !
I need to run:"SC_JACK_DEFAULT_OUTPUTS".unsetenv;"SC_JACK_DEFAULT_INPUTS".unsetenv
before s.boot to avoid autoconnection. and then I run

[
  ["from_here", "to_there"],
  ["from_here", "to_there"],
].do({|v|  format("jack_connect % %", *v).unixCmd })

the problem with this method is that jack_connect is very slow compared to using the environment variable. I’m trying to set 96 specific jack outputs for 4 servers but run into the same issue.

"SC_JACK_DEFAULT_OUTPUTS".setenv( (97..192).collect("system:playback_%".format(_)).join(", ") );

I’m wondering if there is a different way to set the env variable? Can’t get it to work using “export …” via unixCmd or via the terminal. I have to change it between server startups so putting it in .bash_profile also isn’t an option (and I haven’t been able to get that to work either).

cheers & thanks,
Wouter

Yes the limit is 1024. It would be easy to fix by using slotStrLen, allocating a std::string and copying into that instead of a fixed length char buffer.

2 Likes

ok, thanks, that would be my feature request for a next release then :-). Meanwhile I’ve solved it brute force style by prepending a "export … ; " command to Server.program temporarily until the servers that need it have started up. I couldn’t find any other way to set the environment variable via unixCmd etc… It works fine then and the startup goes way way faster than via a jack-connect script.