SCNvim on Windows refuses to boot scsynth when I specify devices

Whenever I try to specify input/output devices like so

s.options.inDevice_("ASIO : JackRouter");
s.options.outDevice_("ASIO : JackRouter");

I get this error message:

Der Befehl "C:\Program" ist entweder falsch geschrieben oder
konnte nicht gefunden werden.

(translated: “the command “C:\Program” is either misspelled or could not be found”)

I haven’t tried it with all possible combinations of devices and MME/WASAPI/WDM-KS/Jack Router. It works fine in SC IDE, it’s only in scnvim that I run into this problem.

I am on Windows 10, using Supercollider version 3.12.2.

Is this an scnvim bug? What can I do to get to the bottom of it (and hopefully fix it)?

Camilla,

I get this error message:

Der Befehl "C:\Program" ist entweder falsch geschrieben oder
konnte nicht gefunden werden.

Not sure what the reason for this error may be, but on Windows the
folder for software on english systems is often
C:\Program Files
while on german systems there is either a
C:\Programme
or it links to the english one. I suspect something, possibly within
scvim, is trying to find
C:\Program Files
on your computer…?

I just checked - the “Program Files” folder is called “Program Files” on my machine, so language doesn’t seem to be the problem.

I suspect the spaces within the path name aren’t getting escaped properly, but why is this not a problem with default settings?

I wonder if something is going wrong when the device name (which has to be passed in as a command line argument to the server) has spaces in it? Try printing the command line being used to launch the server (see Server.sc:1041, the line where it does unixCmd(....) - something like:

(program ++ options.asOptionsString(addr.port)).postln

You should be able to run this command directly from the command line and get the server to launch. If you get the same error as sclang does, this might make it a little easier to fiddle with the command line to see whats wrong.

I get scsynth.exe to launch from PowerShell with the following code:

& "C:\Program Files\SuperCollider\scsynth.exe" -u 57110 -a 1024 -i 2 -o 2 -m 65536 -H "Windows WASAPI : Internes Mikrofon (Conexant SmartAudio HD)" "Windows WASAPI : Lautsprecher (Conexant SmartAudio HD)" -R 0 -C 1 -l 1

(just picking WASAPI and the built-in devices as an example here)

It then lets me quit the server from scnvim, or query things, but not play any sound.

It also launches just fine from scnvim with the default devices. Just not when I request devices other than nil with s.options.inDevice_() or s.options.outDevice_() respectively.

I think the key data point is still: what is the actual string being submitted to boot the server?

Could you add the postln that scztt suggested and report back? Would be worth collecting the strings from both IDE and scnvim, for comparison.

hjh

Ah, I think now I understand the question a little better.

If I run the following without specifying any devices

(Server.program ++ s.options.asOptionsString(s.addr.port))

here’s the output of scide:

scsynth.exe -u 57110 -a 1024 -i 2 -o 2 -R 0 -C 1 -l 1

whereas scnvim gives me the following:

"C:\Program Files\SuperCollider\scsynth.exe" -u 57110 -a 1024 -i 2 -o 2 -R 0 -C 1 -l 1

If I specify a device, I get the following:

scide:

scsynth.exe -u 57110 -a 1024 -i 2 -o 2 -H "Windows WDM-KS : Mikrofonarray (Conexant HD Audio capture)" "Windows WDM-KS : Speakers (Conexant HD Audio output)" -R 0 -C 1 -l 1

in scnvim:

"C:\Program Files\SuperCollider\scsynth.exe" -u 57110 -a 1024 -i 2 -o 2 -H "Windows WDM-KS : Mikrofonarray (Conexant HD Audio capture)" "Windows WDM-KS : Speakers (Conexant HD Audio output)" -R 0 -C 1 -l 1

If I paste the last one in the command prompt, scsynth starts. (It needs the full path, though; just running “scsynth.exe” from the command prompt only gives me an error message that the program could not be found.)

I suspect the problem is somewhere within scnvim and/or my configuration. I’m just mystified why it works with the default devices (and not with the others).

After some more searching on Github, I found a fix right now. This issue on the scnvim repository contains the line that appears to fix the weird path issue.

Putting

Server.program = "start /B /HIGH /D % scsynth.exe".format(Platform.resourceDir.quote);

into my startup.scd instead of

Server.program = (Platform.resourceDir +/+ "scsynth.exe").quote;

somehow allows me to boot scsynth with other devices than default, which, in turn, allows me to address some very annoying latency issues.

That is peculiar – one would have thought that "C:\path\to\executable" arg arg "quoted arg" would be fine in the shell, but perhaps this confuses the Windows command shell in a way that executable "quoted arg" arg arg "other quoted arg" does not.

But because of your report, the scnvim instructions can be improved :+1:

Glad you found the answer!

hjh

The server boots when I execute the first thing on the Windows command prompt or the shell (only then I can’t “talk” to it from neovim) - so I suspect there’s some weirdness going on with neovim and/or scnvim.