I also noticed this on my system. It happens on vanilla WINE, too and killing Pulse also fixes it for me.
Manjaro Testing (so Arch based) x64
i7-8700K
NVIDIA 396.51
Kernel 4.17
A little correction: While pulseaudio -l indeed solves the problem temporarily, there are cases where the distortion comes back almost immediately. For example, in Bioshock Remastered, the audio is fine, but as soon as you get a radio call, the audio gets distorted (and stays like this).
Seems like I found a workaround for this:
See if you have a file named ~/.config/pulse/default.pa and open it - if not, use /etc/pulse/default.pa instead.
Next, locate the line beginning with load-module module-udev-detect and append the following to that line:
tsched=0
(keep in mind that you may need a whitespace before that)
This disables some pulse-internal timer scheduling which should lower CPU usage and keep latencies lower, but it isn't implemented too good in the drivers which is why it causes problems on some systems.
After adjusting the line, restart Pulseaudio one last time and the problems should be gone!
From Telegram chat with @PureTryOut
Ivan Semkin, [11.09.18 18:24]
try to modify /etc/pulse/default.pa, and add tsched_buffer_size=0 to load-module module-udev-detect
PureTryOut, [11.09.18 18:32]
Well that didn't fix it
Ivan Semkin, [11.09.18 18:34]
also may i know how your audio setup looks like?
PureTryOut, [11.09.18 18:36]
[In reply to Ivan Semkin]
Well, I use PulseAudio over the network to stream it from my desktop to a RaspberryPi which is connected to usb speakers, I guess that's the most "special" thing about it. But it's only Wine that is causing the problem so I'm 99% that isn't the problem
Adding tsched_buffer_size=0 on the remote RPI fixed the issue. What a weird setup :P
What a weird setup :P
I find that insulting ;)
But I guess the PulseAudio instance on the RPi isn't just used as an output, it actually manages the sound configuration and stuff. TIL I guess.
So, the new line should read load-module module-udev-detect tsched=0?
After trying a bunch of different stuff, I noticed that I was also having some slight audio stutter while doing other things. All other things. It was infrequent so I didn't notice it at first. However, when playing Castle Crashers, the distorted audio and crackling would start every time the audio stuttered.
I fixed the stuttering by disabling my WiFi adapter, which was enabled, but currently unused. Apparently there is a bug in kernel 4.15.0 that causes audio stutter when the wireless adapter is enabled, but not connected. My WiFi adapter is a Realtek RTL8188CE. I don't know which other wireless adapters or kernel versions are affected.
I disabled my wireless adapter through the Linux Mint Cinnamon connection tray icon.
I had this horrible audio stuttering playing Warlock - Master of the Arcane in my case pulseaudio -k fixed it, even though I have an unusual set-up. My PC sends the audio to a Raspberry Pi with external audio card that is made available on the local network.
I still have this crackling audio in Baldurs Gate 3. But as ubuntu 24 is using pipewire, the pulseaudio commands are not longer working. :(
Nothing extracted yet.
I noticed that after I woke my computer from hibernation, sound from all games I launched were distorted. Initially I thought the problem was with Castle Crashers, but it was happening with other games I tested.
Other system applications and other games not from Steam were fine.
pulseaudio -ksolved.System specifications: https://gist.github.com/FurretUber/78c1db97e438ad915e2d6da41dbc28ca
https://gist.github.com/FurretUber/4b9e506475e91f64e4204555a20a0886