Disabling a specific Bluetooth adapter in Ubuntu 19.10 (Hacked Lenovo T420)
- Approach?
- Install the Broadcom firmware drivers
- Listing all active bluetooth adapters
- Disabling the specific adapter
This all started because my Bluetooth mouse was lagging and the pointer skipping!
Say you have a crappy built-in BT adapter, with a very old BT version (2.0, for example), and you pop in a new wifi card with combined Wifi-6 and BT 4.0 LE, such as the AzureWave AW-CB160 with the BroadCom BCM94360HMB chipset. Wi-Fi ac at 1300Mbps was working out of the box, but Bluetooth 4.0 was nowhere to be found.
Opening up the T420 to change anything is a breeze. Right to repair FTW!
Ubuntu Linux will automatically use the first adapter it detects, so your shiny new adapter will be ignored, and the system keeps using the other, older and weaker one.
Approach?
I figured out that I needed reliable way to permanently disable a specific adapter (on boot!) in Ubuntu Linux when you have more than one. Many solutions online will tell you to use /etc/rc.local
, to add udev rules, or to mess around with bluetoothd
’s main.conf
. I also tried adding hciconfig down commands to /etc/rc.local… nothing worked for me.
Oh, and blacklisting the driver only works if you have different manufacturers in your adapters. If they are both BroadCom, like my case… when you blacklist the driver, both adapters are disabled. Not good.
Install the Broadcom firmware drivers
Go to Software -> Additional drivers and activate the Broadcom STA drivers (some say that they are junk, but hey, they work for me!)
Listing all active bluetooth adapters
Check it out. Run:
1
hciconfig -a
You will see something like this:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
hci0: Type: Primary Bus: USB
BD Address: XXXXXXXXXXXX ACL MTU: 1021:8 SCO MTU: 64:1
UP RUNNING PSCAN ISCAN
#
# (more stuff)
HCI Version: 2.0 # <---- the supported version of bluetooth
hci1: Type: Primary Bus: USB
BD Address: XXXXXXXXXXXX ACL MTU: 1021:8 SCO MTU: 64:1
UP RUNNING PSCAN ISCAN
#
# (more stuff)
HCI Version: 4.0 # <---- the supported version of bluetooth
As you will see, you have two adapters, one using Bluetooth 2.0 and one using 4.0 LE or up. We need to disable the older one.
Disabling the specific adapter
After a lot of googling, here is what finally worked for me (credits):
- Create a file in
/etc/init.d/disable_builtin_bluetooth
sudo vim /etc/init.d/disable_builtin_bluetooth
- Paste this
1 2 3
#!/bin/bash echo "Disabling hci0 bluetooth adapter" /usr/sbin/hciconfig hci0 down &
- Give it execution permissions
1
sudo chmod +x /etc/init.d/disable_builtin_bluetooth
- Run update-rc.d to wire all the symlinks needed for boot
1
update-rc.d disable_builtin_bluetooth start 26 2 3 4 5 .
- Reboot
- Run
1
hciconfig -a
You should see only one adapter now, with Bluetooth version 4.0:
1
2
3
4
5
6
7
8
hciconfig -a
hci0: Type: Primary Bus: USB # <-- It will now be hci0
BD Address: XXXXXXXXXXXX ACL MTU: 1021:8 SCO MTU: 64:1
UP RUNNING PSCAN ISCAN
#
# (more stuff)
HCI Version: 4.0 # <---- the supported version of bluetooth
Why is this important to me?
I had to get it running on my ancient but much loved Lenovo T420. Check out the specs of this Frankenstein of a laptop that I built over the years with some fancy goodies.