
AirPods get stuck in low-quality 16 kHz audio mode when starting a VM - geerlingguy
https://www.jeffgeerling.com/blog/2018/airpods-get-stuck-low-quality-16-khz-audio-mode-when-starting-vm
======
DiabloD3
I will also repeat what has been said about twelve times thus far: Enabling
microphone makes Bluetooth headsets turn into pure shit.

Guess what 5.0 finally allows as per spec? You can use any codec you want for
telephony mode, including 44.1 stereo + 44.1 mono SBC.

Guess what Apple does not implement, and guess what every 5.0 headset I've
seen so far also does not implement? Sigh. Bluetooth is 20 years old this
year, and is still a fucking unmitigated trainwreck of unusabilty.

~~~
morpheuskafka
Interesting. On Windows 10, it shows a in/out "Headset (AirPods Hands-Free)"
and an out only "Headphones (AirPods Audio)." So this transition would be very
easy for the user to see. However, I've as yet been unable to get a straight
answer on what profile the "Headphones" mode is actually using.

~~~
DiabloD3
A2DP SBC.

Apple products that implement AAC over A2DP only do so on iOS devices (and in
only limited cases), and also do not implement anything else (such as any form
of AptX, or LDAC).

~~~
pilif
you can tell macOS to use AAC using an Apple tool called "Bluetooth Explorer".
Also, Macs equipped with a T2 chip default to using AAC even without the
manual intervention.

You can check what codec is used by alt-clicking the bluetooth icon in your
menu bar and hovering over your headphones. There will a an "Active Codec"
entry that shows which one is used (during playback).

------
userbinator
I have tried to read the BlueTooth specs a few times, never really getting
anywhere, and am amazed that it all (mostly) works given the _immense_
complexity in those standards[1]. Thus I'm not surprised that bugs like this
can occur.

[1] The BT5 core spec is freely downloadable. It is a 25MB PDF with over 2800
pages. That's just the core, there are other specifications that layer on top
of it.

~~~
darawk
I'm curious, to people here who are technically familiar with the standard, do
you think this complexity is justified, or is it a case of an over-engineered
protocol?

~~~
dmitrygr
It has 20 years of organic growth and includes a lot of lessons learned from
the initial underspecification. Lots of profiles were specified but never used
(video delivery, over bluetooth, anyone?). Many were not fully thought through
and had to be revised (often in nasty ways to remain backwards-compatible).
Sadly backwards compatibility makes it worse and worse every year. If you go
and write a stack that complies with the spec 100%, you'll find that it works
with maybe 50% of devices out there.

BT 4.0 was a chance to start over, and it will help a lot, in time... BT 5.1
will likely finally bring stereo audio over BT LE, with a cleaner spec than
A2DP is. But once again, until all the EDR (classic) devices out there are
trashed, BT classic remains a huge pain in everyone's rear and a mandatory
thing to support. How soon is that? More than 10 years from now! Why? Cars are
a major BT use case and many still ship with BT 2.1 car kits. People do not
replace cars as easily as headphones.

source: i work on this currently

~~~
Wowfunhappy
If BT 4 is better, shouldn't BT 4 devices like the AirPods connected to BT 4
devices like modern Mac computers not have these types of weird problems? :/

~~~
visarga
In my case, AirPods + MB Pro 2013, BT just disconnects for no reason
sometimes, other times it refuses to connect. And it's Apples to Apples.
Considering the hefty price tag for both devices, the fact that they often
fail to produce sound is shameful.

------
floatingatoll
You may find value in this Mac app that disables the microphone input channel
on AirPods as part of pairing them, which should in theory permanently resolve
your issue:

[https://c-command.com/toothfairy/](https://c-command.com/toothfairy/)

(Note that I neither know how they’re doing it nor have I tried to reverse
engineer it. Works well for me in non-VMWare scenarios!)

~~~
zbuttram
I have Toothfairy and it is amazing as a quicker way to connect my AirPods to
my Mac, but I've tried that option for disabling input and it didn't seem to
work for me unfortunately. Still absolutely worth the $3 for the other
features though.

~~~
mjtsai
The only time I’ve seen the input switching not work is if there’s another app
that keeps forcibly changing the input back to the AirPods. Some games and
virtual environments do that. If you contact toothfairy@c-command.com, I can
look into what the issue might be on your Mac.

------
gtirloni
I only skimmed the article but I didn't see Bluetooth profiles mentioned:

[https://en.m.wikipedia.org/wiki/List_of_Bluetooth_profiles](https://en.m.wikipedia.org/wiki/List_of_Bluetooth_profiles)

It's likely switching from A2DP to HSP because the microphone is activated.

This is very common with Bluetooth headsets and it's what still makes me
choose corded headsets to this day.

Newest Bluetooth reviews are supposed to have more bandwidth for high quality
audio but I'm stuck with (not so) old speakers and car.

If you need wireless, it's better to go with one of those 2.4GHz receivers but
they require a small USB adapter. Not really a solution for AirPods.

~~~
geerlingguy
I know that’s what happens, but the bug is that it _stays_ in that mode even
after the VM has relinquished its claim on the microphone.

Note that this only started happening in this particular scenario after 10.14.
It happens in other scenarios from time to time (that is, it stays in HSP even
after the app requesting mic use is quit).

------
synaesthesisx
It's likely because the microphone/input channel is being activated - forcing
the low-quality audio codec.

~~~
saagarjha
Yup, this seems to happen whenever AirPods convinces itself that it needs to
use its microphone, which seems to necessitate degrading the audio quality.

~~~
zbuttram
Doesn't happen on iOS though, which leads me to think it must be a limitation
of the Bluetooth hardware in Macs but not in iPhones and iPads?

~~~
saagarjha
I have seen this happen when using Siri or calling people on iOS.

~~~
zbuttram
All of my iOS devices are rather new, perhaps it depends on which one. I've
used Siri, made calls, and spoke in channels on Discord without having it
happen on my iPhones 7 and XS, and 2018 iPad. In comparison, my Macs are a
2013 Macbook Pro (running Mojave) and a Hackintosh desktop (still on High
Sierra).

~~~
saagarjha
I’m using an iPhone SE, so it might be that it doesn’t have the necessary
features to support this?

------
dijit
Happens to my Bose QC35s quite often. Part of the issue is that the mic cannot
be enabled when full quality audio is active. I guess this is a bandwidth
limitation.

My issue stems from pulse audio saying that high quality mode is not available
though. Common problem though. Not exclusive to AirPods.

~~~
vel0city
Meh, its not really a bandwidth limitation on modern Bluetooth devices, only
that it negotiates a different Bluetooth profle. The high quality stereo audio
mode (A2DP) has no support for microphones in the spec and is usually highly
buffered, so it switches over to the headset profile (HSP). This mode is
designed for compatibility all the way back to your old Motorola Razr flip
phone, so it doesn't exactly have the highest quality audio options.

If we were to really look at it as a pure bandwidth concept, Bluetooth has
plenty of bandwidth to handle high-quality, low-latency, compressed audio
streams between two devices. There just isn't a profile written into the spec
to handle it, so there's no standard way of negotiating that between a headset
and a device.

[https://en.wikipedia.org/wiki/List_of_Bluetooth_profiles](https://en.wikipedia.org/wiki/List_of_Bluetooth_profiles)

~~~
southerndrift
>(A2DP) [...] is usually highly buffered, so it switches over to the headset
profile (HSP).

Thanks for this information. That explains why it is reasonable to drop the
audio quality.

------
ddingus
Headphone jack?

Honestly I just hate Bluetooth. I've had it work really well. Been completely
pleased. But I've also seen a never-ending raft of this crap. I just don't
want to bother. I'll take the wire thanks

~~~
geerlingguy
I prefer wires in almost every situation (just upgraded to a 16 port switch
because I have enough wired devices in the house for it now), especially for
audio... but in this case I’m in meetings a lot, I listen to songs sometimes
in between, and I move around my office quite a bit. I struggled with a decent
USB headset for a while, but after five or so times almost breaking my
computer from moving my arm and catching the cord (thus yanking the computer
off the desk), I started a journey down the path of many different Bluetooth
options.

~~~
ddingus
Yeah. I have some bluetooth gear. I so very rarely use it, but like you, there
are times, right?

I just do not expect much. If it pairs and does anything, cool. Get it done,
ditch it quick. When it works well? Total fucking bonus!

I have that gear due to a couple well meant gifts. Like most things, it goes
in my road bag. I have a very wide variety of bits in there accumulated over
20 some years. Can handle a ton of odd scenarios. Built it up one fucked
scenario at a time. (Like a lot of us probably have)

Edit: New venture, and it is more service related. I am building up a new bag.
Lots of new tools instead of bits of tech. Fun!

Every time I go to trim the fat, something comes up. Last time it was some
poor tech, early in his career setting up the demo from hell for a trade show.
They stuck the guy with some low grade monitor. The combination of the product
graphics sub system, it's OS and that screen just would not play well with
digital video, which he was equipped for.

Tech support told him analog VGA... the look on his face was hilarious! He
thought he was doomed. I went to my room, got the cable and gave it to him.

"WTF?"

I said, "this is how it starts brother, good luck, and keep the cable."

(Yeah, I did replace that one. It is not over yet where analog video is
concerned. Soon though. Soon, I keep saying...)

That road bag goes to shows and other engagements where who knows? Worth
carrying it.

A lighter version exists in my back pack. Mostly adapters, other bits. Lean
and mean. I am mobile enough to warrant some kit or other.

Blutooth has saved my ass a few times. Both kits have a couple basic Blutooth
devices, and some USB ones too.

To me, it is like that VGA cable, or odd gender changer, or dongle, USB
device, world power brick with tips, etc. An option, and sometimes a welcome
one, but not a daily driver.

My dailies are super simple, very robust, ultra low hassle. I just do not have
the time and energy. Save that for the tough gigs.

~~~
voltagex_
I'll be very sad when analog video dies - I've just been fighting with getting
the Nintendo Switch to output via an unofficial dock (because the official one
is too big to travel with).

~~~
zapzupnz
You're game, trying to use an unofficial Dock. There's a heavy risk of your
Switch entering a boot loop, effectively becoming bricked.

~~~
voltagex_
Uh,yes, apparently I've been very lucky. I've stopped now.

------
saagarjha
I figured I’d ask this here: my AirPods have never been what I’d call
“perfect”, and I’m trying to figure out whether these are fundamental issues
with AirPods or if I have a bad pair. Is it normal for AirPods to ignore
double taps on them 50% of the time (it’s worse if I try to use Siri, which
almost never works, and better if I try to play/pause but still not great)? My
AirPods also take up to thirty seconds to switch between devices. Is this
normal? Everyone I have met raves about their AirPods but for me they have
simply been “passable”, at the level I’d expect from any other Bluetooth
headphones.

~~~
breatheoften
I also find them to be incredibly slow to connect to my iPhone — frequently
necessitating going into system preferences->Bluetooth on the iPhone and
clicking on the AirPods before the connection finally happens ... it’s a
complete mystery to me whether they will be connected when I pull my phone out
and put them on at any given time (seems worse with Xs than before - though Xs
seems worse generally in all network connectivity experiences for me than
previous phones ...)

I find them passable as well — but frequently annoying - though I do like the
design and fit a lot...

~~~
iscrewyou
Can you use the play widget on the control center? That’s how I pair mine
whenever they are acting iffy. Simply 3D Touch the music/play widget. Click on
the little triangle on the top right and select your AirPods. That works for
me 100% of the time.

~~~
geerlingguy
Ditto. Fast and easy, never had an issue on iPhone or iPad from control
center. Have only had weird issues from time to time on the Mac.

~~~
saagarjha
How long does it take you to pair? I use the control center widget almost
exclusively and it takes a while to connect.

------
tedunangst
A dozen comments that this happens because the microphone is turned on, but
nobody is asking why vagrant is turning the microphone on?

~~~
Rjevski
Vagrant is using VirtualBox under the hood, and presumably the default VB
config is to let the VM use two-way audio, so it preemptively opens both the
output and mic channel in case the VM needs it.

~~~
tedunangst
I have so many questions, but will not ask them because I don't think I'll
like the answers.

~~~
voltagex_
THe answer is better defaults. Raise a bug report.

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

------
m0zg
I figure the audience is right on this site, so here's my question: for
someone used to pretty decent over the ear and in-ear headphones (Sennheiser,
AKG, Etymotic), are AirPods passable at least, or total trash like Apple's
wired earbuds? What's the quality differential?

This is the thing I don't get about Apple. They sell $1.1K phone and include
these crappy $3 earbuds in the box. Can they do better? At their production
volumes and profit margins, I have no doubt. Even Samsung includes a decent
pair of AKGs.

~~~
dawnerd
They're about the same as the normal earbuds but still way better than 3
dollar earbuds. I use them not for the quality but for the convenience when
making phonecalls. Unfortunately the battery life on them is abysmal two years
later. Barely lasts 10 minutes after daily use.

~~~
c1sc0
Never heard this before. Mine are 1yo with intensive use & easily still last
hours. 2 years is a really short lifetime

------
zbuttram
Yep, happens any time the AirPods mic is activated on MacOS, has been that way
since launch as far as I know. Doesn't happen on iOS. I can only assume it has
something to do with the Bluetooth hardware or they would have fixed it by
now.

~~~
geerlingguy
But it usually goes back once the mic is no longer being used. And I've had it
happen a few times where I take a 'continuity phone call' from my iPhone on my
Mac. The AirPods switch to the low-quality call mode, I have my conversation,
I hang up, and the audio quality still stays switched until I do the Audio
MIDI workaround or reboot.

Most of the time that doesn't happen, though—when I hang up the audio goes
back to normal mode (48 kHz). So it seems to be a weird bug with the switching
that I've only ever seen on the Mac (works perfect on iOS).

------
pteraspidomorph
They are probably getting paired with a device capable of receiving audio
input (the VM itself?) and the bluetooth profile jumps from A2DP to HSP.

------
deanclatworthy
Similarly there’s a bug when starting the iOS simulator with certain
permissions that does this to ALL Bluetooth headsets.

~~~
xenadu02
Go to the Hardware menu, Audio Input, and select "Built-in Microphone" as the
input. Then input will never use your BT headphones.

------
cdolan
I've found that if I ever do a Facetime call on my 2015 ESC Macbook pro, my
Airpods use the same terrible quality audio channel. Very frustrating to say
the least!

------
jerkstate
This happened to me in Windows on my bose qc35's when I started GTA5

------
TipVFL
I recently ran across similar issues while developing a web app,
[https://rap.coach](https://rap.coach) , that features simultaneous audio
playback and recording. A lot of people are saying that Bluetooth headsets
have to go into a super-low quality mode when both playback and recording are
enabled, but based on my testing it appears to be a software issue.

The issue appears when I use Rap Coach with Chrome on Android, but doesn't
happen in Firefox on Android. It is very frustrating, getting better control
over the audio hardware is one of the main reasons I'm going to end up
building app store versions of this thing.

------
froboy
I've seen the same issue, and (at least in my case) it seems to be from audio
being enabled on the VM and that getting passed through by Virtual Box.
Something like this for your own box should solve the root cause:
[https://github.com/palantirnet/the-
vagrant/pull/60](https://github.com/palantirnet/the-vagrant/pull/60)

------
ex3ndr
This happens for any bluetooth headphones on Mac. It usually means that mic
was turned on.

------
ianlevesque
Honestly coreaudiod is a hot mess. Every time I plug in a usb audio adapter it
puts balance at 100% left channel and max volume. killall coreaudiod fixes it.
I miss when Macs worked reliably.

~~~
bouke
I’ve run into this issue since owning my first Mac, circa 7 years ago. So
while I don’t agree with your over generalization, I do agree that this is
very bad and should be fixed once and for all!

------
mmgutz
To be fair, I've seen this happen with all my bluetooth headsets not just
AirPods. The issue eventually fixes itself after the VM guest boots into an
OS.

------
iscrewyou
This happens to me on Parallels 10. But it only happens for like 5 seconds.
Then it jumps back to normal sounding experience.

It’s Parallels 10 booting up a Windows 7 VM.

------
drivingmenuts
Did weird stuff like this happen with wired headphones?

~~~
pohl
It’s definitely a Bluetooth audio thing. I can hear mine shift into a lower
quality audio when I use them for conference calls. (There’s a limited amount
of bandwidth and it has to make room for bidirectional audio.)

~~~
makarhum
As someone else pointed out it is not actually bandwidth problem. Reason
behind this is that high quality audio streaming profile A2DP is one-way only
and once mic is needed, profile is changed to bidirectional but low quality
HSP. My workaround for conference calls is to use my MacBook's internal
microphone instead of one of my Bluetooth headset.

~~~
pohl
I suspect that the underlying reason that the profile switch happens, though,
is because of bandwidth limits. That’s what Sennheiser is telling their
customers, at least.

[https://sennheiseruk.happyfox.com/kb/article/175-different-b...](https://sennheiseruk.happyfox.com/kb/article/175-different-
bluetooth-profiles-a2dp-vs-hsp/)

The real answer may be more subtle than that. Maybe there is just enough
bandwidth, but using it would have an adverse effect on latency, which
bidirectional use cases are more sensitive to.

Either way, the profiles were designed within constraints. They’re not
arbitrary.

------
amelius
Bluetooth works fine on my Linux desktop (ASUS mainboard) with Bluetooth
dongle.

------
fortyseven
Discovers a secret "Vaporwave Mode", calls it a bug, not a feature. Heretic!

------
aaaaaaaaaab
Back patting myself for sticking to wired, passive earphones. I ain’t got no
time for debugging yet another piece of crap on top of my WiFi router, my NAS,
my HTPC, and other misc. equipment that should have just f_cking worked...

