uunicorn / python-validity

Validity fingerprint sensor prototype
MIT License
955 stars 79 forks source link

Daemon randomly dying on Thinkpad T480 #193

Open repomansez opened 4 months ago

repomansez commented 4 months ago

Sometimes I lock my computer and when I come back the fingerprint sensor stops working. I see nothing on dmesg and lsusb still lists the device, but the python3-validity daemon dies, saying the device might have been disconnected (restarting the daemon fixes it):

○ python3-validity.service - python-validity driver dbus service Loaded: loaded (/usr/lib/systemd/system/python3-validity.service; disabled; preset: disabled) Active: inactive (dead)

Jun 03 14:13:26 kubo dbus-service[1227]: ^^^ Jun 03 14:13:26 kubo dbus-service[1227]: File "/usr/lib/python3.12/site-packages/usb/backend/libusb1.py", line 837, in bulk_write Jun 03 14:13:26 kubo dbus-service[1227]: return self.write(self.lib.libusb_bulk_transfer, Jun 03 14:13:26 kubo dbus-service[1227]: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Jun 03 14:13:26 kubo dbus-service[1227]: File "/usr/lib/python3.12/site-packages/usb/backend/libusb1.py", line 938, in write Jun 03 14:13:26 kubo dbus-service[1227]: _check(retval) Jun 03 14:13:26 kubo dbus-service[1227]: File "/usr/lib/python3.12/site-packages/usb/backend/libusb1.py", line 604, in _check Jun 03 14:13:26 kubo dbus-service[1227]: raise USBError(_strerror(ret), ret, _libusb_errno[ret]) Jun 03 14:13:26 kubo dbus-service[1227]: usb.core.USBError: [Errno 19] No such device (it may have been disconnected) Jun 03 14:13:26 kubo systemd[1]: python3-validity.service: Deactivated successfully.

repomansez commented 3 months ago

After some more testing I've confirmed it happens after system goes into suspend. Probably related to issue #173

rauldelp commented 3 months ago

I'm having a potentially similar issue here. T480 (Arch btw), Gnome DE. Works on install, dies on restart (reboot).

If I type: sudo systemctl restart python3-validity sudo systemctl restart open-fprintd

then it works fine after suspends until I restart the computer again. Looking to see if I can set it to run as a script after I login to the gnome session, but haven't figured that part out yet.

Seems to behave the same in Plasma 6 ( didn't try 5), so doesn't seem to be tied to KDE or GNOME necessarily. Seems to be logging in that breaks it. Luckily, I don't restart the computer often, mostly just suspends or locks.

repomansez commented 2 months ago

I'm having a potentially similar issue here. T480 (Arch btw), Gnome DE. Works on install, dies on restart (reboot).

If I type: sudo systemctl restart python3-validity sudo systemctl restart open-fprintd

then it works fine after suspends until I restart the computer again. Looking to see if I can set it to run as a script after I login to the gnome session, but haven't figured that part out yet.

Seems to behave the same in Plasma 6 ( didn't try 5), so doesn't seem to be tied to KDE or GNOME necessarily. Seems to be logging in that breaks it. Luckily, I don't restart the computer often, mostly just suspends or locks.

Not to be a buzzkill, but this software is pretty much abandoned and it depends on an even more abandoned and potentially unsafe fork of fprintd. I would seriously advice against using it until the developer (or someone else) continues development of both the fprintd fork and of this repo.

warlock94 commented 1 month ago

I am experiencing the same. ThinkPad x380 Yoga with Fedora 40 and GNOME DE. Restarting python3-validity and open-fprintd works. @repomansez is there a project / fork that is actively maintained currently? Otherwise I might just deactivate the fingerprint reader (was happy to get it working a few days ago, but anyways... ^^) or create a systemd unit that restarts both services after resume.

warlock94 commented 1 month ago

My workaround for now: creating a systemd unit at /etc/systemd/system/validityrestart.service with the following content. Seems to work. Edit: I have to press ESC since after resume I am prompted for my password. ESC brings me back to the user selection. When I then select my user again by ENTER, I am prompted for fingerprint.

[Unit]
After=hibernate.target
After=hybrid-sleep.target
After=suspend.target
After=suspend-then-hibernate.target

[Service]
Type=simple
ExecStart=/bin/systemctl --no-block restart python3-validity.service open-fprintd.service

[Install]
WantedBy=hibernate.target
WantedBy=hybrid-sleep.target
WantedBy=suspend.target
WantedBy=suspend-then-hibernate.target
repomansez commented 1 month ago

I am experiencing the same. ThinkPad x380 Yoga with Fedora 40 and GNOME DE. Restarting python3-validity and open-fprintd works. @repomansez is there a project / fork that is actively maintained currently? Otherwise I might just deactivate the fingerprint reader (was happy to get it working a few days ago, but anyways... ^^) or create a systemd unit that restarts both services after resume.

Not that I know of. I've looked. For the time being yeah I'd totally advise you to just forget about the fingerprint sensor.

CornelisDenhart commented 1 day ago

@warlock94 Thanks for sharing this solution. I have same issue on Debian 12 on T480. It might be obvious, but I had to find out, that creating the the file is not sufficient, it needs this to make it work: systemctl enable validityrestart.service