Today I had two instances of Cabbage working at the same time, I think from the one user, one running a reverb on a signal from the sound card via JACK and the other running the Parp demo, with both driving the same two JACK output channels. However, I was unable to reproduce this.
Is there a legitimate way of running two or more instances of Cabbage at the same time for the same user? When I try to do this the second instance immediately closes itself down.
Running two instances from different users didnāt work at first because only the one which is for the user which started jackd will be able to access jackd. Here is how I got this to work. I would prefer to do it all with a single user account.
The setup is much the same as that described in my May messages: Linux build of Cabbage 2.0.02 and Projucer for Debian 9.x . I am using JACK2 1.9.12. This has the updated and now properly documented (in the man page https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=891223 ) environment variable JACK_PROMISCUOUS_SERVER:
ā$JACK_PROMISCUOUS_SERVER enables an alternate way of
handling the various shared resources (Unix sockets, semaphores, ā¦).
In this mode, the generated names will not contain the user id anymore,
and the permissions of those resources will be relaxed, allowing
clients from different users to talk with the same server. Moreover, on
platforms that support it (all POSIX variants), if set to a valid Unix group
name or id, the permissions will be restricted to that group, so only
members of that group will be able to launch clients that talk to this
server. Important note: it must be set with the same value for both server
and clients to work as expected.ā
In May I was accessing the audio server via ssh and X-windows from a Windows machine, and that caused problems for Cabbageās menus, unless I used a special technique of accessing an entire desktop of the audio server. Now I am using a Linux machine to do ordinary ssh and X-windows so I run Cabbage normally, without the cumbersome whole desktop arrangement. The sound card is an RME RayDat.
In this example I ssh to the audio server three times, twice as user robin (to set up the jackd server and to run one instance of Cabbage, and an instance of Ardour) and once as user r0 to run another instance of Cabbage. Everything is still not quite right, since my use of qjackctl is questionable - I probably donāt need it, and its Connect facility does not work (an empty window).
With the first (robin) login:
sudo ./hyperthreading-off.sh
hdspmixer & (Then press Enter.)
export JACK_PROMISCUOUS_SERVER="audio"
Then with a command line copied from the one generated previously by qjackctl (using htop and filtering on ājackā) I started the jack server:
/usr/local/bin/jackd -v -dalsa -dhw:HDSPMx4fb04e -r48000 -p64 -n2 &
This ssh login is now hard to use, since jackd outputs various things continally (-v = verbose). No-doubt this could be redirected, but I let it run and started a second (robin) login:
export JACK_PROMISCUOUS_SERVER="audio"
qjackctl &
This showed the jackd server was running (its button was: STOP). I probably donāt really need this, as long as I find some other way of looking at the jackd patchbay, which I guess I can do by some other means.
After putting a symlink from my home directory to the Cabbage executable, I can run this, but the examples are at: /audio/csound-cabbage-build/cabbage-2.0.02/Builds/LinuxMakefile/CabbageBuild/Examples and to load them from Cabbage I do so explicitly with āFile > Open Csound fileā, rather then with āFile > Examplesā.
./Cabbage &
(Cabbage will still write stuff to this console.)
I started a Parp on this instance of Cabbage and was able to select the required JACK output channels. So far so good.
From the same login console I was also able to run Ardour successfuly, recording the input channels, though after some time it crashed. (I am futzing around, I am yet to learn how to use Ardour properly.)
Now with a third ssh login as user r0 (I had also put a symlink in this userās home directory to the actual Cabbage executable in the build directory):
export JACK_PROMISCUOUS_SERVER="audio"
./Cabbage &
I fired up Multiverb and was able to process two channels of audio and output it via JACK.
Both instances of Cabbage worked fine together, and I assume I could extend this to several or a dozen or so different users, each running one instance of Cabbage, depending on how CPU intensive they were.
I did not consider how to patch the inputs and outputs of the two Cabbage instances together and with Ardourās inputs and outputs. All three programs where working with the already existing audio channels withing JACK for the RayDat card. I think there is a way, with Ardour (and no doubt other methods) of creating some kind of patch points within JACK so I can patch signals as I wish, independent of the sound card channels.
Thanks for Cabbage!