I’m running Patchbox OS on my pisound. When I start pd, I get an error: JACK: couldn't connect to server, is JACK running?
So, I checked if JACK is running. It is (jackd). When I kill jackd and start a JACK server manually via qjackctl, pd doesn’t complain and runs fine. But I would like to run it without desktop, so that’s not a satisfying workaround.
I’ve already updated pd to the latest version and tried running my patch as a patchbox module. Both didn’t solve this.
The Jack service on Patchbox OS is preconfigured (and can be reconfigured via patchbox) and should be running in the background automatically, no need to start it manually (unless it was stopped/disabled manually )
● jack.service - JACK Server
Loaded: loaded (/lib/systemd/system/jack.service; enabled; vendor preset: enabled)
Active: active (running) since Sun 2021-06-20 22:05:58 BST; 13h ago
Main PID: 473 (jackd)
Tasks: 5 (limit: 2062)
CGroup: /system.slice/jack.service
└─473 /usr/bin/jackd -t 2000 -R -P 95 -d alsa -d hw:pisound -r 48000 -p 256 -n 2 -X seq
Jun 20 22:06:00 patchbox jackdrc[473]: port created: pisound:midi/playback_1
Jun 20 22:06:00 patchbox jackdrc[473]: port created: pisound:midi/capture_1
Jun 20 22:06:00 patchbox jackdrc[473]: port created: LPD8:midi/playback_1
Jun 20 22:06:00 patchbox jackdrc[473]: port created: LPD8:midi/capture_1
Jun 20 22:06:00 patchbox jackdrc[473]: port created: APC-Key-25:midi/playback_1
Jun 20 22:06:00 patchbox jackdrc[473]: port created: APC-Key-25:midi/capture_1
Jun 20 22:06:12 patchbox jackdrc[473]: port created: RtMidiIn-Client:midi/capture_1
Jun 20 22:06:12 patchbox jackdrc[473]: port created: RtMidiOut-Client:midi/playback_1
Jun 21 11:08:10 patchbox jackdrc[473]: port created: pisound-ctl:midi/playback_1
Jun 21 11:08:10 patchbox jackdrc[473]: port created: pisound-ctl:midi/capture_1
looks like it’s running smoothly.
I guess the problem might be that I run pd with sudo. I use the wiringPi external to control GPIOs. When I run pd without sudo, there is no JACK error. But the GPIO stuff does not work.
So, the proper question might be: How do I make pd connect to JACK when run with sudo?
patch@patchbox:~ $ sudo -E pd -nogui mypatch.pd
XDG_RUNTIME_DIR (/run/user/1000) is not owned by us (uid 0), but by uid 1000! (This could e g happen if you try to connect to a non-root PulseAudio as a root user, over the native protocol. Don't do that.)
[...]
I’ll try to make wiringPi run without sudo. Or is there an easy way to avoid JACK altogether?
The only audio requirement is to do pitch detection on an input signal.
I found a way to run pd and wiringpi without sudo (actually easy: just add your user to the gpio group).
So I’ve reinstalled patchbox OS to get rid of all potential collateral damages I might have caused by troubleshooting. Now the preinstalled jack and pd work together
… at least when run in an ssh terminal.
On a remote desktop (xrdp, Microsoft Remote Desktop, same user), I still get a JACK Failure when launching pd. Any ideas on this?
Anyway, big thanks for your help so far! I’m happy there is at least one way that works.
yes, looks similar to the launch via desktop shortcut.
patch@patchbox:~ $ pd
priority 8 scheduling failed.
Cannot connect to server socket err = No such file or directory
Cannot connect to server request channel
jack server is not running or cannot be started
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock