21

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.

Leonardo Ferreira
  • 311
  • 1
  • 2
  • 8
  • 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

8 Answers8

15

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

UserspaceHID=true

tedi
  • 423
  • 5
  • 10
  • 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
  • 1
    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
13

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
  • 69,223
  • 56
  • 216
  • 327
  • Thank you for your answer but I did all you did mention but it stills disconnecting; I have tested a lot of solutions but I really don't know more what to do – Leonardo Ferreira May 10 '21 at 01:47
  • 3
    I get the following: `Failed to connect: org.bluez.Error.Failed` :( – tedi Jan 09 '22 at 08:11
  • If I restart my bluetooth device then it connects with no problems. Device: JBL PartyBox 200. It's just annoying restarting it because I have to press the shutdown button then wait a couple of second because of the shutdown animation and then press the turn on button. – tedi Jan 09 '22 at 08:19
  • thanks. for me i need turn on the bluetooth first and this will work. – tenshi Sep 30 '22 at 08:50
  • > `Invalid command in menu main: default` – Slava Fomin II Jul 27 '23 at 16:15
2

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
  • 15,380
  • 6
  • 51
  • 79
  • Welcome to Ask Ubuntu! Please see the edits that I made to your answer to make it more readable, and see how [formatting guide](https://askubuntu.com/help/formatting) about how to add line-breaks correctly. Thanks! – NotTheDr01ds Dec 26 '22 at 12:22
2

I have tried this on Ubuntu 22.04.2 LTS I have switched from PulseAudio to PipeWire and I have used the instructions mentioned here: https://linuxconfig.org/how-to-install-pipewire-on-ubuntu-linux

this solved showing my Bluetooth headphone to appear in the sound output devices. and also solves the continuous disconnecting issue.

hope this works for you

1

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,083
  • 2
  • 29
  • 54
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
  • 1
  • 3
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
  • 3
  • 2
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