Deterministic bluetooth disconnects after login and bluetooth restart

Bug #1904265 reported by g
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
linux (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

Hello everyone,

a few months ago I upgraded from 18.04 to 20.04 and since then, I'm into some bluetooth connection issues. I'm a KDE user currently using Ubuntu 5.4.0-53.59-generic 5.4.65, still the reported issue also appears with plain ubuntu 20.04, even a clean live USB version of ubuntu 20.04 reproduces it such that it is independent of any KDE library. I've noticed the following bug already a few months ago, still I would like to wait and see if it might be resolved with a new kernel update or something else. Since it still persists, I now would like to report it to the devs. I found no similar reported bug but if it already has been reported, I'd like to excuse for reporting a duplicate.

So, I'm using a Logitech bluetooth LE mouse and with ubuntu 18.04 (actually on any distro based on 18.04 that I tested), everything works fine and without any problems. Still with 20.04, I'm into the following bug that I would like to report. After starting ubuntu, the bluetooth connection to the mouse works (i.e. pointer is moving) and after about 30-40 seconds it stops moving and freezes for about 10-15 seconds and thereafter works again and stays working. The same issue can be reproduced by executing (for instance on a live ubuntu)

    sudo /etc/init.d/bluetooth restart

which stops the bluetooth connection for a few seconds (as expected), immediately it works again but after additional 30-40 seconds, the connection breaks for another 10-15 seconds and thereafter works flawlessly.

I checked all configuration files from the /etc/bluetooth/ directory, everything is the same between 18.04 and 20.04 and even modifying the parameters does not change anything at all. As a conclusion of my testing I strongly guess it has either anything to do with a different kernel version or a with a changed bluetooth library between 18.04 and 20.04.

So in summary:
Expected behavior: Bluetooth connection shortly breaks after 'sudo /etc/init.d/bluetooth restart' and does not break again after 30-40 seconds (as it is the case with ubuntu 18.04)
Actual behavior: Bluetooth connection breaks again after reestablishing the connection

I'm hoping that this issue can easily be fixed and please let me know if you need any further information :-)

Revision history for this message
Ubuntu Kernel Bot (ubuntu-kernel-bot) wrote : Missing required logs.

This bug is missing log files that will aid in diagnosing the problem. While running an Ubuntu kernel (not a mainline or third-party kernel) please enter the following command in a terminal window:

apport-collect 1904265

and then change the status of the bug to 'Confirmed'.

If, due to the nature of the issue you have encountered, you are unable to run this command, please add a comment stating that fact and change the bug status to 'Confirmed'.

This change has been made by an automated script, maintained by the Ubuntu Kernel Team.

Changed in linux (Ubuntu):
status: New → Incomplete
tags: added: disco
Revision history for this message
g (gibtnix) wrote : AlsaInfo.txt

apport information

tags: added: apport-collected focal
description: updated
Revision history for this message
g (gibtnix) wrote : CRDA.txt

apport information

Revision history for this message
g (gibtnix) wrote : CurrentDmesg.txt

apport information

Revision history for this message
g (gibtnix) wrote : IwConfig.txt

apport information

Revision history for this message
g (gibtnix) wrote : Lspci.txt

apport information

Revision history for this message
g (gibtnix) wrote : Lspci-vt.txt

apport information

Revision history for this message
g (gibtnix) wrote : Lsusb.txt

apport information

Revision history for this message
g (gibtnix) wrote : Lsusb-t.txt

apport information

Revision history for this message
g (gibtnix) wrote : Lsusb-v.txt

apport information

Revision history for this message
g (gibtnix) wrote : ProcCpuinfo.txt

apport information

Revision history for this message
g (gibtnix) wrote : ProcCpuinfoMinimal.txt

apport information

Revision history for this message
g (gibtnix) wrote : ProcInterrupts.txt

apport information

Revision history for this message
g (gibtnix) wrote : ProcModules.txt

apport information

Revision history for this message
g (gibtnix) wrote : PulseList.txt

apport information

Revision history for this message
g (gibtnix) wrote : RfKill.txt

apport information

Revision history for this message
g (gibtnix) wrote : UdevDb.txt

apport information

Revision history for this message
g (gibtnix) wrote : WifiSyslog.txt

apport information

Changed in linux (Ubuntu):
status: Incomplete → Confirmed
Revision history for this message
Kai-Heng Feng (kaihengfeng) wrote :

Possible dupe of LP: #1904069.

Revision history for this message
g (gibtnix) wrote :

Thanks for pointing to the possible duplicate. These two bugs might be related, still I think there are different. The one I've reported here appears always after restarting the system or restarting the bluetooth controller. However, the other requires a suspend/resume to get the bluetooth connection back working. Thus I think they are not the same.

description: updated
Revision history for this message
Kai-Heng Feng (kaihengfeng) wrote :

Let's start from test latest mainline kernel:
https://kernel.ubuntu.com/~kernel-ppa/mainline/v5.10-rc4/amd64/

However, we quite likely needs the following patch series, which isn't in mainline yet:
https://<email address hidden>/

Revision history for this message
g (gibtnix) wrote :

Even though I reported this issue already a few years ago, unluckily it is still present. I ignored it in the meanwhile, however I started to locate the problem's cause again. My mouse is a multi-device, so I paired it again using a live Linux (to avoid any inference with the existing paring) but as a separate device. Surprisingly, the issue is not present then. Calling

sudo /etc/init.d/bluetooth restart

shortly disconnects the mouse (as expected) but thereafter it's working without any freezes. I tried to find out what's different, and comparing the configuration files inside

/var/lib/bluetooth/<Mac>/<device>

I noticed that the respective 'info' files are not the same. Of course, the keys are different, but besides the, the non-working connection contains the following two sections:

[ConnectionParameters]
MinInterval=6
MaxInterval=9
Latency=44
Timeout=216

[ServiceChanged]
CCC_LE=2

I tried to manually delete these sections, but calling

sudo /etc/init.d/bluetooth restart

recreates the file including both sections. I suspect that these values were negotiated using the initial pairing under Windows and saved on the mouse itself, therefore Linux uses them, too, were they cause the reconnection issues. Can this information be used to fixed this issue? Can I overwrite this configuration somehow?

Revision history for this message
g (gibtnix) wrote :

It seems as I found a permanent fix. In case anyone having the same issue, this approach fixed it for me:

1. Unpair the mouse in Windows, i.e. delete it inside the Bluetooth settings. This will delete the respective keys in the Windows registry, too.
2. Unpair the mouse in Ubuntu, i.e. revoke the connection inside the settings menu. Thereafter, check whether the respective directory inside /var/lib/bluetooth/<XX:XX:XX:XX:XX:XX>/<Device> still exists and if so, delete it (requires root privileges).
3. Reboot Ubuntu.
4. Repair the mouse in Ubuntu, this will create a new directory inside /var/lib/bluetooth/<XX:XX:XX:XX:XX:XX>/.
5. Verify that the connection works after rebooting / restarting the Bluetooth service without any freezes.
6. Thereafter, start Windows and repair the mouse there, too. This of course will overwrite Ubuntu's setting, but the directory and the configuration files exists, only the keys will become invalid by the Windows pairing.
7. Verify that the mouse works fine in Windows, too, in particular after rebooting etc.
8. Restart Ubuntu and adjust the configuration files accordingly, i.e. transfer the keys and maybe rename the directory inside /var/lib/bluetooth/<XX:XX:XX:XX:XX:XX>/ accordingly to match the Windows configuration (as described in various tutorials).
9. Thereafter, my mouse worked fine with both, Windows and Ubuntu.

description: updated
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.