sush Piku, my cat, rolling upside down

Audio stuttering on Linux

3 min read #omarchy #linux #audio

I was in the mood for something loud in my ear while everything feels muted. Normally I play music out loud, but I wanted the bass and beat to hit my ear while I focus on finishing up some tasks.

I’ve switched to Omarchy recently from the Mac ecosystem. It’s been truly a joy to use. I wanted to use my AirPods Pro 3 rather than wired earphones, as I needed noise cancelling. Connecting them took quite some time. And once they were connected, I started listening to music, but the audio started cracking every time a song changed.

Turning Bluetooth on (and accidentally off)

Every guide says “open bluetui”. My Omarchy doesn’t have bluetui. The newer versions have a Bluetooth panel built into the bar instead.

  • Super + Ctrl + B opens it
  • or click the Bluetooth icon in the top bar

But the toggle at the top of that panel turns Bluetooth off. I clicked it. Twice. “No bluetooth adapter.” Got quite frustrated.

To turn it back on from a terminal:

shell
omarchy-bluetooth-power on

It sometimes says “adapter did not come up”. Ignore it and wait 5 seconds. The adapter is just slow.

The crackle

It’s connected, but well, every time a song changed, the audio cracked. Like it was struggling to keep up for a second. Or playing some old cracked mixtape that’s damaged.

So I started ruling things out.

  • Wrong profile? No. It was on A2DP, the proper music mode, not the low-quality call mode.
  • Sample rate switching between songs? No. Fixed at 48 kHz.
  • PipeWire dropping buffers? No. pw-top showed zero errors.
  • Battery? Charged.
  • The codec? I switched from AAC to SBC-XQ. Still stuttered.

I guessed AAC first because it can be flaky on Linux. That guess was wrong.

So the software side was clean. The problem was somewhere in the radio.

One antenna, two jobs

When I started thinking about the hardware side, I realized my laptop has an Intel combo chip. Wi-Fi and Bluetooth live on the same card and share the same antenna.

And when does a music app hit the network hardest? When it loads the next song.

So every song change, Wi-Fi grabs the antenna for a download burst. Bluetooth audio gets starved for a moment. And it just cracks.

My Wi-Fi was on 5 GHz, so I figured interference wasn’t a thing. It still is on these chips. I was also on a wide 160 MHz channel, which probably doesn’t help.

The fix: a bigger buffer

If the radio drops out for a moment, the AirPods need more audio queued up to ride it out.

PipeWire sends audio in batches. Mine were 2048 samples, about 43 ms of sound. I doubled it to test:

shell
pw-metadata -n settings 0 clock.force-quantum 4096

Played music. Skipped songs. No stutter. Voila!

The cost is about 40 ms more delay. You don’t notice that in music.

Making it permanent

That command resets on reboot, and it applies to all audio. I only wanted it for Bluetooth headphones.

So I added a rule:

~/.config/wireplumber/wireplumber.conf.d/51-airpods-buffer.conf
monitor.bluez.rules = [
  {
    matches = [
      {
        node.name = "~bluez_output.*"
      }
    ]
    actions = {
      update-props = {
        node.latency = "4096/48000"
      }
    }
  }
]

Then reset the test setting and restart WirePlumber:

shell
pw-metadata -n settings 0 clock.force-quantum 0
systemctl --user restart wireplumber

Now only Bluetooth outputs get the bigger buffer. Laptop speakers stay as they were.

To undo it, delete the file and restart WirePlumber again.

What I took from this

  • The obvious suspect (codec) was wrong.
  • The software logs being clean was the real clue. It pointed me at the hardware.
  • On Intel combo cards, Wi-Fi traffic can mess with Bluetooth audio, even on 5 GHz.

Small win. Music works. Moving on.