Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Help: Correct error in Linux env vars discussion #6253

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

jamshark70
Copy link
Contributor

Purpose and Motivation

Help stated: "If these are not set, SuperCollider will default to connecting SuperCollider's inputs and outputs to your system's inputs and outputs." This is not true. PR matches current behavior.

Types of changes

  • Documentation

To-do list

  • Updated documentation
  • This PR is ready for review

@jamshark70 jamshark70 added the comp: help schelp documentation label Apr 14, 2024
Copy link
Contributor

@JordanHendersonMusic JordanHendersonMusic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that the SuperCollider language client sets these environment variables to "system" by default

It's probably better to mention this first, as it appears the user has to set these, because that's the first sentence.

@jamshark70
Copy link
Contributor Author

It's probably better to mention this first, as it appears the user has to set these, because that's the first sentence.

OK, perhaps better now.

@JordanHendersonMusic
Copy link
Contributor

Looks good!

@JordanHendersonMusic
Copy link
Contributor

I suppose it's possible the user does not have jack_connect but does have jack, on arch these are separate packages... but I don't know if that needs to be mentioned here.

Copy link
Contributor

@JordanHendersonMusic JordanHendersonMusic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps this is my short coming, but I don't know what the 'Supercollider language client' is? Is it possible to explain this behaviour without this term, if not, perhaps a link is needed?

Copy link
Contributor

@JordanHendersonMusic JordanHendersonMusic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You may connect them manually, or by issuing

Jack_connect is an example of manual connection, not a separate option. Perhaps, 'for example with the command jack-connect'?

@jamshark70
Copy link
Contributor Author

In various places, we refer to "the language" and "the client." Actually there are multiple clients, in different languages; I was just being specific about the SC language.

By "manual connection" I meant graphically in qjackctl or carla.

@JordanHendersonMusic
Copy link
Contributor

JordanHendersonMusic commented Apr 22, 2024

Actually there are multiple clients, in different languages; I was just being specific about the SC language.

Like the scala one?

When running from the terminal, which is still sclang, the variable isn't set, so it isn't (just) the language that controls this but something else? Is it the IDE?

@jamshark70
Copy link
Contributor Author

jamshark70 commented Apr 22, 2024

When running from the terminal, which is still sclang, the variable isn't set

I did not find that to be the case in my testing.

$ echo $SC_JACK_DEFAULT_OUTPUTS

^^ Empty line = not set.

$ sclang
compiling class library...
... snip...
*** Welcome to SuperCollider 3.14.0-dev. ...

sc3> "SC_JACK_DEFAULT_OUTPUTS".getenv
-> system

^^ It's set inside sclang, run from the terminal.

And if I 0.exit at this point, and echo $SC_JACK_DEFAULT_OUTPUTS again, it's empty again.

So what I wrote accurately reflects the results of my testing (in Ubuntu). If it behaves differently in different Linux distributions, then I'd need testing transcripts from other distros and I'd be happy to include a list.

@JordanHendersonMusic
Copy link
Contributor

Ah! Just and tested and I get the same results.

I though this line...

A server booted from the command line will thus not auto-connect, unless you set the variables in the same terminal session or shell profile (below).

... meant it wouldn't set the variable, and wouldn't auto-connect, but this refers to the audio server, not the language client booted from the command line.

This is my fault as your writing does say this, but perhaps this paragraph...

If these are not set, the server will not connect to any JACK ports automatically.

...could make this even clearer by starting with something like...

When booting the audio server from the command line (scsynth, not sclang)...

@jamshark70
Copy link
Contributor Author

When booting the audio server from the command line (scsynth, not sclang)...

I don't mind to make this change (but tomorrow).

One thing that is puzzling me here -- I can't find where sclang is setting the variables.

There is a bit in LinuxPlatform, but if I insert debugging statements:

		// default jack port hookup
		// use "system" as default when env vars haven't been set by user
		if("SC_JACK_DEFAULT_INPUTS".getenv.debug("INPUTS").isNil.debug("isNil"), {
			"SC_JACK_DEFAULT_INPUTS".debug("setting").setenv("system")
		});

I get:

Class tree inited in 0.01 seconds
INPUTS: system
isNil: false

... and no "setting" line -- because it's already set before we get here. I've doublechecked my startup.scd and I'm never touching SC_JACK_DEFAULT_INPUTS.

Grepping the entire repository doesn't show anything relevant: https://github.com/search?q=repo%3Asupercollider%2Fsupercollider+%2F%28%3F-i%29INPUTS%2F&type=code

So it is happening somewhere but apparently well hidden in our codebase.

@JordanHendersonMusic
Copy link
Contributor

Strange, because, on rebooting the IDE, I do see that it is being set. Did you reboot the IDE or just recompile? as the latter will keep the environment variables (as your help file says!).

'In Linux Platform'.postln;

// default jack port hookup
// use "system" as default when env vars haven't been set by user
if("SC_JACK_DEFAULT_INPUTS".getenv.isNil, {
	'SETTING SC_JACK_DEFAULT_INPUTS'.postln;
	"SC_JACK_DEFAULT_INPUTS".setenv("system")
});

if("SC_JACK_DEFAULT_OUTPUTS".getenv.isNil, {
	'SETTING SC_JACK_DEFAULT_OUTPUTS'.postln;
	"SC_JACK_DEFAULT_OUTPUTS".setenv("system")
});
compile done
localhost : setting clientID to 0.
internal : setting clientID to 0.
Class tree inited in 0.01 seconds
In Linux Platform
SETTING SC_JACK_DEFAULT_INPUTS
SETTING SC_JACK_DEFAULT_OUTPUTS

mtmccrea

This comment was marked as outdated.

@mtmccrea mtmccrea dismissed their stale review May 20, 2024 06:48

Full conversation didn't load... my mistake!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
comp: help schelp documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants