question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Running python-validity prevents USB autosuspend (06cb:009a, Lenovo X1C6)

See original GitHub issue

python3-validity.service is running:

# systemctl start python3-validity

# systemctl is-active python3-validity
active

# cat /sys/bus/usb/devices/1-9/idVendor
06cb

# sleep 10

# grep . -r /sys/bus/usb/devices/1-9/power
/sys/bus/usb/devices/1-9/power/runtime_active_time:862019
/sys/bus/usb/devices/1-9/power/wakeup:disabled
/sys/bus/usb/devices/1-9/power/active_duration:862064
/sys/bus/usb/devices/1-9/power/runtime_active_kids:0
/sys/bus/usb/devices/1-9/power/connected_duration:941124
/sys/bus/usb/devices/1-9/power/persist:1
/sys/bus/usb/devices/1-9/power/runtime_usage:1
/sys/bus/usb/devices/1-9/power/runtime_status:active
/sys/bus/usb/devices/1-9/power/autosuspend_delay_ms:2000
/sys/bus/usb/devices/1-9/power/async:enabled
/sys/bus/usb/devices/1-9/power/runtime_suspended_time:78841
/sys/bus/usb/devices/1-9/power/runtime_enabled:enabled
/sys/bus/usb/devices/1-9/power/control:auto
/sys/bus/usb/devices/1-9/power/level:auto
/sys/bus/usb/devices/1-9/power/autosuspend:2

python3-validity.service is not running:

# systemctl stop python3-validity.service

# sleep 10

# grep . -r /sys/bus/usb/devices/1-9/power
/sys/bus/usb/devices/1-9/power/runtime_active_time:873841
/sys/bus/usb/devices/1-9/power/wakeup:disabled
/sys/bus/usb/devices/1-9/power/active_duration:873887
/sys/bus/usb/devices/1-9/power/runtime_active_kids:0
/sys/bus/usb/devices/1-9/power/connected_duration:955394
/sys/bus/usb/devices/1-9/power/persist:1
/sys/bus/usb/devices/1-9/power/runtime_usage:0
/sys/bus/usb/devices/1-9/power/runtime_status:suspended
/sys/bus/usb/devices/1-9/power/autosuspend_delay_ms:2000
/sys/bus/usb/devices/1-9/power/async:enabled
/sys/bus/usb/devices/1-9/power/runtime_suspended_time:81289
/sys/bus/usb/devices/1-9/power/runtime_enabled:enabled
/sys/bus/usb/devices/1-9/power/control:auto
/sys/bus/usb/devices/1-9/power/level:auto
/sys/bus/usb/devices/1-9/power/autosuspend:2

It would appear that a running instance of the python-validity dbus service prevents USB autosuspend from working (regardless of the fact that the included udev rule explicitly enables runtime PM on the fingerprint reader device).

Maybe it would make sense to release the device internally after a timeout and reacquire it every time a bus request is made?

Or, alternatively, maybe turn the architecture upside-down and have the open-fprintd manager invoke and enumerate drivers in turn until a device is found?

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
uunicorncommented, Nov 29, 2020

How much time is that in absolute terms?

It is about 3 seconds.

What exactly is on the other side of this compromise?

Slow-ish initialization time was not the only problem with initialization on demand. Performing TLS initialization too often seems to be causing device to lock-up. I don’t really understand what exactly is causing it, nor I can quantify the “too often” part. During this lock-up a device is refusing TLS setups. Rebooting into Windows, powering off/on, even factory reset via BIOS - nothing seems to help. However after about 24h problem just magically goes away. Very odd.

1reaction
uunicorncommented, Nov 28, 2020

It is by design. Allowing the device to autosuspend resets the TLS state and I can type my password faster than that state can be re-established on my 0097 device.

Or, alternatively, maybe turn the architecture upside-down and have the open-fprintd manager invoke and enumerate drivers in turn until a device is found?

Original fprintd daemon is designed that way. It is linked against libfprintd (which contains actual FP drivers) and it is activated by Gnome or a PAM module via client DBus API. Each time it activates, it enumerates the bus and initializes the device. One reason to introduce the back-end DBus API and the open-fprintd service was to turn the fprintd architecture upside-down so that the driver can have its own life-cycle and keep the device open and initialized as long as it is connected.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Lenovo ThinkPad X1 Extreme - ArchWiki - Arch Linux
A BIOS setting can be used to disable the integrated GPU, and run everything on the dedicated Nvidia card. The dedicated GPU cannot...
Read more >
Fingerprint works on T480 (kernel 5.8.1) : r/thinkpad - Reddit
I have 06cb:009a on my X1C6. It works but I can only enroll 1 finger? And the service dies after suspend, the restart.service...
Read more >
python-validity - bytemeta
python-validity repo issues. ... Running python-validity prevents USB autosuspend (06cb:009a, Lenovo X1C6). MGodric. MGodric CLOSED · Updated 4 months ago ...
Read more >
python-validity - githubmemory
python-validity repo issues. ... not support lenovo xiaoxin air 2020 ... Running python-validity prevents USB autosuspend (06cb:009a, Lenovo X1C6). MGodric.
Read more >
The python-validity from uunicorn - GithubHelp
If I try to use python-validity I get an error: Exception: Unknown flash IC. ... Running python-validity prevents USB autosuspend (06cb:009a, Lenovo X1C6)....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found