Several things need to be done before be able to use correctly Jack Audio. The main thing is to enable real time privileges to it. And before you ask, it has nothing to do with having a real time kernel installed on your machine.
First of all, on Slackware, by default, you need to create a folder
mkdir -p /etc/security/
This folder will host a file
limits.conf with the following lines:
# @audio: refer to the user group # rtprio: the maximum priority given to a group to access the processor # memlock: the amount of RAM that an application can use @audio - rtprio 99 @audio - memlock unlimited
Now you can use the following command to give jackd the real time privileges:
setcap cap_ipc_lock,cap_sys_nice=ep /usr/bin/jackd
If you need, you can do the same the qjackctl (if you use the GUI).
setcap cap_ipc_lock,cap_sys_nice=ep /usr/bin/qjackctl
Finally, you can run the jack server using real time privileges:
jack -R -d alsa -d hw:0 -r 44100
You can refer to the manpage to find out the meaning of these parameters. Just as a quick reminder:
-R / --realtime: realtime -d: backend (could be alsa, dummy, freebob, firewire, ...)
If you don’t know the ID or name of your sound card, you can find it using:
aplay -l # aplay -l output **** List of PLAYBACK Hardware Devices **** card 0: Intel [HDA Intel], device 0: STAC92xx Analog [STAC92xx Analog] Subdevices: 0/1 Subdevice #0: subdevice #0 card 0: Intel [HDA Intel], device 1: STAC92xx Digital [STAC92xx Digital] Subdevices: 1/1 Subdevice #0: subdevice #0
In my case, I wanted to use the analog I/Os and it corresponds to the device 0.
Be aware that if you try to run jack using a sound card already used by another program, you will have an error. You will have to figure out which application you have to shut down.