Linux Audio
Audio applications are time-critical, so they need a preemptible (low latency) kernel with a 1000Hz timer frequency. - Ted’s Linux MIDI Guide
Latency is also driven by the size of the buffer in Jack.
The buffer size can be controlled by QJackCtl => and it gives an indication of Latency as well.
- a buffer size of 32 gives a latency of 0.667ms
- a buffer size of 1024 (the default) gives a latency of 21.3ms (which can be heared easily).
Low Latency Kernel
To check whether you are running a low latency kernel, use uname:
The important thing to notice is PREEMPT_DYNAMIC. That means that I’ve got a preemptible kernel loaded. This means low latency.
Note: There are variations on PREEMPT that require a little more investigation:
- PREEMPT means you have a kernel with full preemption and you are good.
-
PREEMPT_DYNAMIC allows preemption to be turned on and off at boot time with the kernel’s “preempt=” command line option. You’ll need to check your GRUB configuration (grep CMDLINE /etc/default/grub) to make sure this is either set to “preempt=full” or not set at all (the default is “full”). You can check the setting (immediately) after boot with “sudo dmesg grep preempt”.
We should have instead
==> Need to install a low latency kernel.
Reboot. Then go through the steps above again to make sure you actually have a low-latency kernel.
Enabling it
=> Audio Group
see also
- Pipewire (linux audio) - which is replacing jack on recent linux distro ( see Lubuntu 23.04 Now Uses PipeWire!
- Pulse Audio is deprecated and replaced by Pipewire
- Jack is also replaced by Pipewire
- ALSA - is still relevant - as it seems to more on the driver level.