Realtek Bluetooth 5 Adapter not being recognized after each non-reboot unlock

Not sure if this problem is specific to me, but I am using a Realtek Bluetooth 5 Adapter on Zorin OS 16 Core Beta. Bluetooth works perfect after each reboot, but if the computer goes to sleep/close my laptop lid, and then I unlock it, the Bluetooth adapter is not recognized unless I reboot the computer. I am dual booting with Windows 10; I turned off fast boot and secure boot since I heard they can cause problems. Neither changed anything to my knowledge. I also had the same problem on Mint and Ubuntu's latest versions.
Any help for this would be appreciated.

After a little searching, it seems like a bug. The recommended way to resolve this is:

sudo rmmod btusb
sudo modprobe btusb

I found this at:

1 Like

Thought this fixed my problem, but the same problem is still here just now it does not happen if I unlock my laptop quickly(~10sec) after it suspends.

I tried almost everything in the thread you linked. Nothing fixed the issue. Also since I am dual booting I tried doing a full shutdown and a cold boot from Windows. That also did not work.
Honestly I'm thinking that this is actually a new issue now. Probably specific to my hardware.
I have had some driver issues with this Bluetooth adapter in the past with Windows, but reinstalling the driver fixed that. Going to try to manually reinstall the driver from Realtek and see if that fixes anything.

Edit Reinstalling the driver did not fix the problem

The way I understand it is that Ubuntu 18.04 (what Zorin 15.3 is based) has a buggy bluez. There is another repository and updated Bluez that you can try:

sudo add-apt-repository ppa:bluetooth/bluez
sudo apt install bluez

I found this here:
https://itectec.com/ubuntu/ubuntu-bluetooth-doesnt-work-after-resuming-from-sleep-ubuntu-18-04-lts/

I'm hoping this will help with the issue even being on zorin 16, (ubuntu 20.04)

Edit

Seems like this fix applies to both 18 and 20 versions of ubuntu.

There is a script to place in the

/lib/systemd/system-sleep/

folder, most call it bt (for bluetooth) that restarts either the service or the device depending on which works for an individual.

The scripts are as follows:

Restarts service:

#! /bin/sh

case $1 in post)
   modprobe -r btusb
   sleep 1
   service bluetooth restart
   sleep 1
   modprobe btusb
   ;;
esac

Restart Device:

#! /bin/sh

case $1 in post)
   btnum=`rfkill list|grep hci0| cut -f 1 -d ':'`
   sleep 5
   rfkill block $btnum
   sleep 1
   rfkill unblock $btnum
   ;;
esac

Adding either one, and making it executable:

sudo chmod +x /lib/systemd/system-sleep/bt

will restart the device or service automatically after sleep.

From:

Hope all this helps.

1 Like

One solution at least for me at bottom.

Tried the first fix and still seeing if it fixed the problem will update tomorrow if it did. Not sure if it is important, but during the download of the bluez repository after Hit:19 there was something that was not fetched, and it got a 404 error. Screenshot-from-2021-05-02-02-52-19 — ImgBB. The install appeared to work fine so not sure if this was important.

Also, the second fix at least for me, I had to create bt under /lib/systemd/system-sleep/ since it did not exist, I followed the directions from Laurent under the link you posted Bluetooth doesn't work after resuming from sleep, Ubuntu 18.04 LTS - Ask Ubuntu.

This script definitely seems like it should fix the issue I'll make an edit if it does/doesn't.

I did find a complete separate permanent solution to the problem. I plugged in an extra bluetooth USB adapter I had and the issue was gone. What I said above was tested without the extra adapter.

Thanks, for all the help again

Edit: Problem is still here after both solutions. I think I am going to just use the extra bluetooth adapter I have, it fixes the problem enough for me.

1 Like

Wow. The bluez focal repo is unsigned.
Apparently its current status is "proposed."

You might remove --purge bluez, then use this .deb package to install by saving the file, then navigating to it and double clicking it to use the installer or install from terminal with

sudo pkg -i *

http://archive.ubuntu.com/ubuntu/pool/main/b/bluez/bluez_5.53-0ubuntu3_amd64.deb