The crackle that ruins the take
You record a vocal track and hear a digital stutter right in the middle of the chorus. You lower the buffer size in your digital audio workstation and the crackling gets worse. You check your hardware and it works perfectly in another operating system. The problem is not your sound card. It is the default Fedora kernel scheduling policy. The standard kernel prioritizes desktop responsiveness and power saving over strict timing guarantees. Audio production needs the opposite.
What is actually happening under the hood
A standard Linux kernel uses a completely fair scheduler. It divides CPU time evenly among all running processes. When a background update starts or a disk operation spikes, the scheduler might delay your audio process by a few milliseconds. To a web browser, a two millisecond delay is invisible. To a digital audio stream, it is a buffer underrun. The audio interface runs out of data and fills the gap with silence or noise.
The realtime kernel patches the mainline kernel with the PREEMPT_RT project. It changes how the kernel handles interrupts and process priority. Audio applications can request a higher scheduling priority. The kernel guarantees that once an audio thread starts, it will run until it finishes or voluntarily yields. Other processes wait. This eliminates the jitter that causes dropouts.
Think of the standard kernel as a busy office manager who constantly interrupts tasks to check emails. The realtime kernel acts like a concert conductor. It keeps the tempo exact and ensures every instrument plays at the right moment. The tradeoff is that background tasks might feel slightly slower. You will notice it when compiling code or running heavy disk scans. Music production requires strict timing. General desktop use requires smooth multitasking. They are different goals.
Install the realtime kernel and configure your user permissions. Reboot before you debug. Half the time the symptom is gone.
Installing and activating the realtime kernel
Fedora ships the realtime kernel in the official repositories. You do not need third-party repositories or manual patching. The package is named kernel-rt. It installs alongside your standard kernel. GRUB will show both options at boot.
Here is how to install the kernel and grant your user the necessary scheduling permissions.
sudo dnf install kernel-rt
# Fetches the PREEMPT_RT patched kernel from Fedora mirrors
# Installs alongside the default kernel without removing it
# Keeps your current system bootable if something goes wrong
sudo usermod -aG realtime $USER
# Adds your current user to the realtime group
# Grants permission to use SCHED_FIFO and SCHED_RR policies
# Requires a new login session to take effect
sudo reboot
# Restarts the system to load the new kernel
# GRUB will automatically select the highest version by default
The realtime group is not just a label. It is a security boundary. The kernel restricts high-priority scheduling to members of this group. This prevents a runaway script from freezing your entire desktop. If you create a dedicated user for your DAW, add that user to the group instead.
After the system restarts, you need to tune the CPU frequency governor and interrupt handling. The realtime kernel works best when the CPU runs at a fixed maximum frequency. Dynamic scaling introduces micro-delays when the processor changes clock speeds.
Here is how to lock the CPU governor to performance mode.
sudo dnf install cpupower
# Provides the cpupower utility for managing CPU frequency
# Ships with the kernel-tools package on Fedora
sudo cpupower frequency-set -g performance
# Forces all cores to run at maximum turbo frequency
# Eliminates scaling latency during audio playback
# Applies immediately but resets on reboot
sudo systemctl enable --now cpupower.service
# Persists the performance governor across reboots
# Uses systemd to apply the setting early in the boot process
You also need to balance hardware interrupts. Audio interfaces generate interrupts when they need data. If all interrupts land on a single core, that core becomes a bottleneck. Spreading them across available cores keeps the audio thread responsive.
Here is how to configure IRQ balancing for low-latency work.
sudo dnf install irqbalance
# Installs the daemon that distributes hardware interrupts
# Ships in the base Fedora repositories
sudo systemctl enable --now irqbalance.service
# Starts the service immediately and enables it on boot
# Automatically detects new audio interfaces and rebalances
Edit the irqbalance configuration to exclude your audio interface if you want manual control. Configuration files in /etc/ are user-modified. Files in /usr/lib/ ship with the package. Edit /etc/irqbalance/irqbalance.conf. Never edit /usr/lib/. The package manager will overwrite manual changes in /usr/lib/ during updates.
# /etc/irqbalance/irqbalance.conf
# Ban specific IRQs from being balanced
# Useful when you want a dedicated core for audio
BAN_IRQS="42 43"
Replace the numbers with your actual interface IRQs. Find them with cat /proc/interrupts | grep -i audio. Run firewall-cmd --reload after every rule change if you modify network audio setups. Otherwise the runtime config and the persistent config diverge. Fedora's release cadence is six months. The N-2 release goes end of life when N+1 ships. Plan kernel upgrades on that cycle.
Run journalctl -xe if the service fails to start. The x flag adds explanatory text and the e flag jumps to the end. Most sysadmins type journalctl -xeu <unit> muscle-memory style. Read the actual error before guessing.
Verifying the setup
You need to confirm three things. The system booted into the realtime kernel. Your user belongs to the realtime group. The CPU governor is locked to performance.
Here is how to check the active kernel version.
uname -r
# Prints the running kernel version string
# Should end with .rt for the realtime variant
# Example output: 6.8.0-51.rt104.1175.fc40.x86_64
Here is how to verify group membership.
groups $USER
# Lists all groups your current user belongs to
# Must include realtime in the output
# Run this in a new terminal after reboot
Here is how to check the CPU governor state.
cat /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor
# Reads the governor setting for every CPU core
# Should print performance on every line
# Confirms cpupower.service is working correctly
Test the actual latency with latencytop. It measures kernel scheduling delays in real time.
sudo dnf install latencytop
# Installs the kernel latency monitoring tool
# Requires root to read kernel timing data
sudo latencytop
# Opens an interactive terminal interface
# Shows average and maximum latency per process
# Press q to exit when you are satisfied
Open your DAW and set the buffer size to 128 or 256 samples. Play a track with heavy CPU load. If the latency stays under two milliseconds and the audio is clean, the setup is complete.
Snapshot the system before the upgrade. Future-you will thank you.
Common pitfalls and error messages
The realtime kernel does not boot automatically on every hardware configuration. Some laptops with aggressive power management will hang at the GRUB menu. If the boot stops, hold Shift during startup to force the GRUB menu. Select the standard kernel to regain access. Then add intel_pstate=disable or amd_pstate=passive to the kernel command line for the realtime entry.
You might see a permission denied error when launching your audio software. The application tries to set a realtime scheduling priority but lacks the group membership.
ALSA lib pcm.c:2660:(snd_pcm_recover) underrun occurred
jack_server: cannot lock down memory (mlock failed): Operation not permitted
The mlock failure means your user is not in the realtime group or the system memory limit is too low. Run ulimit -l to check the locked memory limit. It should return unlimited. If it returns a number, add @realtime - memlock unlimited to /etc/security/limits.conf. Reboot and test again.
SELinux denials show up in journalctl -t setroubleshoot with a one-line summary. Read those before disabling SELinux. Most audio applications run fine under the default policy. Custom JACK or PipeWire configurations sometimes trigger avc: denied messages. Use audit2allow to generate a local policy module instead of switching to permissive mode.
Buffer size mismatches cause dropouts even on a perfect kernel. Your DAW, your audio interface, and your sound server must agree on the period size. PipeWire handles this automatically in most cases. JACK requires manual synchronization. Check your sound server settings before blaming the kernel.
Trust the package manager. Manual file edits drift, snapshots stay.
When to use the realtime kernel
Use the realtime kernel when you are running a DAW with virtual instruments and need sub-millisecond buffer sizes. Use the standard kernel when you are browsing the web, watching videos, or doing general office work. Use PipeWire with the standard kernel when you only need basic recording and playback without heavy plugin chains. Use the realtime kernel with JACK when you require strict session management and manual routing control. Stay on the upstream Workstation defaults if you only deviate from the defaults occasionally.