AirPods get stuck in low-quality 16 kHz audio mode when starting a VM

I always love when I find a really dumb solution that works reliably to fix a problem that should never really be a problem in the first place. But having worked with audio devices before—though nothing nearly as complex as the AirPods—I am willing to cut Apple some slack in building a seamless aural experience with using AirPods across phone calls, VOIP, iOS devices, Macs, music, and Apple TVs... it's hard to execute perfectly, and as I said in my review of the AirPods two years ago, these little earbuds are as close to perfection when it comes to a wireless sound solution for someone like me.

Anyways, here's the problem:

Sometimes (maybe 10% of the time) when I run vagrant up to build a local development environment for one of my software projects, and I'm listening to music, my AirPods suddenly switch into super-low-quality audio mode. It sounds like you're listening to a song played through a long subway tunnel or something.

What's happening behind the scenes is something in Vagrant or VirtualBox's boot sequence is making a change on the computer to assume some control over USB and/or audio IO, and that seems to—sometimes—affect the audio mode used by the AirPods.

This happens sometimes in other situations too; sometimes the AirPods switch to 'old POTS voice call quality mode' (as I call it) and stay there even after you hang up on a phone call. It often happens when you're using the AirPods' microphone with VOIP apps too.

Apple has some pretty awesome little utilities, though, which can help in these situations. As with last year's post, How I discovered my left AirPod was bad, in which I discovered a handy Bluetooth device diagnostics tool called Bluetooth Explorer, I have long known about an essential built-in audio app on the Mac which has been around for years: Audio MIDI Setup.

Apple Audio Midi setup app icon

By the name of the app (not to mention the icon—a music keyboard!), you wouldn't know that it's kind of a jack-of-all-trades when it comes to diagnosing and configuring almost any audio I/O aspect of your Mac, including surround sound inputs and outputs, microphone levels, output levels, and other specialized configuration. MIDI is really only a tiny part of what this app does!

This app can quickly highlight the problem that occurs when the AirPods get stuck in low-quality-output mode:

Audio MIDI Setup AirPod stuck at 16 kHz

Basically, the AirPods get stuck playing the Bluetooth audio stream at 16 kHz, which is okay(ish) for voice calls, but sounds terrible if you're listening to movies or music. Or anything, really, besides terrible quality audio streams or AM radio.

So after having this happen three times, I've found one solution which doesn't require a reboot, which works every time, restoring a pure, 48.0 kHz audio stream to the AirPods:

  1. Have some audio playing (e.g. play a song in iTunes)
  2. Open Audio MIDI Setup
  3. Select your Airpods in the list of devices (the one with 1 out or 2 outs)
  4. Toggle the 'Format' menu from "1 ch 16-bit..." to "2 ch 32-bit..." (Note that this will blip the audio for a few ms, but it will switch back)
  5. Keep Audio MIDI Setup open
  6. Disconnect your AirPods to your Mac using the Bluetooth menu
  7. Re-connect your AirPods to your Mac using the Bluetooth menu
  8. Wait for some playing audio to return to your AirPods—it will still be tinny and yucky sounding.
  9. Quit Audio MIDI Setup.

After Audio MIDI Setup quits, the audio should switch over to 32-bit/48 kHz mode again. No idea why, but hey, it works, and I don't have to reboot my entire Mac just to listen to audio again!

I originally posted the above fix as an answer to the Stack Overflow question AirPods: Extremely poor mic quality on Mac, but I thought I'd post it here so I can more easily keep the post updated over time... and because I usually search my blog for quick fixes like this and this fix wasn't on my blog yet!

Comments

It's interesting you mention this, as I've experienced the same (or highly similar) issue with my Google Pixel Buds.

Yeah, I forgot to mention, but I have sometimes encountered the issue with my Bose QC20 headset too. It doesn't seem exclusive to the AirPods, it's just that I've only ever tested the fix with AirPods, so can't verify it works for all other Bluetooth headsets.

Hi,
we also use vagrant heavily in our company and i found that this problems seems to occur with almost every bluetooth headphones. My solution was, after running vagrant up, open VirtualBox, go to the Settings of the running vagrant VM, and go to audio and just check the "Enable Audio Output" checkmark. It will switch to normal audio again.
Other solutions are, disabling audio completely or change to "Null Audio Driver". All those works.

Cheers!

Will try next time; I wonder if there’s an easy way to set that option in the Vagrantfile.

According to the Vagrant docs [0] and the VBoxManage command help output[1], this could do the trick:

config.vm.provider "virtualbox" do |v|
v.customize ["modifyvm", :id, "--audio", "none"]
end

I'm unable to test it right now since I'm currently on a Windows machine with Docker Desktop, which requires Hyper-V. Running VirtualBox at the same time is not possible.

[0] https://www.vagrantup.com/docs/virtualbox/configuration.html
[1] http://manpages.org/vboxmanage

That does look like it will do the trick; it was also mentioned in this issue which I found out through the HN comment thread for this article: Disable audio on the VM

I noticed this happening as well and downgraded to VirtualBox 5.2.18 which seemed to fix it for me; it seems there is some change in 5.2.20+ that causes this behavior.

Simply change the input device to any device that not your AirPods will fix the issue. (From system preference - Sound)

Unfortunately that doesn't fix it when it gets stuck like this. Nor does disconnecting the AirPods entirely and reconnecting them. I often use the option key to select an independent input device using the sound menu bar widget (hold down option while clicking, and you can choose discrete input and output without having to dig into System Preferences), but that doesn't help when this problem occurs.

The same thing happened to my cheap amazon SoundPeats headphones that were paired to a windows 7 machine when I fired up a virtual bo.

Better solution: Use proper headphones instead of shitty Bluetooth earbuds.

DUUHHHHHH

Thatis the best that you get the best Ipods in the market and then use that accordingly for your tests

The same with Bose QC35 II while running StarCraft II on macOS

you're wrong. it happens only with this version of virtualbox, it happens once in ten, it happens with many devices. title misleading, almost false. "The new version of virtualbox reduces the audio quality of bluetoot devices" would have aroused less attention. bad talking about apple is getting more and more a stir.

this really works like a charm!!!! saved me so much trouble, thank you !!!