Hello all, I recently switched to FreeBSD, coming from the Linux world, mostly Debian.
As I like to do music, I want to bring my favourite tools with me, one of them being Renoise.
I've managed to perfectly run Renoise and jackd with the Linux compatibility layer, and this post is a summary of my findings with all the instructions, but also things that I couldn't get to work or haven't tested yet.
The assumption is that you have your FreeBSD already set up, with a user account and a desktop already up and running.
I've tested all this with swayfx on Wayland, but in theory it should work with Xorg just the same.
The Linux jackd daemon will complain if it cannot lock a certain amount of memory, we have to increase that limit for the user:
By default jackd has trouble acquiring a lock on the OSS audio driver, i.e. if other processes are using it. There also seems to be some kind of "cool-down" after jackd stops, and it cannot acquire another lock for about a minute or two. I haven't figured out yet why exactly that is. However, there is a solution: virtual_oss. This daemon creates a virtual DSP, so jackd doesn't need to lock the hardware directly.
FreeBSD offers compatibility packages for Rocky Linux 9 and an older end of life CentOS 7. Both distributions are rpm based.
Coming from a Debian world I rather prefer to install the latest shiny Debian version, as I feel it would be much easier to install all the dependencies and shared libraries.
There are a few things we have to configure first before we can use it.
There are two jackd versions to choose from: jackd1 and jackd2.
jackd2 seems to be a better choice, but unfortunately it doesn't have support for OSS.
Version 1 is our only choice, and even then the OSS back-end isn't enabled, but no worries, we'll just activate it by compiling the package, which is dead easy with apt.
Either download your licensed copy or get a demo from https://www.renoise.com/.
At this point, everything is set up and should work properly.
Just make sure to start jackd before Renoise, or you have no audio obviously.
Also, ignore Renoise complaining about a non existing alsa, which we don't want to use anyways.
Call this script
The environment variables are needed to connect to the local Xorg / Xwayland.
Start jackd like this:
Adjust the -p 256 jackd parameter to the lowest possible value in powers of 2, the same way we did it before for virtual_oss.
In another terminal type
Make sure to choose the "Jack" device in the Renoise audio preferences.
I've tested installing the Linux version of the u-he ACE VSTi, and it works perfectly fine.
Just make sure to chroot into the Debian installation, then change to the user account for installation.
1. I am unable to start the Linux jackd daemon from a shell script, as FreeBSD just completely hard freezes; no core dump, no error messages, nothing. Just a complete lock up.
This even happens when chaining commands like this:
DO NOT RUN THIS IF YOU DON'T WANT A HARD FREEZE!
I may look into this later.
2. I wasn't able to run jackd with real-time priority, not sure if this is even possible.
-figure out why Renoise cannot find its shared files by default
-Linux VST / CLAP instruments and effects
- jackd real-time priority
- Linux jackd patch bays like claudia or patchage
- Linux audio session management with ladish (or even ladish on FreeBSD)
- patch Linux jackd audio into FreeBSD jackd (this would be so awesome)
- recording
- USB audio interfaces
- install and run REAPER (my other go-to audio software)
- patch jackd between Renoise and REAPER
- MIDI in- and output to hardware
- Windows VST / CLAP instruments and effects (possibly a tricky one, on Linux I would use wine with yabridge)
- add support for my Focusrite Scarlett 18i20 to FreeBSD (no idea if I will ever be able to do this)
I'll post my results in the forums if there's interest.
2025-03-23:
- starting Renoise from inside the chroot solves most problems of it not finding it's shared files, this requires some env variables and a bind mounted
- added section about testing of VST plugins
- added more info about hard freeze
As I like to do music, I want to bring my favourite tools with me, one of them being Renoise.
I've managed to perfectly run Renoise and jackd with the Linux compatibility layer, and this post is a summary of my findings with all the instructions, but also things that I couldn't get to work or haven't tested yet.
The assumption is that you have your FreeBSD already set up, with a user account and a desktop already up and running.
I've tested all this with swayfx on Wayland, but in theory it should work with Xorg just the same.
User settings
The Linux jackd daemon will complain if it cannot lock a certain amount of memory, we have to increase that limit for the user:
sh:
# add an `audio` user class in `/etc/login.conf`:
audio:\
:memorylocked=unlimited:
# regenerate the user login database:
cap_mkdb /etc/login.conf
# set the user class:
pw usermod <username> -L audio
# after logging in again, verify if "memorylocked" is not limited:
limits -l
Audio settings
By default jackd has trouble acquiring a lock on the OSS audio driver, i.e. if other processes are using it. There also seems to be some kind of "cool-down" after jackd stops, and it cannot acquire another lock for about a minute or two. I haven't figured out yet why exactly that is. However, there is a solution: virtual_oss. This daemon creates a virtual DSP, so jackd doesn't need to lock the hardware directly.
sh:
# load the "cuse" module, required by "virtual_oss":
echo "cuse_load=\"YES\"" >/boot/loader.conf.d/oss.conf
kldload cuse
# install "virtual_oss":
pkg install virtual_oss
# list your audio devices:
cat /dev/sndstat
# configure a virtual DSP with 48k, 16 bit and a buffer size of 128,
# adjust the buffer size using powers of 2 (32, 64, 128, 256, 512, 1024, etc.)
# to the lowest setting you can get away with without hearing underruns (audio crackles),
# adjust "-f /dev/dsp3" to the device number you want to use, see previous command
sysrc virtual_oss_dsp="-T /dev/sndstat -C 2 -c 2 -S -i 0 -r 48000 -b 16 -s 128 -f /dev/dsp3 -d dsp -t dsp.ctl"
# enable and start "virtual_oss":
sysrc virtual_oss_enable="YES"
service virtual_oss start
# enable realtime audio with the "mac_priority" module:
sysrc kld_list+="mac_priority"
kldload mac_priority
# add your FreeBSD user to the realtime group:
pw groupmod realtime -m <username>
Install Debian
FreeBSD offers compatibility packages for Rocky Linux 9 and an older end of life CentOS 7. Both distributions are rpm based.
Coming from a Debian world I rather prefer to install the latest shiny Debian version, as I feel it would be much easier to install all the dependencies and shared libraries.
sh:
# install debootstrap:
pkg install debootstrap
# unmount any previously mounted Linux filesystems, may not be needed if you haven't enabled the "linux" daemon before:
umount /compat/linux/proc /compat/linux/sys /compat/linux/dev/shm /compat/linux/dev/fd /compat/linux/dev /compat/linux/tmp
# make sure that "/compat/linux" doesn't exist yet, remove any "linux-rl9" or "linux-c7" pkgs if installed and remove the /compat/linux directory
# bootstrap Debian:
debootstrap bookworm /compat/linux
# enable and (re)start the "linux" daemon:
sysrc linux_enable="YES"
service linux restart
# we need /tmp to be bind mounted, add this to "/etc/fstab":
/tmp /compat/linux/tmp nullfs rw,late 0 0
# then mount it:
mount /compat/linux/tmp
Configure Debian
There are a few things we have to configure first before we can use it.
sh:
# fix broken ld-linux link (without this step, some Linux binaries will complain):
rm /compat/linux/usr/lib64/ld_linux*
cp /compat/linux/lib/x86_64-linux-gnu/ld-linux-x86-64.so.2 /compat/linux/lib64/
# fix some permission, which are broken by default:
chmod 644 /compat/linux/etc/profile
# add a Debian user with the same id and name as your FreeBSD user:
chroot /compat/linux adduser --uid `id -u <user>` <username>
# add the user to the Debian audio group:
chroot /compat/linux adduser <username> audio
# install a few dependencies in Debian:
chroot /compat/linux apt update
chroot /compat/linux apt install --no-install-recommends -y apt-src curl libx11-6 libxext6 libfontconfig1
# allow Debian to install sources:
echo "deb-src https://deb.debian.org/debian bookworm main" >/compat/linux/etc/apt/sources.list.d/src.list
chroot /compat/linux apt update
Compile and install jackd on Debian
There are two jackd versions to choose from: jackd1 and jackd2.
jackd2 seems to be a better choice, but unfortunately it doesn't have support for OSS.
Version 1 is our only choice, and even then the OSS back-end isn't enabled, but no worries, we'll just activate it by compiling the package, which is dead easy with apt.
sh:
# download the "jackd1" sources, compile, and install them all in one command:
chroot /compat/linux sh -c 'cd /usr/src && apt-src install -bi jackd1'
# then install the resulting "deb" packages without any user interaction:
chroot /compat/linux sh -c 'dpkg --force-confold -i /usr/src/*.deb'
# configure realtime audio on Debian:
echo "@audio - rtprio 95" >/compat/linux/etc/security/limits.d/audio.conf
echo "@audio - memlock unlimited" >>/compat/linux/etc/security/limits.d/audio.conf
echo "@audio - nice -19" >>/compat/linux/etc/security/limits.d/audio.conf
Install Renoise
Either download your licensed copy or get a demo from https://www.renoise.com/.
sh:
# if you have a licensed copy, copy it to "/compat/linux/tmp",
# or obtain a demo version, adjust the version to the latest available:
chroot /compat/linux sh -c 'cd /tmp; curl -O https://files.renoise.com/demo/Renoise_3_4_4_Demo_Linux_x86_64.tar.gz'
# unpack it:
chroot /compat/linux sh -c 'cd /tmp; tar -xf Renoise_3_4_4_Demo_Linux_x86_64.tar.gz && rm Renoise_3_4_4_Demo_Linux_x86_64.tar.gz
# install it, be wary that the unpacked directory name is a tiny bit different than the name of the "tar.gz" file,
# it's "3.4.4" instead of "3_4_4":
chroot /compat/linux bash -c 'cd /tmp/Renoise_3.4.4_Demo_Linux_x86_64; ./install.sh'
chroot /compat/linux rm -rf /tmp/Renoise_3.4.4_Demo_Linux_x86_64
# package needed to connect to local Xorg or Xwayland:
pkg install xhost
Run jackd and Renoise
At this point, everything is set up and should work properly.
Just make sure to start jackd before Renoise, or you have no audio obviously.
Also, ignore Renoise complaining about a non existing alsa, which we don't want to use anyways.
Call this script
renoise
and store it somewhere in your $PATH
:
sh:
#!/bin/sh
xhost +local:
doas chroot /compat/linux bash -c 'su - callistix -c "DISPLAY=:0 XDG_SESSION_TYPE=x11 QT_QPA_PLATFORM=xcb renoise"'
The environment variables are needed to connect to the local Xorg / Xwayland.
Start jackd like this:
sh:
doas chroot /compat/linux bash -c 'su - callistix'
jackd -r -d oss -p 256
Adjust the -p 256 jackd parameter to the lowest possible value in powers of 2, the same way we did it before for virtual_oss.
In another terminal type
renoise
.Make sure to choose the "Jack" device in the Renoise audio preferences.
VST plugins
I've tested installing the Linux version of the u-he ACE VSTi, and it works perfectly fine.
Just make sure to chroot into the Debian installation, then change to the user account for installation.
Problems
1. I am unable to start the Linux jackd daemon from a shell script, as FreeBSD just completely hard freezes; no core dump, no error messages, nothing. Just a complete lock up.
This even happens when chaining commands like this:
DO NOT RUN THIS IF YOU DON'T WANT A HARD FREEZE!
sh:
doas chroot /compat/linux bash -c "su - <username> -c 'jackd -r -d oss -p 256'"
I may look into this later.
2. I wasn't able to run jackd with real-time priority, not sure if this is even possible.
To-do
-
-
- jackd real-time priority
- Linux jackd patch bays like claudia or patchage
- Linux audio session management with ladish (or even ladish on FreeBSD)
- patch Linux jackd audio into FreeBSD jackd (this would be so awesome)
- recording
- USB audio interfaces
- install and run REAPER (my other go-to audio software)
- patch jackd between Renoise and REAPER
- MIDI in- and output to hardware
- Windows VST / CLAP instruments and effects (possibly a tricky one, on Linux I would use wine with yabridge)
- add support for my Focusrite Scarlett 18i20 to FreeBSD (no idea if I will ever be able to do this)
I'll post my results in the forums if there's interest.
Edits
2025-03-23:
- starting Renoise from inside the chroot solves most problems of it not finding it's shared files, this requires some env variables and a bind mounted
/tmp
, added / modified all that info- added section about testing of VST plugins
- added more info about hard freeze