PixlOne / logiops

An unofficial userspace driver for HID++ Logitech devices
GNU General Public License v3.0
3.42k stars 271 forks source link

bluez-5.77 broke logiops #468

Open domryba opened 4 months ago

domryba commented 4 months ago

Hello, after update bluez to version 5.77 logiops works well, only after a fresh system boot. But when I, eg resume my machine from sleep, or simply reconnect my mouse, logiops stops working, and I got this:

[DEBUG] Failed to add device /dev/hidraw4 on try 1, backing off for 500ms
[DEBUG] Failed to add device /dev/hidraw4 on try 2, backing off for 1000ms
[DEBUG] Failed to add device /dev/hidraw4 on try 3, backing off for 2000ms
[DEBUG] Failed to add device /dev/hidraw4 on try 4, backing off for 4000ms
[DEBUG] Failed to add device /dev/hidraw4 on try 5, backing off for 8000ms
[WARN] Failed to add device /dev/hidraw4 after 5 tries. Treating as failure.

Everything works pretty good, when I downgrade bluez to 5.76.

EDIT: After woke up, when I restart bluetooth.service logiops works correctly.

c-kr commented 4 months ago

Can confirm. Same problem here with MX Master 3S on Arch with bluez 5.77. Downgrading to 5.76 resolved the issue.

im-calvin commented 4 months ago

+1 can confirm that downgrading to 5.76 resolved the issue. I'm on Arch so I followed these instructions: https://wiki.archlinux.org/title/Downgrading_packages

MrTomRod commented 4 months ago

On my system (Fedora 40, GNOME), logid has to be restarted whenever I log in. With bluez 5.77, the driver stops working if I lock my screen. Then, even restarting the service does not help:

$ journalctl -f -u logid.service
logid[19347]: [WARN] Failed to add device /dev/hidraw7 after 5 tries. Treating as failure.

Downgrading bluez-5.77-1.fc40 to bluez-5.73-3.fc40 helped, but I still have to restart the service after login.

Happy to help debugging the issue!

#Edit: Fedora only has logiops-0.3.3-4 in its repos. I compiled logiops from source (0.3.4, commit 237fa5f) and the problem persists. logid --verbose debug didn't show anything useful.

rogsme commented 4 months ago

I'm having this same issue, can confirm that sudo systemctl restart bluetooth.service makes logiops work again.

lazarosgogos commented 4 months ago

On my system (Fedora 40, GNOME), logid has to be restarted whenever I log in. With bluez 5.77, the driver stops working if I lock my screen. Then, even restarting the service does not help:

$ journalctl -f -u logid.service
logid[19347]: [WARN] Failed to add device /dev/hidraw7 after 5 tries. Treating as failure.

Downgrading bluez-5.77-1.fc40 to bluez-5.73-3.fc40 helped, but I still have to restart the service after login.

Happy to help debugging the issue!

Edit: Fedora only has logiops-0.3.3-4 in its repos. I compiled logiops from source (0.3.4, commit 237fa5f) and the problem persists. logid --verbose debug didn't show anything useful.

Having the exact same issue. Should anyone have any insights we can look into this together to find a solution :)

I believe it's a combination of the latest bluez updates (I had bluez-5.69 installed and logiops worked flawlessly) and something logiops does in a sequence that doesn't allow it to function properly.

Any ideas welcome. How could we tackle this?

spoutn1k commented 3 months ago

Have you tried #460 ? It fixed a bunch of people's issues, I'm running the patch and my setup is working as usual after the update to 5.77

c-kr commented 3 months ago

Thanks @spoutn1k for your suggestion but isnt this fix only for the bolt receiver and not for bluetooth connected devices?

MrTomRod commented 3 months ago

@spoutn1k It also fixes the issue for me! Thanks for the heads up!

spoutn1k commented 3 months ago

@c-kr: @lazarosgogos mentions it is something in a sequence that is fucky, and this patch changes a sequence of action. Just a shot in the dark !

c-kr commented 3 months ago

I tried the patch and it did not help. After the first disconnect/sleep logid is unable to reconnect

lazarosgogos commented 3 months ago

@spoutn1k Just like @c-kr , I tried the fix and it did not work either. After disconnecting the device and reconnecting it, a service restart must be issued for the driver to work properly. Thank you for the proposal, however.

I think the solution lies in looking carefully at what changed between bluez-5.69 and bluez-5.73 or -5.77 to try and figure out what messes with HID++ inputs.

c-kr commented 3 months ago

bluez 5.76 works fine. If someone has a lot of time one way would be to git-bisect all changes between both versions and find the problematic commit

dpecos commented 3 months ago

I can also confirm that downgrading to bluez 5.76 fixes the issue.

lazarosgogos commented 3 months ago

@dpecos @c-kr Really good to know. What distro are you using?

dpecos commented 3 months ago

arch, btw

:-D

dpecos commented 3 months ago

Small update on this issue: running last bluez version, and restarting the blueetooth service while having the mouse connected, makes logiops works every time.

My feeling is that the trick is to have the mouse to connect ASAP to the system.

rizaumami commented 2 months ago

Using Debian Sid and having the [WARN] Failed to add device /dev/hidraw3 after 5 tries. error after bluez updated to 5.77.

Restarting bluetooth service only make it works one time, after that it's back to [WARN] Failed to add device /dev/hidraw3 after 5 tries. error.

Downgrade bluez to previews Bluez (5.66-1) fix the problem.

Staindk commented 2 months ago

I have the same issue as others in this thread - my solution was to restart logid and bluetooth via a script that I pinned to my taskbar :shrug: (it mostly works fine)

#!/bin/bash

# for convenience create a .desktop file in usr/share/applications
# with this content:
#
# [Desktop Entry]
# Type=Application
# Name=Mouse Driver Restart
# Icon=/usr/share/icons/Adwaita/symbolic/devices/input-mouse-symbolic.svg
# Exec=gnome-terminal -- bash -c "~/MouseInit.sh"

echo "Restarting logid"
sudo systemctl restart logid

echo "Going to restart bluetooth in 5 sec, CTRL-C now if needed!"
sleep 5

echo "Restarting bluetooth"
sudo systemctl restart bluetooth

sleep 1
c-kr commented 2 months ago

Updating to bluez 5.78 solved the issue for me

lazarosgogos commented 2 months ago

Updating to bluez 5.78 solved the issue for me

Same here. Fedora 40 GNOME 46

domryba commented 2 months ago

Can confirm – bluez 5.78 works pretty well with logiops.

Andreag00 commented 3 weeks ago

I'm running Fedora 40 Silverblue with bluez 5.78:

andrea@thinkpad-ag:~$ cat /etc/fedora-release
Fedora release 40 (Forty)
andrea@thinkpad-ag:~$ bluetoothctl --version
bluetoothctl: 5.78 

But still get the error reported in the first post if I don't restart bluetoothctl:

ott 30 22:35:15 thinkpad-ag systemd[1]: Started logid.service - Logitech Configuration Daemon.
ott 30 22:35:39 thinkpad-ag logid[2084]: [WARN] Failed to add device /dev/hidraw7 after 5 tries. Treating as failure.
ott 30 22:35:39 thinkpad-ag logid[2084]: [WARN] Failed to add device /dev/hidraw7 after 5 tries. Treating as failure.
ott 30 22:38:45 thinkpad-ag logid[2084]: [INFO] Device found: MX Vertical Advanced Ergonomic Mouse on /dev/hidraw6:255

Does anyone have the same issue even with bluez 5.78?