The Robservatory

Robservations on everything…

 

Debugging Bluetooth issues in macOS Sierra

I have quite a number of Bluetooth devices connected to my iMac: Apple’s Magic Mouse 2, Magic Keyboard, and the original Magic Trackpad. (Yes, I use both the mouse and the trackpad.) There’s also a pair of Sentey Bluetooth Headphones and a Satechi numeric keypad. Up until macOS Sierra, I hadn’t had any issues with these devices at all.

Since Sierra, though, my trackpad would occasionally disconnect then reconnect, which was annoying but generally harmless, given its role primarily as a shortcut touchpad. Much worse, though, were the Bluetooth headphones: I would hear horrible stuttering and skipping at random but frequent intervals. The audio dropouts were bad enough to make using the Bluetooth headphones impossible.

What follows isn’t really a tip per se, because there’s nothing here that shows how I fixed the problem for good. I have, however, found a workaround that restores my audio, which is something, at least. But if you’re having Bluetooth-related issues, you may find this writeup useful, as I cover some of the tools I used to try to resolve my Bluetooth issues.

[Note: This article was updated to include information on how to use Apple’s free developer accounts to download one of the tools I used—thanks to Torben for pointing this out in the comments; I had no idea there was still a free level of developer account.]

At first, I suspected the headphones as the cause of the problem, as they were quite cheap when I bought them. (I think they’ve since been discontinued, so they’re now a lot pricier.) However, when I used the same headphones with my iOS devices, I’d have no dropouts at all.

If it wasn’t the headphones, it had to either be interference from some other device in our home, or something specific to my iMac’s setup. Given the headphones worked fine with iOS devices, even when sitting in the same room as the iMac, I figured it had to be an iMac issue.

Investigating the problem

The next time I heard the audio interruptions, I launched Console (in Applications > Utilities) and found hundreds of ton of messages like these:

error	05:32:30.438295 -0800	bluetoothaudiod	Too many outstanding packets. Drop packet of 7 frames (total drops:952 total sent:16449 percentDropped:5.470950) Outstanding:8
error	05:32:30.457727 -0800	bluetoothaudiod	Too many outstanding packets. Drop packet of 7 frames (total drops:953 total sent:16449 percentDropped:5.476382) Outstanding:8
error	05:32:30.477943 -0800	bluetoothaudiod	Too many outstanding packets. Drop packet of 7 frames (total drops:954 total sent:16449 percentDropped:5.481813) Outstanding:8

The messages were logged every 0.02 seconds, and would repeat for hundreds and hundreds of entries. If I toggled Bluetoooth off and then on again (with a USB keyboard/mouse plugged in), things would get better…for a while. Then the audio skipping would start again, along with the flood of console messages. So I dug further.

Getting more control over Bluetooth

As a first step, I enabled Bluetooth logging using this handy tip, which reveals a Debug menu item in the Bluetooth menu bar item. Just hold down Shift and Option when you select the menu, and you’ll see the Debug menu:

With logging enabled, I was able to see an additional set of messages that always preceded the audio dropouts:

default	05:32:32.368907 -0800	blued	EVENT: Disconnection Complete: Reason = 19
default	05:32:32.370230 -0800	UserEventAgent	[BTUserEventAgentController deviceDestroyed] count = 4 previousCount = 5
default	05:32:32.370253 -0800	UserEventAgent	[BTUserEventAgentController deviceDestroyed] seconds of numberConnectedDevices[5] = 48
default	05:32:32.370264 -0800	UserEventAgent	[BTUserEventAgentController messageTracerEventDriven] deviceDestroyed

This seemed to show one of the devices disappearing, and it was followed by more Bluetooth-related error messages.

I thought maybe it was time to try something else from the hidden Debug menu: Reset the Bluetooth Module. When I did this, all my devices vanished for a bit, then came back. Sadly, so too did the audio dropouts. So that wasn’t a fix. I also tried “Factory reset all connected Apple devices.” Same result: no change.

Isolating the problem

At this point, I figured there must be interference from one of my Bluetooth devices, so I started experimenting, turning one off at a time and replacing it with its wired counterpart. This turned out to be the key to finding the cause of the problem: When my Apple Magic Mouse 2 is disconnected, audio playback over Bluetooth is perfect. My trackpad hasn’t disconnected, either. But when the mouse is on, sometimes audio playback is perfect, but oftentimes it’s unusable.

So that’s that—there’s some sort of issue with my Apple Magic Mouse 2 that causes audio interference. Not all the time, but a lot of the time. So is my mouse bad? I don’t know. I had no issues with these exact peripherals under El Capitan. I might have to purchase a new mouse to see if the problem goes away (we do have another Mac it could be used on, so it wouldn’t be a total waste of money.) For now, I’ve found that if I turn the mouse off for a few minutes then turn it back on, I’ll get a good long run of unbroken music playback. (I could just leave it off and use the trackpad, but I like the precision the mouse offers.)

Knowing the source of the problem, and having a workaround of sorts, is probably good enough for me for now. I’m hoping this is some sort of macOS bug that’s fixed in a future update. But before I wrap this up, just a little aside on a tool that can really help you see what’s going on with your Bluetooth devices…unfortuantely, while the tool itself is free, it requires a $99 per year membership fee, payable to Apple…and you can get it for free!

Diving deep into Bluetooth

Even though I don’t write any “real” code (AppleScripts and shell scripts are about as close as I come), I’m enrolled in Apple’s $99/year developer program. True, I have to be for my day job, but even before that, I was a registered developer—primarily to gain access to beta versions of macOS (Mac OS X). But even if you don’t pay, you can still download Xcode and other developer tools—including something called the Hardware IOTools for Xcode 7, which includes a nifty little app called Bluetooth Explorer.

Get the Bluetooth Explorer app

To get this app for yourself, start by logging in on the Apple Developer page using your usual Apple ID. You’ll have to read and agree to a couple of agreements, but once you do that, you’re in as a “free” developer. (The rest of the links in this section will require you to be logged in.)

You can download Xcode from the Downloads page, but you don’t need that huge package. Instead, head over to the More Downloads page, and search for Hardware IO tools:

You want the first one … alternatively, use this link to download them directly: Hardware IO Tools for Xcode 7.3 (12.7MB). After downloading, open the disk image and drag Bluetooth Explorer wherever you’d like to keep it—I have a Dev Utilities folder for such tools.

Use Bluetooth Explorer

Bluetooth Explorer really lets you dig into all the nitty-gritty of Bluetooth. I’m not sure if it will help solve my problem or not (I have it running now, waiting for the problem to recur), but it certainly looks like it could provide more clues, if not an outright answer.

Here’s how it looks, set up to view my connected devices, with pretty much every available window shown.

Of particular interest to me are the Event Log (large top center window) and the link characteristics graphs (left side). I’ll keep my eye on these graphs the next time the dropout problem recurs. Obviously, you don’t need every window open to use the apps—choose which windows to see via the Tools menu, or get access to many of them via the Dashboard window—just press Command-0.

And yes, this tool scores high on the geekery scale. But if you’re stuck with a Bluetooth problem, it just might be the geekery you need to solve it.

10 Comments

Add a Comment
  1. Hi Rob
    With a free Apple Developer membership it is also possible to download the additional tools for Xcode which includes the Hardware IO Tools. (But you cannot download the beta versions of MacOS and iOS).

    Thanks for the great articles and I hope you solve your problem.

  2. I hope you’ll keep this post updated with whatever Bluetooth Explorer reveals about your Magic Mouse. I think Apple’s Bluetooth peripherals tend to be a little “chatty”, and it may be that your mouse is so unhappy about its charge level or some other diagnostic results that it INSISTS on continually blasting status messages don’t actually bubble up to the UI but are still polluting the Bluetooth radio environment.

  3. I’ve been having the same issue but with the gen 1 track pad and keyboard. I reinstalled the OS, PRAM etc replaced them with the gen 2 key board and track pad and also had the apple store replace the bluetooth antenna but still having the same issue. I’m really getting annoyed with it. I have a really nice mac pro, but it’s basically useless as soon as I plug in bluetooth headphones and this only started after the last OS update. If anyone finds a solution, please let me know!

  4. I’ve am experiencing the same issue as slajax. And it seems to have started around the same time for me. I have a Magic Trackpad 2 and it is interfering with my BT headphones. If I turn off the MT2, music plays fine. Really annoying! I’d be interested in a solution as well.

  5. I find that my Phillips headsets will not autopair if my wireless magic mouse is connected. When I disconnect my mouse, the headset is recognized and will then pair. So I believe the mouse does interfere with the Phillips connecting.

    1. Did this happen to you under 10.11? It didn’t for me; everything just worked. Sierra introduced some change, I think.

      -rob.

  6. I have the exact same problem. I tried with beats and bose bluetooth headset and 2 logitech and 1 microsoft mouse, but always with one headset and mouse, the mouse disconnects every 2 minutes with the same errors as in this article. I looks like a softwarebug in Sierra

  7. An update. I ended up switching to the latest Sierra beta and I think things are better. I haven’t noticed the crackling in my headphones since then. However, my keyboard will sometimes disconnect still.

    1. I´m on MacOS Sierra 10.12.5 Beta (16F43c), still have the Bluetooth issues with my headphones, it´s impossible to use them, sound keeps choppy.

Leave a Reply

The Robservatory © 2017 Built from the Frontier theme