This section configures CachyOS for optimal real-time performance. These settings reduce latency and prevent system interruptions that could cause audio glitches.
Enable maximum CPU performance mode:
sudo powerprofilesctl set performanceWhat this does:
- Sets CPU to always run at maximum frequency
- Prevents frequency scaling from introducing latency spikes
- Essential for consistent real-time performance
echo off | sudo tee /sys/devices/system/cpu/smt/controlWhy disable SMT?
- SMT allows multiple threads per core, which can introduce timing unpredictability
- Real-time audio requires predictable latency
- Disabling improves determinism, reducing glitches
- Modern CPUs have enough performance even without SMT
sudo sysctl -w vm.swappiness=10What this does:
- Reduces system swapping (paging memory to disk)
- Swapping introduces unpredictable delays that destroy real-time performance
- Value of 10 = very conservative swapping (good for audio)
echo -1 | sudo tee /sys/module/usbcore/parameters/autosuspendWhy important?
- Disables USB autosuspend (-1 means disabled)
- USB suspend/resume creates unpredictable latency
- Audio interfaces are USB devices that need consistent power delivery
- This prevents the OS from suspending your audio interface
The settings above will be lost after a reboot. To make them persistent, use the studio-mode.service systemd service provided in the scripts folder of this project. This service automatically applies all of the above settings at boot.
To install it:
sudo cp scripts/studio-mode.service /etc/systemd/system/
sudo systemctl daemon-reload
sudo systemctl enable studio-mode.service
sudo systemctl start studio-mode.serviceFull kernel preemption is critical for real-time performance.
sudo nano /etc/default/grubFind the line starting with GRUB_CMDLINE_LINUX_DEFAULT. It will look something like:
GRUB_CMDLINE_LINUX_DEFAULT='nowatchdog quiet splash ..other parameters...'
Add preempt=full to the end (before the closing quote):
GRUB_CMDLINE_LINUX_DEFAULT='nowatchdog quiet splash ...other parameters... preempt=full'
sudo grub-mkconfig -o /boot/grub/grub.cfgIf you're using Limine or another bootloader instead of GRUB, see the CachyOS Boot Manager Documentation.
sudo rebootAfter reboot, these kernel parameters will be active.
Allow audio group users to have real-time priority.
sudo nano /etc/security/limits.d/20-audio.confAdd these lines:
@audio - rtprio 99
@audio - memlock unlimited
What these mean:
@audio= all users in the "audio" grouprtprio 99= allow real-time priority up to level 99 (highest)memlock unlimited= prevent audio memory from being paged to disk
sudo usermod -a -G audio $USERImportant: Log out and log back in for this to take effect.
Run the real-time checker:
rtcqsYou should see:
=== Real-Time Configuration Query System ===
[ OK ] Not running as root
[ OK ] sufficient rtprio and memlock limits
[ OK ] Scaling governor set to performance
[ OK ] Simultaneous Multithreading disabled
...
Spectre/Meltdown Mitigations
============================
[ WARNING ] Kernel with Spectre/Meltdown mitigations found
- ✓ OK items: Your system is properly configured
- ⚠ WARNING about Spectre/Meltdown: This is expected and acceptable. Modern kernels have these mitigations enabled for security. The performance impact is minimal for audio work.
| Change | Effect | Revert With |
|---|---|---|
| CPU performance mode | Lower latency | sudo powerprofilesctl set performance |
| SMT disabled | More predictable | echo on | sudo tee /sys/devices/system/cpu/smt/control |
| Low swappiness | Prevents disk I/O delays | sudo sysctl -w vm.swappiness=60 |
| USB suspend off | Consistent USB power | echo 2 | sudo tee /sys/module/usbcore/parameters/autosuspend |
| Full preemption | Responsive kernel | Remove preempt=full from GRUB and rerun grub-mkconfig |
Proceed to Audio Interface Configuration to set up your audio hardware.
There are alternative methods to persist these settings (CPU scaling performance, SMT, swappiness, and USB autosuspend). The systemd service approach above is provided for simplicity and portability. In the scripts folder, I also provide an apply-audio-tuning.sh script that can be run on demand with sudo:
chmod +x scripts/apply-audio-tuning.sh
sudo scripts/apply-audio-tuning.shQ: rtcqs shows FAIL for preemption
A: Make sure you rebooted after running grub-mkconfig. Changes don't take effect until next boot.
Q: Audio group membership not recognized
A: You must log out completely and log back in. Session restart alone won't work. Try opening a new terminal to confirm: groups $USER should show "audio".
Q: GRUB configuration won't update
A: Make sure you're editing the correct file and using sudo. Check: grep preempt /proc/cmdline to verify current kernel parameters.