Why Audio Crackles When Playing to Two Devices (Clock Drift Explained)
Discover why audio pops and crackles when playing to multiple soundcards or headphones at once, the physics of quartz clock drift, and how to fix it.
If you have ever tried to duplicate computer audio to two audio endpoints at the same time—such as routing Spotify to both your desk speakers and your USB headset, or splitting movie sound between two listeners—you have likely experienced a frustrating anomaly:
For the first five to ten minutes, everything sounds pristine. Then, subtle clicks and micro-pops begin to appear. Within twenty minutes, the sound dissolves into rhythmic crackling, stuttering, or an acoustic echo.
Why does this happen on a high-end multi-core PC that can render 4K video and play modern games without breaking a sweat?
The problem is not lack of CPU power or slow memory. It is a fundamental hardware reality known as Audio Clock Drift.
1. The Physics of Crystal Oscillators
Every digital audio device that produces sound—your motherboard's Realtek soundcard, an external USB DAC, or a Bluetooth receiver chip—contains a physical quartz crystal oscillator.
Digital audio is composed of discrete numerical measurements (samples) taken at a fixed frequency, typically 48,000 samples per second (48.0 kHz) or 44,100 samples per second (44.1 kHz).
The quartz crystal vibrates under an applied electrical voltage (the piezoelectric effect) to act as the master metronome for the Digital-to-Analog Converter (DAC). Every time the crystal ticks 48,000 times, exactly one second of audio should be played.
The Real-World Imperfection
In the physical world, no two quartz crystals vibrate at identical frequencies:
- Manufacturing Tolerances: Typical consumer audio oscillators have a tolerance rating between ±20 ppm and ±50 ppm (parts per million).
- Thermal Fluctuations: As your laptop warms up under GPU or CPU load, the crystal's physical frequency changes.
- Supply Voltage Ripple: Minor voltage variations from USB ports or battery discharge introduce subtle frequency shifts.
As a result, while Soundcard A believes it is playing at 48,000 Hz, its real hardware clock might be running at 48,001.4 Hz. Meanwhile, Soundcard B might be running at 47,998.1 Hz.
2. The Arithmetic of Buffer Starvation and Overrun
Let us examine what happens when an audio application feeds identical digital audio frames into both devices without clock synchronization:
Δf = 48,001.4 Hz - 47,998.1 Hz = 3.3 samples/second
A discrepancy of 3.3 samples every second seems negligible. But digital audio buffers are small—often only 256 or 512 frames long (approx. 5.3 to 10.6 milliseconds) to maintain low latency.
Time Passed Accumulated Sample Discrepancy
------------------------------------------------
1 minute 3.3 × 60 = 198 samples
5 minutes 3.3 × 300 = 990 samples (~20.6 ms)
15 minutes 3.3 × 900 = 2,970 samples (~61.8 ms)
30 minutes 3.3 × 1800 = 5,940 samples (~123.7 ms)
Within just 5 minutes, the faster soundcard has consumed nearly 1,000 more samples than the slower soundcard:
The Buffer Underrun (The Crackle)
The faster DAC consumes audio frames faster than the operating system supplies them. Eventually, its playback buffer drains to zero. When the soundcard reaches for the next audio frame and finds nothing, the output voltage drops to zero instantaneously. This sharp rectangular step function in the electrical signal produces a harsh acoustic "pop" or "click" in your headphones. This is known as a buffer underrun.
The Buffer Overrun (The Echo and Drop)
Simultaneously, the slower DAC is receiving more audio frames than its physical crystal can convert. Its buffer fills to capacity. To prevent infinite memory growth, the driver drops packets or resets its queue, creating an audible glitch, a stutter, or an expanding phase echo between the two listeners.
3. Why Naive Solutions Fail
Many rudimentary audio splitting scripts attempt to fix this with crude heuristics:
- Dropping Frames: When the buffer gets too full, delete 100 samples. When the buffer gets empty, insert 100 duplicate samples.
- Result: Highly audible clicks, thuds, and phase cancellation.
- Fixed-Rate Resampling: Convert 48,000 Hz to 48,001 Hz with a static resampler.
- Result: Because crystal frequencies drift dynamically with temperature, any static multiplier will eventually drift in the opposite direction.
4. The Engineering Solution: Closed-Loop PI Control
To solve clock drift without audible artifacts, professional audio software uses a closed-loop control system—the same mathematical principle used in automotive cruise control and aerospace navigation.
This is the exact architecture implemented in Multiout:
Step A: Exponential Moving Average (EMA) Fill-Level Filtering
Operating systems deliver audio in bursts. If you measure buffer levels instantaneously, the measurement bounces wildly between 10% and 90%. Multiout applies a low-pass Exponential Moving Average (EMA) filter:
y(t) = α · x(t) + (1 - α) · y(t-1)
This eliminates high-frequency measurement noise and extracts the true slow-moving crystal drift trend.
Step B: Proportional-Integral (PI) Steering
Multiout compares the filtered buffer level against the optimal target midpoint. The error signal drives a Proportional-Integral loop:
- The Proportional term responds to immediate changes in buffer pressure.
- The Integral term accumulates residual error over time to eliminate steady-state crystal frequency mismatch completely.
Step C: Fractional Linear Micro-Resampling
The PI loop continuously adjusts a fractional resampler within a tight window of ±5000 ppm (±0.5%). Instead of dropping audio frames, Multiout gently stretches or compresses the PCM waveform in sub-sample increments.
Because the speed correction is microscopic (fractions of a percent), the human ear cannot detect any pitch shift or harmonic distortion, yet the buffer level remains locked at the midpoint indefinitely.
How Multiout Keeps Both Headphones Synchronized
| Feature | Raw OS Audio Splitters | Multiout Audio Engine | | :--- | :---: | :---: | | Crystal Frequency Mismatch | Ignored (inevitable crackle) | Real-time PI controller active | | Buffer Management | Fixed size (eventual underrun) | EMA-filtered dynamic ring buffers | | Resampling Strategy | None or crude frame dropping | Continuous sub-sample fractional resampler | | Garbage Collection Stutter | Frequent in high-level tools | Zero heap allocations during streaming | | Long-Term Stability | Fails after 15–30 minutes | Stable indefinitely across hours |
If you are tired of popping audio and out-of-sync playback, download Multiout v1.1.0 for Windows and Linux. It solves the physics of clock drift so you can listen together in peace.
Try Multiout for 1-Click Multi-Headphone Sound
Skip cumbersome config scripts, loopback latency echoes, and clock drift crackle. Multiout provides clean real-time drift compensation, independent decibel volume, and millisecond delay alignment on Windows and Linux.