Score:0

Linux freezes when connecting any bluetooth device

cn flag

I'm using Ubuntu 20.04 with kernel 5.15.0-58. If I connect a Bluetooth device (e.g. my keyboard after going to sleep or a new USB device, but not SD cards) the system will freeze for around 5 seconds. Audio will keep playing, but the displays are frozen completely and things like recording with OBS will freeze for the same amount of time.

Unfortunately I cannot show any code or ideas.

How can I solve this problem?

A list of devices currently connected to my machine via BT:

  • Audiolab Amp
  • Microsoft Ergonomic Keyboard (will timeout every 5mins of no use)
hutber@hutber:~$ hciconfig -a
hci0:   Type: Primary  Bus: USB
    BD Address: 5C:F3:70:A7:97:F3  ACL MTU: 1021:8  SCO MTU: 64:1
    UP RUNNING 
    RX bytes:1772646 acl:6128 sco:0 events:225073 errors:0
    TX bytes:378842911 acl:443999 sco:0 commands:892 errors:0
    Features: 0xbf 0xfe 0xcf 0xfe 0xdb 0xff 0x7b 0x87
    Packet type: DM1 DM3 DM5 DH1 DH3 DH5 HV1 HV2 HV3 
    Link policy: RSWITCH SNIFF 
    Link mode: SLAVE ACCEPT 
    Name: 'hutber'
    Class: 0x1c0104
    Service Classes: Rendering, Capturing, Object Transfer
    Device Class: Computer, Desktop workstation
    HCI Version: 4.0 (0x6)  Revision: 0x1000
    LMP Version: 4.0 (0x6)  Subversion: 0x220e
    Manufacturer: Broadcom Corporation (15)

hutber@hutber:~$ dmesg | grep -I bluetooth
[   82.887791] input: Audiolab Omnia BT as /devices/pci0000:00/0000:00:14.0/usb1/1-11/1-11.2/1-11.2:1.0/bluetooth/hci0/hci0:68/0005:000A:FFFF.000B/input/input25
[30789.688109] input: Audiolab Omnia BT as /devices/pci0000:00/0000:00:14.0/usb1/1-11/1-11.2/1-11.2:1.0/bluetooth/hci0/hci0:65/0005:000A:FFFF.0012/input/input46
[132984.840315] input: Audiolab Omnia BT as /devices/pci0000:00/0000:00:14.0/usb1/1-11/1-11.2/1-11.2:1.0/bluetooth/hci0/hci0:65/0005:000A:FFFF.0017/input/input65
[133224.134540] input: Audiolab Omnia BT as /devices/pci0000:00/0000:00:14.0/usb1/1-11/1-11.2/1-11.2:1.0/bluetooth/hci0/hci0:65/0005:000A:FFFF.0018/input/input67
[168916.269875] input: Audiolab Omnia BT as /devices/pci0000:00/0000:00:14.0/usb1/1-11/1-11.2/1-11.2:1.0/bluetooth/hci0/hci0:71/0005:000A:FFFF.0019/input/input69
[169359.710382] input: Audiolab Omnia BT as /devices/pci0000:00/0000:00:14.0/usb1/1-11/1-11.2/1-11.2:1.0/bluetooth/hci0/hci0:65/0005:000A:FFFF.001B/input/input75
[205453.272541] input: Audiolab Omnia BT as /devices/pci0000:00/0000:00:14.0/usb1/1-11/1-11.2/1-11.2:1.0/bluetooth/hci0/hci0:71/0005:000A:FFFF.001C/input/input77
[205470.351280] input: Audiolab Omnia BT as /devices/pci0000:00/0000:00:14.0/usb1/1-11/1-11.2/1-11.2:1.0/bluetooth/hci0/hci0:68/0005:000A:FFFF.001E/input/input83
[250641.646597] input: Audiolab Omnia BT as /devices/pci0000:00/0000:00:14.0/usb1/1-11/1-11.2/1-11.2:1.0/bluetooth/hci0/hci0:71/0005:000A:FFFF.0021/input/input93
[250660.044110] input: Audiolab Omnia BT as /devices/pci0000:00/0000:00:14.0/usb1/1-11/1-11.2/1-11.2:1.0/bluetooth/hci0/hci0:68/0005:000A:FFFF.0023/input/input99
[263990.825430] input: Audiolab Omnia BT as /devices/pci0000:00/0000:00:14.0/usb1/1-11/1-11.2/1-11.2:1.0/bluetooth/hci0/hci0:12/0005:000A:FFFF.0029/input/input121
hutber@hutber:~$ sudo lsusb
[sudo] password for hutber:  
Bus 002 Device 002: ID 05e3:0732 Genesys Logic, Inc. All-in-One Cardreader
Bus 002 Device 011: ID 058f:8468 Alcor Micro Corp. 
Bus 002 Device 010: ID 2109:0813 VIA Labs, Inc. 
Bus 002 Device 004: ID 05e3:0620 Genesys Logic, Inc. 
Bus 002 Device 005: ID 17e9:6006 DisplayLink 
Bus 002 Device 003: ID 05e3:0620 Genesys Logic, Inc. USB3.1 Hub
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 006: ID 0b05:18a3 ASUSTek Computer, Inc. USB2.1 Hub
Bus 001 Device 004: ID 1b1c:0c04 Corsair Link Cooling Node
Bus 001 Device 002: ID 05e3:0610 Genesys Logic, Inc. 4-port hub
Bus 001 Device 018: ID 06c4:c411 Bizlink International Corp. 
Bus 001 Device 016: ID 05e3:0608 Genesys Logic, Inc. Hub
Bus 001 Device 017: ID 046d:0892 Logitech, Inc. OrbiCam
Bus 001 Device 030: ID 2109:0101 VIA Labs, Inc. 
Bus 001 Device 029: ID 1a40:0101 Terminus Technology Inc. Hub
Bus 001 Device 028: ID 2109:2813 VIA Labs, Inc. 
Bus 001 Device 015: ID 05e3:0610 Genesys Logic, Inc. 4-port hub
Bus 001 Device 014: ID 05e3:0610 Genesys Logic, Inc. 4-port hub
Bus 001 Device 012: ID 1532:007e Razer USA, Ltd 
Bus 001 Device 011: ID 1532:0088 Razer USA, Ltd 
Bus 001 Device 010: ID 05e3:0610 Genesys Logic, Inc. 4-port hub
Bus 001 Device 019: ID 046d:0ab7 Logitech, Inc. Blue Microphones
Bus 001 Device 007: ID 05e3:0608 Genesys Logic, Inc. Hub
Bus 001 Device 027: ID 0b05:17cb ASUSTek Computer, Inc. Broadcom BCM20702A0 Bluetooth
Bus 001 Device 005: ID 05e3:0608 Genesys Logic, Inc. Hub
Bus 001 Device 003: ID 0922:001f Dymo-CoStar Corp. DYMO LabelWriter 4XL
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

(base) hutber@hutber:~$ sudo dmesg | egrep -i 'blue|firm'
[sudo] password for hutber:  
[1073034.408000] hid-generic 0005:045E:0817.0060: input,hidraw14: BLUETOOTH HID v1.42 Keyboard [Ergonomic Keyboard] on 8c:1d:96:d9:9c:1f
[1073347.737066] input: Audiolab Omnia BT as /devices/pci0000:00/0000:00:14.0/usb1/1-14/1-14:1.0/bluetooth/hci0/hci0:256/0005:000A:FFFF.0061/input/input192
[1073347.737372] hid-generic 0005:000A:FFFF.0061: input,hidraw15: BLUETOOTH HID vff.ff Device [Audiolab Omnia BT] on 8c:1d:96:d9:9c:1f
[1076534.326307] hid-generic 0005:045E:0817.0062: input,hidraw14: BLUETOOTH HID v1.42 Keyboard [Ergonomic Keyboard] on 8c:1d:96:d9:9c:1f

```

[Edit]
I replaced my entire machine, motherboard/ram/gpu/cpu/fan etc and the issue is still occuring.
guiverc avatar
cn flag
You mention linux freezing (*thus it's playing the same frequency/note thru the audio*) as the [linux] kernel freeze is a very different detail to just the GUI itself freezing (the GUI is a user level program, where as if the kernel itself freezes; everything will stop & it won't usually recover).
cn flag
I thought it would be relevant but I was not sure to what extent! Thank you
guiverc avatar
cn flag
You need to be clear; to me if the keyboard is *frozen*, that will mean you cannot give commands to the actual kernel directly. A stuck GUI (ie. screen freezing, even keyboard commands directed at the GUI or graphical user interface) does not mean a frozen system, just a stuck GUI (graphical user interface) meaning keyboard commands direct to the kernel will still work (eg. SysRq commands that can bypass any stuck GUI/UI). A system freeze, and GUI (graphical user interface) freeze are very different, and to understand you should be clear with the issue.
guiverc avatar
cn flag
Have you explored your system from a terminal? eg. if I have an occasional GUI freeze, I usually login to a text terminal, and thus if the GUI freezes, I attempt to switch to terminal & look for clues using `top` type of tools (I don't mean `top` specifically, but tools like it). I may also `ssh` into the box from another nearby box, and have those tools running in case during the ~5 seconds you mention when it maybe *thrashing* (ie. out of RAM & thus swapping memory in/off disk) response will be lousy on UIs, but will be responsive to terminals/processes already running and in RAM
cn flag
RIght, confirmed it. It is just the GUI that freezes, the experiment was pretty basic. Hitting the windows key once while the system is "frozen" and then, once we came out of the freeze the menu is showing.
cn flag
However as for memory etc, for system specs it seems very unlikely. I've 64gb of DDR and my CPUs (24 of them) are about 5% idealling :)
Jeremy31 avatar
ke flag
Edit the question to include results from terminal for `sudo dmesg | egrep -i 'blue|firm'`
cn flag
@Jeremy31 updated an0d thank you for looking!
Jeremy31 avatar
ke flag
Did you ever download the firmware for the bluetooth?
cn flag
The devices themselves? Or something on the OS? As it happens with every device unfortunately.
cn flag
Interestingly I realised that my mouse's cursor still moves too, but it cannot interact with anything whilst its in the "freeze"
webknjaz avatar
in flag
FWIW, I'm having the same with the UI freezing (except for the mouse cursor). It's not under Ubuntu, but Gentoo Linux (which shouldn't be important). I think it doesn't happen with `bluetoothctl` but happens with a GTK frontend (`blueman-manager`). So I though maybe it was related to the GUI app for bluetooth but not bluetooth itself.
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.