[SOLVED] Crackling sound in Proton games (pipewire)

SOLUTION: Install the faudio package from the official Arch repository. One thing to note: do NOT use Cachyos’s kernels with faudio, it fixes the audio issue but introduces micro-stuttering. Use the zen kernel instead (the other versions of the Cachyos kernel might be fine, I am using zen just to be safe).

In NFS Heat and Skyrim, after some playtime, there are these periodical cracklings in the game audio. I have narrowed the issue down to Steam/Proton since I also play World of Tanks via Lutris, skipping Steam entirely and the audio in WoT is perfectly fine. The issue might not even be with Proton because I run WoT with lutris-ge-proton (running the games through proton-ge in steam had no result). So far, I have tried switching to the rt version of the kernel I had been using (cachyos-bore) and adding the “preempt=full” kernel parameter but these have made no difference. Here are my specs if that is relevant:

OS: EndeavourOS Linux x86_64
Kernel: 6.7.4-1-cachyos-rt-bore
Resolution: 1920x1080, 2560x1440
DE: Plasma 5.27.10 (Wayland)
CPU: AMD Ryzen 7 5800X3D (16) @ 3.400GHz
GPU: AMD ATI Radeon RX 6700/6700 XT/6750 XT / 6800M/6850M XT
Memory: 6016MiB / 32001MiB

Edit: One thing I forgot to mention is that War Thunder, which has a native linux port, also runs through Steam without audio issues.

did you try with the regular kernel?
CachyOS has several highly experimental patches in its kernels. Every time I tried them I had issues of varying severity up to data corruption.
If you want to use feature level optimized packages, ALHP has the more stable approach (using them for months without issues)

Update: The regular kernel did not help. I have also recorded the issue (excuse the scratching noise, that’s my mouse’s cable dragging on my monitor stand). The relevant section starts at the 5 minute 55 second mark. I do not know a better way of sharing audio here, so I am using WeTransfer: https://we.tl/t-Sjum1EZcDC

Have you tried the zen or LTS kernel?

sudo pacman -S linux-zen linux-zen-headers 

For LTS,

sudo pacman -S linux-lts linux-lts-headers

These made no difference either I am afraid.

I’m new to linux so take what i say with a grain of salt (and sorry for my bad english, it’s not my main language).

I encountered this problem multiple times and i tried to fix it in every possible ways from changing alsa config to use rt kernels, even change from pipewire to pulseaudio and nothing worked, this guide is the only fix that actually worked for me (regarding wine games crackling), i have another audio problem, on youtube (only in 4K content) the audio crackles very badly and the only way that fixed it is to change the sample rate to 192000 Hz in the pipewire.conf file (tried wireplumber but only makes it worst), if anyone had this kind of problem try this fix that i did:

Copy pipewire config folder to .config/pipewire (if pipewire folder doesn’t exist in .config create it using mkdir or a file manager)

mkdir ~/.config/pipewire (in case the folder don’t exist)
cp /usr/share/pipewire/*.conf ~/.config/pipewire

edit the file “pipewire.conf”:
default.clock.rate = 192000

save the edit and restart pipewire

systemctl --user restart wireplumber pipewire pipewire-pulse

Hope this will fix your audio on youtube! :+1: