31

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.

  • 1
    I am facing the same problem on pop-os 20.04, I have tried 20.10 and 21.04, but the problem persists. It started about a month ago.

    May 11 17:02:44 pop-os bluetoothd[22654]: bt_uhid_send: Invalid argument (22)

    – czr May 11 '21 at 20:17

9 Answers9

25

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
  • 543
  • 1
    Worked for me - I uncommented the line and rebooted. What it did was allow a confirmation prompt to appear on the desktop. – jws Jun 10 '22 at 14:27
  • 2
    Seems to be working for me too (Linux Mint 20.3). Until a couple of days ago, 9 times out of 10 my Bose Soundlink II disconnected within 5 seconds of auto-connecting on power-up, and I had to use the Bluetooth utility to reconnect manually. I haven't seen any "confirmation prompts", but the system has been booted up at least 4 times since applying this fix, and the problem hasn't resurfaced. Many thanks! – FumbleFingers Jun 18 '22 at 19:22
  • 1
    I had 3 Kubuntu 23.10 PCs with that issue and you fixed it after I spent 2 hours on it. Thanks. The strange thing is that the connection says "Other device" instead of "Audio device" – dargaud Feb 08 '24 at 17:35
16

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
  • 70,465
3

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
  • 17,888
  • Welcome to Ask Ubuntu! Please see the edits that I made to your answer to make it more readable, and see how formatting guide about how to add line-breaks correctly. Thanks! – NotTheDr01ds Dec 26 '22 at 12:22
  • In the default.pa file there is a section ### Automatically load driver modules for Bluetooth hardware and you should put the load-module there surrounded by .ifexists and .endif to prevent errors if the module is missing. – LostKatana Mar 13 '24 at 07:18
3

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
  • 114,770
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,141
0

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
  • 231
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