An example JACK command would look like this: In this case, try adding the ALSA -s option (softmode) and see if that improves stability. Capture or playback only should be no problem but full-duplex can be troublesome, ALSA will report a lot of xruns and when using Jack1 the watchdog thread will kick in after a while killing JACK. Now you should be able to fire up jackd, the actual daemon of the JACK package. WARNING: In Raspbian Stretch I had to do the following instead of modifying nf:Ĭreate a new file /etc/dbus-1/nf with the following contents: Another option is to export the following environment variable before starting JACK2:Įxport DBUS_SESSION_BUS_ADDRESS=unix:path=/run/dbus/system_bus_socketĪnd then add the following lines to /etc/dbus-1/nf before the closing tag: The JACK2 packages in the AutoStatic repositories have dbus disabled. You can do this by building without the –dbus option.
When using Jack2 you might want to disable dbus dependent code in JACK components if you want to run Jack2 on a headless RPi (so without X). | sudo tee /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor Also set the CPU governor to performance so the CPU frequency does not scale: So JACK will not complain that it cannot allocate memory. If you've set gpu_mem to a value higher than 64 you will want to increase the size of /dev/shm before starting JACK:
Using this method also works around the issue of non-working mice and keyboards when using the dwc_otg.speed=1 option in your /boot/cmdline.txt file because now you can control the software with the mouse and keyboard of the connected Linux machine. Now you can start GUI software by invoking them from the command line, like guitarix which will open the guitarix GUI on your connected Linux machine while the software itself runs on the RPi. Ssh -X will give you shell access to the RPi. Open a terminal on the machine you want to connect to the RPi over SSH and simply type: That machine does need to have Xorg installed so using Linux is your best option. X-forwarding over SSH allows you to run software from the RPi within the desktop environment of the machine you're SSH'ing from. That's nice and all but how do I control the RPi then and what if the software I'd like to use has a GUI? Enter X-forwarding over SSH. You can get a significant performance gain by not using a desktop environment on the RPi. Sudo service networking stop Running a headless RPi Jackd -P70 -p16 -t2000 -d alsa -dhw:UA25 -p 128 -n 3 -r 44100 -s &Īlso, as long as you don't need networking, adding these also frees up some resources: # Set the CPU scaling governor to performanceĮcho -n performance | sudo tee /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
#echo -n “1-1.1” | sudo tee /sys/bus/usb/drivers/usb/unbind # In case the above line doesn't work try the following
# Uncomment if you'd like to disable the network adapter completely Warning: this can cause unpredictable behaviour when running a desktop environment on the RPi # Kill the usespace gnome virtual filesystem daemon. # Remount /dev/shm to prevent memory allocation errors #export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/dbus/system_bus_socket
# Only needed when Jack2 is compiled with D-Bus support (Jack2 in the AutoStatic RPi audio repo is compiled without D-Bus support) One way to disable such services from running and chewing up precious CPU cycles is to write a little script, an example can be found here: By default the RPi runs quite some services that are not really needed or even get in the way when setting up a real-time, low-latency environment.