Quick answer: Audio crackling and popping comes from two main sources: buffer underruns (the audio system runs out of audio data to play, producing glitches, usually because CPU load or a too-small buffer prevents audio being supplied in time) and clipping (audio amplitude exceeding the maximum, causing distortion/pops). Fix underruns by reducing audio-thread starvation (manage CPU load, appropriate buffer size) and clipping by managing audio levels so the mix doesn't exceed the maximum.
Crackling, popping, and audio glitches make a game sound broken and cheap, even if everything else is polished. These artifacts come from the audio pipeline being starved of data (underruns) or from audio being too loud (clipping), both of which are diagnosable and fixable once you know which you have.
What Causes Crackling and Popping
Two main causes. Buffer underruns, audio is fed to the output in buffers, and if the game doesn't supply audio data fast enough (the buffer runs dry before the next is ready), the output glitches, producing crackles/pops. This is often caused by CPU load (the audio thread/processing not getting enough time, especially under heavy game load or on weak hardware) or buffers that are too small (less margin for timing). Clipping, if the combined audio amplitude exceeds the maximum the format/output can represent (too many loud sounds summing, or audio mixed too hot), it clips, causing distortion and popping. Sample-rate mismatches and bad audio data can also cause artifacts.
Underruns produce intermittent crackling tied to load/timing; clipping produces distortion tied to loud moments (many sounds at once, loud effects). Which you have points at the fix.
How to Diagnose It
Determine whether it's underruns or clipping. If crackling correlates with CPU load or busy moments (heavy gameplay, weak hardware), or improves with a larger audio buffer, it's underruns (audio starvation). If distortion/popping correlates with loud moments (many sounds together, loud effects), it's clipping (levels too high). Check your audio buffer size and audio-thread load for underruns, and your mix levels/headroom for clipping.
Underruns often correlate with overall performance/CPU load, so the same field data that shows high CPU load or low frame rate can indicate audio starvation on those devices. Bugnet captures performance and reports with context, so crackling complaints and their correlation with load or specific devices surface, helping point at underruns (load-related) versus clipping (level-related).
How to Fix It
For underruns, reduce audio starvation, ensure the audio thread/processing gets enough time (don't starve it with heavy work, keep audio processing efficient), and use an appropriate buffer size (a larger buffer gives more timing margin, at a small latency cost, balance latency vs robustness). Reducing overall CPU load helps too, since underruns often come from the audio system not getting CPU time under load. For clipping, manage levels, ensure the combined audio mix doesn't exceed the maximum (leave headroom, limit how loud the sum of sounds can get, use a limiter if needed), so audio doesn't clip even when many loud sounds play together.
Also fix any sample-rate mismatches and ensure audio data is valid. After fixing, verify audio is clean under heavy load (no underrun crackling) and during loud moments (no clipping), including on weaker hardware where underruns are more likely. Clean audio, no underruns under load, no clipping at peak levels, is essential for a polished feel, and the fixes follow directly from which cause (starvation vs levels) you have.
Crackling is usually buffer underruns (audio starved by CPU load or small buffers) or clipping (levels too hot). Ease audio-thread load and buffer sizing, and keep the mix under the maximum.