40

I have installed Ubuntu 20.04 on my laptop and seems like the bluetooth isn't working as expected.

It's connecting to my Logi MX ERGO device and also connecting to my TWS headphone, but after a while running (apparently it's a random time) it stops working, so I need to use the touchpad to switch the bluetooth-manager or bluesman to OFF and ON again, so it will automatically connect to my devices... But after some more time it will disconnect again;

It's the output of grep blue /var/log/syslog

Apr 12 18:06:34 leonardo-G3-3579 bluetoothd[834]: /org/bluez/hci0/dev_60_F4_3A_3A_91_F2/sep2/fd0: fd(53) ready
Apr 12 18:06:46 leonardo-G3-3579 systemd[1]: blueman-mechanism.service: Succeeded.
Apr 12 18:06:49 leonardo-G3-3579 bluetoothd[834]: bt_uhid_send: Invalid argument (22)
Apr 12 18:06:49 leonardo-G3-3579 bluetoothd[834]: message repeated 10 times: [ bt_uhid_send: Invalid argument (22)]
Apr 12 18:08:49 leonardo-G3-3579 bluetoothd[834]: No reply to Suspend request
Apr 12 18:08:53 leonardo-G3-3579 dbus-daemon[838]: [system] Activating via systemd: service name='org.blueman.Mechanism' unit='blueman-mechanism.service' requested by ':1.100' (uid=1000 pid=2163 comm="/usr/bin/python3 /usr/bin/blueman-applet " label="unconfined")
Apr 12 18:08:53 leonardo-G3-3579 blueman-mechanism[4127]: Unable to init server: Could not connect: Connection refused
Apr 12 18:08:53 leonardo-G3-3579 blueman-mechanism[4127]: Unable to init server: Não foi possível conectar: Connection refused
Apr 12 18:08:53 leonardo-G3-3579 blueman-mechani[4127]: gtk_icon_theme_get_for_screen: assertion 'GDK_IS_SCREEN (screen)' failed
Apr 12 18:08:53 leonardo-G3-3579 dbus-daemon[838]: [system] Successfully activated service 'org.blueman.Mechanism'
Apr 12 18:08:59 leonardo-G3-3579 bluetoothd[834]: /org/bluez/hci0/dev_60_F4_3A_3A_91_F2/sep2/fd1: fd(39) ready
Apr 12 18:09:23 leonardo-G3-3579 systemd[1]: blueman-mechanism.service: Succeeded.
Apr 12 18:11:47 leonardo-G3-3579 bluetoothd[834]: bt_uhid_send: Invalid argument (22)
Apr 12 18:11:47 leonardo-G3-3579 bluetoothd[834]: message repeated 10 times: [ bt_uhid_send: Invalid argument (22)]
Apr 12 18:11:52 leonardo-G3-3579 dbus-daemon[838]: [system] Activating via systemd: service name='org.blueman.Mechanism' unit='blueman-mechanism.service' requested by ':1.100' (uid=1000 pid=2163 comm="/usr/bin/python3 /usr/bin/blueman-applet " label="unconfined")
Apr 12 18:11:52 leonardo-G3-3579 blueman-mechanism[4425]: Unable to init server: Could not connect: Connection refused
Apr 12 18:11:52 leonardo-G3-3579 blueman-mechanism[4425]: Unable to init server: Não foi possível conectar: Connection refused
Apr 12 18:11:52 leonardo-G3-3579 blueman-mechani[4425]: gtk_icon_theme_get_for_screen: assertion 'GDK_IS_SCREEN (screen)' failed
Apr 12 18:11:52 leonardo-G3-3579 dbus-daemon[838]: [system] Successfully activated service 'org.blueman.Mechanism'
Apr 12 18:12:00 leonardo-G3-3579 bluetoothd[834]: bt_uhid_send: Invalid argument (22)
Apr 12 18:12:00 leonardo-G3-3579 bluetoothd[834]: message repeated 9 times: [ bt_uhid_send: Invalid argument (22)]
Apr 12 18:12:10 leonardo-G3-3579 bluetoothd[834]: /org/bluez/hci0/dev_60_F4_3A_3A_91_F2/sep2/fd2: fd(55) ready
Apr 12 18:12:24 leonardo-G3-3579 systemd[1]: blueman-mechanism.service: Succeeded.
Apr 12 18:35:58 leonardo-G3-3579 blueman.desktop[2309]: Traceback (most recent call last):
Apr 12 18:35:58 leonardo-G3-3579 blueman.desktop[2309]:   File "/usr/lib/python3/dist-packages/blueman/main/indicators/GtkStatusIcon.py", line 19, in <lambda>
Apr 12 18:35:58 leonardo-G3-3579 blueman.desktop[2309]:     gtk_item.connect('activate', lambda _, idx=index: activate(idx))
Apr 12 18:35:58 leonardo-G3-3579 blueman.desktop[2309]:   File "/usr/lib/python3/dist-packages/blueman/main/Tray.py", line 37, in _activate_menu_item
Apr 12 18:35:58 leonardo-G3-3579 blueman.desktop[2309]:     return AppletService().ActivateMenuItem('(ai)', indexes)
Apr 12 18:35:58 leonardo-G3-3579 blueman.desktop[2309]:   File "/usr/lib/python3/dist-packages/gi/overrides/Gio.py", line 351, in __call__
Apr 12 18:35:58 leonardo-G3-3579 blueman.desktop[2309]:     result = self.dbus_proxy.call_sync(self.method_name, arg_variant,
Apr 12 18:35:58 leonardo-G3-3579 blueman.desktop[2309]: gi.repository.GLib.Error: g-io-error-quark: Timeout was reached (24)
Apr 12 18:35:58 leonardo-G3-3579 whoopsie-upload-all[6745]: /var/crash/_usr_bin_blueman-tray.1000.crash already marked for upload, skipping
Apr 12 18:35:58 leonardo-G3-3579 whoopsie-upload-all[6745]: /var/crash/_usr_bin_blueman-assistant.1000.crash already marked for upload, skipping
Apr 12 18:53:15 leonardo-G3-3579 dbus-daemon[838]: [system] Activating via systemd: service name='org.blueman.Mechanism' unit='blueman-mechanism.service' requested by ':1.100' (uid=1000 pid=2163 comm="/usr/bin/python3 /usr/bin/blueman-applet " label="unconfined")
Apr 12 18:53:15 leonardo-G3-3579 blueman-mechanism[9135]: Unable to init server: Could not connect: Connection refused
Apr 12 18:53:15 leonardo-G3-3579 blueman-mechanism[9135]: Unable to init server: Não foi possível conectar: Connection refused
Apr 12 18:53:15 leonardo-G3-3579 blueman-mechani[9135]: gtk_icon_theme_get_for_screen: assertion 'GDK_IS_SCREEN (screen)' failed
Apr 12 18:53:15 leonardo-G3-3579 dbus-daemon[838]: [system] Successfully activated service 'org.blueman.Mechanism'
Apr 12 18:53:25 leonardo-G3-3579 bluetoothd[834]: /org/bluez/hci0/dev_60_F4_3A_3A_91_F2/sep2/fd3: fd(62) ready
Apr 12 18:53:29 leonardo-G3-3579 bluetoothd[834]: bt_uhid_send: Invalid argument (22)
Apr 12 18:53:29 leonardo-G3-3579 bluetoothd[834]: message repeated 10 times: [ bt_uhid_send: Invalid argument (22)]
Apr 12 18:53:47 leonardo-G3-3579 systemd[1]: blueman-mechanism.service: Succeeded.

Someone have faced this problem? I read a lot of forum topics and tried some alternatives and no one has worked for me.

I would be very grateful for any help or reference about how can I fix this problem.

12 Answers12

44

Uncommenting the following line in /etc/bluetooth/input.conf fixed it for me:

UserspaceHID=true

Make sure to systemctl restart bluetooth to apply changes

ttt
  • 813
18

I had the same problem. Found the solution here on Reddit Disconnect your devices entirely first before trying these steps:

Run

bluetoothctl

You will get a new prompt, at which you should enter

agent on
default agent

And then, using the MAC address (a long string of colon-separated pairs of alphanumeric characters, something like 11:BB:3C:44:5E:FF:7G) of the device to connect to (you should be able to find it by typing devices at this prompt), run

trust <MAC>
pair <MAC>
connect <MAC>
Zanna
  • 72,312
5

I tried this on Ubuntu 22.04. I switched from PulseAudio to PipeWire, and I used the instructions mentioned here.

This solved showing my Bluetooth headphones in the sound output devices, and also solves the continuous disconnecting issue.

karel
  • 122,292
  • 133
  • 301
  • 332
4

I'm on Linux Mint. I tried many solutions, but the best one I found here.

What I did:

  • Edit:

    sudo -e /etc/pulse/default.pa
    
  • Added this line:

    load-module module-bluez5-discover
    
  • Saved and exited the file, then restarted the service with:

    sudo systemctl restart bluetooth
    
NotTheDr01ds
  • 22,082
3

I have issues with my bluetooth randomly becoming unreactive. This one brings the bluetooth back to life, albeit doesn't permanently solve the problem:

sudo modprobe -r btusb 
sudo modprobe -r btintel
sudo modprobe btusb
sudo modprobe btintel

Essentially it removes and then adds btusb and btintel from the Linux kernel. Hint, you can copy the aforementioned lines to gedit ~/restart_bluetooth.sh and run bash restart_bluetooth.sh whenever the problem occurs.

mjkvaak
  • 281
  • 3
  • 3
0

I occasionally get this issue. Though I don't know the root reason for it I normally reboot my laptop, select the drop down settings menu in the upper right hand side of the screen, which has always displayed bluetooth as on at the top, I click the menu to Turn it off:

Then go to the main setting menu to turn it back on. Usually last for a few days.

epsilonv
  • 11
  • 4
0

I've been wrestling with this problem for a month, and in a stroke of good luck I just discovered the solution: remove the headphone device and let it reinstall itself. There are many ways to do this; perhaps the easiest is to go into Bluetooth Manager, click on the headphones, and choose Remove. You can also do it with bluetoothctl from a shell prompt. This solution seems to even survive rebooting!!!

Paul A.
  • 2,241
0

I had a similar problem, tried out several solutions, none worked. Until I found out I could not search for a Bluetooth connection without a wifi connection. To remedy this I got this code from here and i ran

sudo tee /etc/modprobe.d/iwlwifi-opt.conf <<< 
"options iwlwifi bt_coex_active=N"

I have only one problem now, if I switch on my WiFi, my Bluetooth starts becoming shaky, so I've switched to LAN. The connection is now stable. My router is hard-coded so I can't change the WiFi frequency band from 2.4GHz to 5GHz. NB I tried to change it via the terminal, but the problem still persists

0

The Solution that works for me

First run this command

 `sudo install -m 700 -d /var/lib/bluetooth

then

sudo systemctl start bluetooth

and restart bluetooth services by

sudo systemctl restart bluetooth.service

and finaly enable bluetooth by

`sudo systemctl enable --now bluetooth`

Restart your machine and it will works

0

Someone suggested forgetting the device and reconnecting, i just added a

systemctl restart bluetooth

Before reconnecting (so: forget the device, pass a restart and reconnect) and then everything is working like before.

What bothers me is where did it come from? (to avoid it in the future)

0

What worked for me was stopping the bluetooth service, removing /var/lib/bluetooth and restarting the service again, i.e.:

sudo systemctl stop bluetooth
rm -rf /var/lib/bluetooth
sudo systemctl start bluetooth

Source: https://github.com/bluez/bluez/issues/157#issuecomment-1028728497

0

My earphones were constantly disconnecting after 1-4sec. I tried all of the above answers. None worked. I had issues with my Bose Bluetooth headphones on Ubuntu 24.04.1 LTS. The following answer on another post has worked so far: https://askubuntu.com/a/833323/2095924

To clarify: All the config files from trying the other answers are still edited on my machine, so that might contribute to the success. If the linked answer doesn't work alone try those additionally. ("UserspaceHID=true", "FastConnect=true",switch to PipeWire)