Ubuntu 20.04 Bluetooth headphone problems

Published: δΊ” 23 十月 2020
By jlz

In Ubuntu.

From my experience, the wireless Bluetooth driver in Ubuntu is not written very well. I have met some severe problems with it.

For example, one time I noticed one very strange problem: youtube videos do not play in Chrome, but you can drag the progress bar to anywhere, the image shows correctly but it just does not play! My first thought was that maybe the codec is corrupted, so I updated Chrome, but the problem remained. Then I think maybe it's a bug of Chrome, so I tested MPV to play local videos, weird, same problem. I suspect that my system is corrupted but I don't want to reinstall or upgrade. After searching on the web and thinking about the problem, I finally found out that it is the headphone, or I should say, the Bluetooth driver in Linux. The gnome-settings says it is connected to my headphone, but the connection has already become stale, no data can be transferred to the headphone. So every time application tries to send data via Bluetooth, it does not respond.

I have met another even more severe problem. One time when I was writing my personal statement, the fan of the computer spins really fast, which is weird because I am just writing a document, the load on the CPU should be low. But when I opened htop, I saw all 8 cores of CPU is running at 100 percent, and the criminal is the "bluetoothd", which should be Bluetooth service. Before I figured out what was happening, the whole system stopped responding, I had to use the REISUB trick to reboot the system.

I am here to provide a simple solution for all these headaches, which I hope it would help someone who reads this.

1
2
3
4
5
6
7
8
#!/usr/bin/env bash

sudo rmmod btusb
sudo modprobe btusb

sudo rfkill unblock all
sudo systemctl restart bluetooth
sudo bluetoothctl power on

Anytime you met with Bluetooth problems, you can just "restart" the driver, which should fix the problem at your hands.

And I hope someday the driver will work perfectly and this trick would be useless.

links

social