r/linux_gaming • u/undead_fucker • Nov 23 '24
answered! Newbie here, I've tried almost all fixes, there's still constant audio crackling/popping when running games through wine, help
im desperate for any sort of fix, ive tried installing/uninstalling/reinstalling pulseaudio and pipewire and changed/added things in the .config folder
i tried to change the wine audio output after all this but it only shows pulseaudio and "built-in audio analog stereo" both of which have the crackling
should i reinstall windows to dualboot instead or is there something im missing ?
•
Upvotes
•
u/Delta_44_ Nov 23 '24 edited 4d ago
EDIT: Comment shortened, added user-only mode (no admin privileges required) which is suggested.
Explanation of your issue, fix below, in giant title, heh!
If you try to run
pw-top, look at the "err" column and see numbers rising, you have the "xrun" issue, which was a huge topic that I invested my time in trying to understand and fix.Before saying the thing that would actually help, I'll fill you in some details.
The crackling occurs because Pipewire sets the "requested" time (the applications tells it to have a certain latency) and (I assume you're using a laptop, like me, so weak as fuck integrated sound chip) that time is too low.
The values that you need to calculate that latency are:
You're probably familiar with the Sample Rate (you might have heard of "48000Hz").
Quantum is a different thing.
Let's say you have a quantum value of 64 for "Call of Duty", the game requests that quantum value and it tells pipewire to set the Sample Rate to 44100Hz.
The latency would be: (64 / 44100) * 1000 = 1.45ms!
That's so low, right?
Now, THE FIX!
To fix that you have to tell Pipewire "stop using stupid fookin' values and use a fixed REASONABLE value, goddamn!".
To do that, you have to open the terminal and do some commands, I'll explain them too!
Note:
sudois to invoke the administrator priviledges, you'll need it when I tell you to use it because you're going to create stuff in system folders, which you normally can't write into.Option 1 - LOCALLY (suggested)
If you don't want to change the option system-wide, for multiple reasons (it'll work regardlessly, don't worry) use this command and create the file in your home:
mkdir -p ~/.config/pipewire/pipewire.conf.d && echo "context.properties = {default.clock.min-quantum = 1024}" | tee ~/.config/pipewire/pipewire.conf.d/pipewire.confOption 2 - GLOBALLY
Let's create the file with the entire stuff in it!
mkdir -p /etc/pipewire/pipewire.conf.d && echo "context.properties = {default.clock.min-quantum = 1024}" | sudo tee /etc/pipewire/pipewire.conf.d/pipewire.conf---------------------------------------------------------------------------------------
If you followed everything correctly, just restart your computer and you'll be fine!