Bluetooth mouse disconnects on idle

I am running 18.04 updated. One of the post 20.04 updates broke the bluetooth mouse. It works fine after a reboot. Once the system goes idle (the slideshow screensaver runs) the mouse is disconnected. The applet shows the mouse to be still connected and working normally, but it does not work.

(Linux has now become what the old Windows used to be. Something or other is always breaking. The process of continuous updating invents new annoyances. Not all the time, but quite regularly. Samba works well, so i use it as a file server.)

Hi @Isaiah_Sellassie,

Probably your NetworkManager is setting the wifi device to sleep - power save, and the Bluetooth device is embedded inside your wifi card.
You can try to disable Radio power save editing this file :

/etc/NetworkManager/conf.d/default-wifi-powersave-on.conf

[connection]
wifi.powersave = 2

As described here the wifi.powersave can take 4 values :

From the source code: wifi.powersave can have the following value:

NM_SETTING_WIRELESS_POWERSAVE_DEFAULT (0): use the default value
NM_SETTING_WIRELESS_POWERSAVE_IGNORE (1): don't touch existing setting
NM_SETTING_WIRELESS_POWERSAVE_DISABLE (2): disable powersave
NM_SETTING_WIRELESS_POWERSAVE_ENABLE (3): enable powersave

Please try it out. Good luck :slight_smile:

Thank you for the reply! The wi-fi is not running. The system is connected by ethernet cable. The system also does not go to sleep. It runs the slideshow screensaver indefinitely. Do you still think it is power saver settings in play?

Yes, i think it will be that. Give it a try :slight_smile:

I had the same problem with my Bluetooth headphones. Without signal, Bluetooth switched off after a few minutes and could not be switched on again.
After I set wifi.powersave = 2 in the "default-wifi-powersave-on.conf", the headphone stays permanently connected.
Thanks for the clue!

1 Like

The setting was 3, I changed it to 2. The system has been rebooted. The problem is still there.

Let's try to fight with that :slight_smile: !

Can you please run this command to list all connected bt devices :

hcitool con

next wait idle and run it again, and post results here :slight_smile:
Also, you can check your system logs and post some logs of the moment when your PC get idle.

sudo dmesg

Thanks for the reply.

The first command returns the following, before and after idle.

ACL F0:65:DD:A7:C5:31 handle 256 state 9 lm MASTER AUTH ENCRYPT

The second command returns the following, repeated many times.

[33326.429385] Bluetooth: hci0: killing stalled connection f0:65:dd:a7:c5:31
[33451.422658] Bluetooth: hci0: link tx timeout

This will be the cause. There is a bug opened for that here since 2015. The bug looks present for Hardware ARM Linux - Kernel Version 4.4.x. What kind of hardware do you use, what kernel is running ?

You can workaround it reloading the bt module like suggested here, but i think you will have to do it each time after idle, that is painful.

Maybe upgrading the kernel will help :slight_smile:

It is a ThinkPad with Intel Core i7 4th gen. The kernel is whatever is the latest update pushed out for 18.04. I can get the version number for you if you remind me what the command is.

That worked, but it needs to be done sudo, which is not explicit in the linked solution. I don't mind the workaround if it is once per session. You were right, the procedure has to be repeated each time after resuming from idle.

Hi :slight_smile:

Try to upgrade your kernel to something new :slight_smile:

You can do it with Mainline, to install it :

sudo add-apt-repository ppa:cappelikan/ppa
sudo apt update
sudo apt install mainline 

You will probably need to disable secure boot in your BIOS (as the kernel signature will be different) to boot.

Once installed, open it from menu and install a other kernel :

One done reboot and try it out ! :slight_smile:

My side, upgrading kernel have all the time solved all my issues I got with hardware.

Keep us updated :slight_smile:

Look at "powertop" (command line)

Thanks again for the reply. The system performs a couple of important duties for me, one of them being the nightly cloud backup. I use the desktop very lightly, so I can live with the old USB mouse I have plugged in. Somehow "try it out" does not inspire confidence.

In general, I do not wish to expend time and energy managing the computers. I want the computers to work for me. I don't want to work for them. Linux desktop does not work for me, and it never will. The file system is tough, and the server features work well, so that's what I have it doing.

Thanks again, I appreciate the help very much!

I have no clue what that means, but thanks for trying to help.

My bluetooth keyboard would not reliably connect to Ubuntu Mate at all. Often it refused to connect at all. So I switched to Ubuntu, where it would always connect, but sometimes loses the connection.
The day when my main PC ceases to use Windows will have to wait until Linux is reliable.

It is never going to happen. I have used various Linux desktops for 20+ years now. It is much improved compared to the early days, but still feels like betaware. Here is a quick example: when I switch to the main dark theme supplied by default with the distro, it does not apply uniformly across all apps. Toolbars and menus do not get themed reliably, hence I am often squinting to see text. Over twenty years Linux has not yet figured out how to do themes so that all apps get themed properly.

For a lightweight internet user it can get the job done. There are some apps that run very well on it. Without a profit motive there is never going to be a coordinated focus on the user experience. The patchwork quilt nature of the project means something or other is always breaking. I'm running Win 7 on my two desktop systems----hardly perfect, but it works for me.

Noting is perfect, use what works for you. I think you will find most people that are here are here because of the problems they had with MS Windows. I know I am. Great to have choice.
Good luck.