2

I have two computers; one is a Macbook Pro running MacOS 10.13.5, and the other is a desktop running Windows 10. The desktop didn't come with a native bluetooth adapter so I purchased one from Amazon that connects via USB. To facilitate switching my keyboard and mouse between the two I also bought a USB switch from Amazon.

Recently in an effort to cut as many chords as possible I purchased a set of bluetooth headphones as well. I'm very pleased with the headphones and the USB tools that I just listed, except that I have real trouble getting the headphones to switch when I use the USB switch. Once I've paired the headphones to one of the computers and use the switch, something strange happens. If the headphones were previously paired with that computer I cannot get them to connect at all unless I delete them completely from the bluetooth settings and go through the pairing process all over again on the current machine. It's my understanding that this shouldn't be happening, so is this fixable? I've disabled the native bluetooth adapter on the Mac and confirmed that the Mac now uses the USB adapter instead.

5
  • Do you mean that you switch the headphones while paired+connected to the one computer to the other computer ?
    – harrymc
    Commented Aug 17, 2018 at 8:43
  • It doesn't matter if they're connected or not, but essentially yes. I can pair the headphones to both computers. After switching to one computer and then switching back the headphones will not connect. They'll try to connect; it'll even switch to connected status for a quick second, and then remain disconnected until I unpair and then pair them again.
    – Jimmy P
    Commented Aug 17, 2018 at 16:42
  • What is the make and model of the headphones?
    – Hogstrom
    Commented Aug 20, 2018 at 18:38
  • Sennheiser HD1 @Hogstrom. That's what the link in the question is for.
    – Jimmy P
    Commented Aug 20, 2018 at 20:33
  • @JimmyP: External links can break. It's good practice to add any pertinent information in the question itself.
    – 3D1T0R
    Commented Aug 24, 2018 at 0:38

1 Answer 1

2
+50

This is caused by the way Bluetooth devices authenticate to each other.
When the initial (manual) authentication occurs, both devices store a 'link key' which they use to automatically authenticate for future connections.

Note: Scroll down to "The easy way" at the bottom of this answer if you don't care about what's going on and how to do it manually.

What's happening

  1. You pair the headphones to computer A.
    • This requires manual authentication.
    • A new link key is generated.
    • Both devices store this link key.
  2. You flip your USB switch so that your Bluetooth dongle is now connected to computer B.
  3. You pair the headphones to computer B.
    • This requires manual authentication.
    • A new link key is generated.
    • Since computer B is using the same Bluetooth adapter that computer A used they both have the same address, so the headphones assume it's the same computer, and that it has lost its original link key (e.g. by you telling it to "Forget" the headphones) and when it stores this link key, it replaces computer A's link key.
  4. You flip your USB switch again so that the Bluetooth dongle is once again connected to computer A.
  5. Computer A and the headphones try to communicate, but can't because they have different link keys, and thus can't authenticate that they're the same device that they were originally given permission to connected to.

What you want is for the headphones to think they're both the same computer, therefore you need both computers to store the same link key.

The solution

Assuming you're using Windows' built in Bluetooth stack, the link key is is stored at HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\BTHPORT\Parameters\Keys under a key named after the Bluetooth address.
Note: This registry key isn't accessible unless you either alter its permissions, or launch the registry editor as the SYSTEM account. I recommend the latter option:

  1. Download PsExec from SysInternals.
  2. Launch Command Prompt.
  3. Execute X:\Path\to\psexec.exe -s -i regedit.exe.

If you were using Windows on both computers, you could simply pair to both computers, then copy the link key from the last one to the first one. Seeing as one of your computers is a mac, you're going to need to do a little more work, 'cause they store the link keys differently.

  1. First you should pair the Windows PC.
  2. Move the Bluetooth dongle to the Mac.
  3. Get the latest link key from the Mac:
    • This should be stored in /private/var/root/Library/Preferences/blued.plist
    • Execute sudo defaults read /private/var/root/Library/Preferences/com.apple.bluetoothd.plist to find all stored link keys.
  4. Find which link key is for your headphones.
  5. Convert this link key from Mac's format to Windows' format:
    • Effectively you split it up into 2 character chunks, then reverse those chunks.
    • As unrealistic as this link key is, if the Mac stored it as 1234567890ABCDEFGH, the Windows PC would need it to be GHEFCDAB9078563412
  6. Copy this newly converted link key into the Windows PC's registry over top of the old one.

The easy way

I also came across "BT-LinkkeySync", a open source (MIT licensed) project by Tobias Finke which can get all the keys from a Mac and output them as a .reg file for easy importing on Windows. Here's a link to it on GitHub: https://github.com/digitalbirdo/BT-LinkkeySync

1

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .