-
-
Notifications
You must be signed in to change notification settings - Fork 293
Description
Environment
- Distro: CachyOS (Arch) x86_64
- Kernel: 6.17.1-2-cachyos
- Desktop: KDE Plasma 6.4.5 (Wayland), KWin
- Device: Logitech MX Master 3S (Bluetooth, UHID 0005:046D:B034)
- BlueZ: 5.84-1.1
- logiops/logid: 0.3.5-1
Summary
At boot, logid starts before the Bluetooth UHID/hidraw device is ready. It tries 5 times, gives up, and won’t re-scan that node. Later, when the hidraw is (re)added, logid only works after a restart.
Steps to Reproduce
-
Boot into Wayland session (KDE/Sway likely similar).
-
MX Master 3S is paired via Bluetooth (not using USB receiver).
-
journalctl -b -u logidshows:[WARN] Failed to add device /dev/hidraw14 after 5 tries. Treating as failure. -
Toggling the mouse off/on produces a new UHID path
.../uhid/0005:046D:B034.xxxx/.../hidraw14, butlogiddoes not apply settings until the service is restarted.
Expected
logid should pick up the mouse as soon as its hidraw appears and apply settings without manual restart.
Actual logs (examples)
Okt 17 20:12:36 logid[1019]: [WARN] Failed to add device /dev/hidraw14 after 5 tries. Treating as failure.
...
Okt 17 20:13:09 logid[1019]: [INFO] Device found: MX Master 3S on /dev/hidraw14:255
Workarounds that make it reliable
Either of the following fixes the timing/race:
A) Restart logid on every hidraw add/change (covers early-boot too)
/etc/udev/rules.d/90-logid-start-restart.rules
# Logitech via USB receiver
ACTION=="add|change", SUBSYSTEM=="hidraw", SUBSYSTEMS=="usb", ATTRS{idVendor}=="046d", \
RUN+="/usr/bin/systemctl restart --no-block logid.service"
# Logitech via Bluetooth (BlueZ UHID path 0005:046D:...)
ACTION=="add|change", SUBSYSTEM=="hidraw", KERNELS=="0005:046D:*", \
RUN+="/usr/bin/systemctl restart --no-block logid.service"
(Optional) one-shot timer to nudge after boot:
# /etc/systemd/system/logid-postboot.service
[Unit]
Description=Post-boot nudge for logid
After=bluetooth.service
[Service]
Type=oneshot
ExecStart=/usr/bin/systemctl restart logid.service
# /etc/systemd/system/logid-postboot.timer
[Unit]
Description=Run logid restart 15s after boot
[Timer]
OnBootSec=15s
Unit=logid-postboot.service
[Install]
WantedBy=timers.target
B) Start logid on-demand (alternative)
Instead of RUN+=restart, use:
ACTION=="add|change", SUBSYSTEM=="hidraw", KERNELS=="0005:046D:*", \
TAG+="systemd", ENV{SYSTEMD_WANTS}+="logid.service"
ACTION=="add|change", SUBSYSTEM=="hidraw", SUBSYSTEMS=="usb", ATTRS{idVendor}=="046d", \
TAG+="systemd", ENV{SYSTEMD_WANTS}+="logid.service"
…and keep logid.service disabled at boot. (This worked but still hit rare early-boot cases, hence A + small timer is bullet-proof.)
Service drop-in (minimal)
# /etc/systemd/system/logid.service.d/override.conf
[Unit]
After=
After=bluetooth.service bluetooth.target systemd-udev-settle.service
Wants=bluetooth.service bluetooth.target systemd-udev-settle.service
[Service]
ExecStartPre=
Restart=on-failure
RestartSec=2s
Proposed remedies upstream
- Ship a udev rule in
contrib/(or enabled by default) to restart on hidraw add/change for Logitech BT/USB. - Or make
logidwatch udev and rescan on newhidrawnodes instead of giving up after 5 attempts. - Relax unit ordering to avoid starting before BT/uhid is ready (e.g.,
After=bluetooth.service), though event-based is more robust.