I'm necroposting this but whatever, it's important that the solution to this is known.
Audio crackling is usually caused when your system and application's audio latency is too low/fast for what your CPU can handle either generally or at the moment. You can change the latency settings in /etc/pipewire/pipewire.conf and /etc/pipewire/pipewire-pulse.conf.
Latency (in seconds) is defined by this formula:
Code:
quantum_size / sample_rate
For milliseconds:
Code:
quantum_size / sample_rate * 1000
Example: for 48KHz, a quantum size of 512 will result in approx. 10.7ms of latency (512/48000*1000 ms)
pipewire.conf
Scroll down until you find default.clock.rate, default.clock.allowed-rates, etc
You can adjust latency by modifying the values of default.clock.quantum, default.clock.min-quantum and default.clock.max-quantum. Higher values mean more latency but less audio crackling and CPU usage.
By default applications use the default size, but some applications specify to use the minimum quantum value (such as wine) and others specify to use the maximum value (web browsers)
pipewire-pulse.conf
Pipewire-pulse is also necessary since most applications do not support native pipewire.
Scroll down until you find pulse.min.req, pulse.default.req, pulse.min.frag, pulse.min.quantum, etc. Modify these values just like you did for pipewire.conf.
pulse.min.frag is used for audio capture, and so you can set it to a very high latency value without any problem, the others are for audio playback and so you should follow the same idea of what you did for pipewire.conf
There is also a node.latency setting in stream.properties if you scroll up, you can change that but I don't know if it changes anything