The likely issue for crackling sounds on Ubuntu 24.04 is that the distro has been switching over to pipewire and it runs a conversion service from pulse audio, namely pipewire-pulse.
The challenge is that many apps don't directly talk to piepewire, but do it through JACK and/or especially pulse itself, hence sound data needs to be moved though additional hops.
The default time buffers for pipewire-pulse is 2.7 ms, which means that an application needs to be able to fill sound content every 2.7 ms, otherwise pipewire will send to the audio device whatever was previously filled and potentially some random data, hence the crackling.
2.7 ms is quite a stringent time, especially for applications which don't have dedicated threads for audio (likely Proton/wine/games) and/or when running on old CPUs - hence one way to limit cracking is to tell pipewire-pulse to set a larger time buffer, albeit adding a delay to when the sound is sent to the audio device.
In order to do so, one needs to open the file:
/usr/share/pipewire/pipewire-pulse.conf
And then find, uncomment and change the configuration for the item:
pulse.min.quantum = 128/48000 # 2.7ms
from he value 128 to something larger - one should try 256 or even 512 as a starting point and if they experience no crackling they should leave as is (please note that after saving the file, one has to restart pipewire, pipewire-pulse via systemctl --user restart wireplumber pipewire pipewire-pulse).
The key is to find the smallest number so that the annoying crackling is not present (or at an acceptable minimum), because if larger numbers (such as 1024) make very little crackling happen, they add a delay (1024 / 48000 -> 21.333 ms).
Slower CPUs will need numbers as 512 or higher, or when using multiple software keeping the CPU busy, it's likely that a number such as 1024 or even 2048 may be beneficial.
Please note that crackling is by default (128/48000) noticeable on a 5950x (32 cores/16 threads) with 64 GiB of ram, hence it's likely much more noticeable on less powerful CPUs.
As a side note, not sure why/how Canonical/Ubuntu have decided to ship this stringent config, looking at how many threads complaining about crackling are pervasive on this forum and others.
The likely issue for crackling sounds on Ubuntu 24.04 is that the distro has been switching over to pipewire and it runs a conversion service from pulse audio, namely pipewire-pulse.
The challenge is that many apps don't directly talk to piepewire, but do it through JACK and/or especially pulse itself, hence sound data needs to be moved though additional hops.
The default time buffers for pipewire-pulse is 2.7 ms, which means that an application needs to be able to fill sound content every 2.7 ms, otherwise pipewire will send to the audio device whatever was previously filled and potentially some random data, hence the crackling.
2.7 ms is quite a stringent time, especially for applications which don't have dedicated threads for audio (likely Proton/wine/games) and/or when running on old CPUs - hence one way to limit cracking is to tell pipewire-pulse to set a larger time buffer, albeit adding a delay to when the sound is sent to the audio device.
In order to do so, one needs to open the file:
/usr/share/pipewire/pipewire-pulse.conf
And then find, uncomment and change the configuration for the item:
from he value
128
to something larger - one should try256
or even512
as a starting point and if they experience no crackling they should leave as is (please note that after saving the file, one has to restart pipewire, pipewire-pulse viasystemctl --user restart wireplumber pipewire pipewire-pulse
).The key is to find the smallest number so that the annoying crackling is not present (or at an acceptable minimum), because if larger numbers (such as
1024
) make very little crackling happen, they add a delay (1024 / 48000 -> 21.333 ms
).Slower CPUs will need numbers as
512
or higher, or when using multiple software keeping the CPU busy, it's likely that a number such as1024
or even2048
may be beneficial.Please note that crackling is by default (
128/48000
) noticeable on a 5950x (32 cores/16 threads) with 64 GiB of ram, hence it's likely much more noticeable on less powerful CPUs.As a side note, not sure why/how Canonical/Ubuntu have decided to ship this stringent config, looking at how many threads complaining about crackling are pervasive on this forum and others.