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: http://forum.cabbageaudio.com/t/linux-build-of-cabbage-2-0-02-and-projucer-for-debian-9-x/1031/22 . 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:
hdspmixer & (Then press Enter.)
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:
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 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):
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!