noctalia-shell icon indicating copy to clipboard operation
noctalia-shell copied to clipboard

[BUG] Fingerprint unlock does not work after suspend/resume when using the Synaptics sensor (reopen for v5)

Open f0xdr0 opened this issue 2 months ago • 11 comments

Submission checklist

  • [x] I have searched existing issues and confirmed this is not a duplicate.
  • [x] I am using the latest available version of Noctalia.

Bug description

The lock screen gets stuck while checking the fingerprint.

Steps to reproduce

  1. Execute noctalia msg session lock-and-suspend
  2. Resume the machine and attempt to unlock using the fingerprint sensor.

Expected behavior

The session asks you to touch the sensor to unlock it.

Actual behavior

The session asks you to enter your password and gets stuck for about 30 seconds after you press Enter.

Logs / error output

fprintd[9469]: Unexpected error while suspending device: The device is still busy with another operation, please try again later.
fprintd[9469]: Unexpected error while suspending device: The device is still busy with another operation, please try again later.
fprintd[9469]: Verification was in progress, stopping it
fprintd[9469]: Authorization denied to :1.255 to call method 'Claim' for device 'Synaptics Sensors': Device was already claimed
fprintd[9469]: Authorization denied to :1.259 to call method 'Claim' for device 'Synaptics Sensors': Device was already claimed

Noctalia version

noctalia v5.1.0 (5.1.0-1-dirty)

Compositor

Niri

Distribution

Arch-based

Environment information

Installation method: pacman

Additional context

This issue was already fixed once in the previous (v4) version https://github.com/noctalia-dev/noctalia/issues/1558

f0xdr0 avatar Sep 17 '26 10:09 f0xdr0

I can reproduce what appears to be a closely related fingerprint lifecycle problem on a different sensor (ELAN instead of Synaptics) and, importantly, without suspend/resume.

Environment

OS: Arch Linux x86_64
Kernel: Linux 7.2.4-arch1-2
Session: Wayland
Compositor: niri 26.04

Noctalia: 5.1.0-1
fprintd: 1.94.5-2
libfprint-tod: 1.95.2+tod1-1

Fingerprint device:
ELAN Fingerprint Sensor
USB ID: 04f3:0c4b
Scan type: press
Enrolled finger: right-index-finger

The sensor itself works correctly.

Standalone verification succeeds immediately:

$ fprintd-verify
Using device /net/reactivated/Fprint/Device/0
Listing enrolled fingers:
 - #0: right-index-finger
Verify started!
Verifying: right-index-finger
Verify result: verify-match (done)

Manual Noctalia locking also works when I present the finger immediately:

$ noctalia msg session lock
ok

The same is true through my niri binding:

Mod+L { spawn "noctalia" "msg" "session" "lock"; }

In both cases fingerprint authentication succeeds immediately.

Reproduction without suspend/resume

My automatic lock is configured through swayidle:

ExecStart=/usr/bin/swayidle -w \
    timeout 300 '/usr/bin/noctalia msg session lock' \
    before-sleep '/usr/bin/noctalia msg session lock'

Therefore swayidle invokes exactly the same Noctalia IPC lock command that works manually.

The failure occurs when the lock screen remains unattended:

  1. Leave the laptop idle.
  2. After 300 seconds, swayidle executes noctalia msg session lock.
  3. Noctalia starts fingerprint verification.
  4. Do not present a finger; leave the machine unattended.
  5. Verification remains active for several minutes.
  6. fprintd eventually reports:
Sep 21 11:11:41.314544 arch fprintd[6517]:
Device reported an error during verify: Device disabled to prevent overheating.

In this reproduction, Noctalia started fingerprint verification at approximately 11:08:02, and the error occurred at 11:11:41 — about 3 minutes 39 seconds later.

When I returned to the laptop, the Noctalia lock screen displayed the equivalent of:

Fingerprint server unavailable

Password authentication remained available.

Possible connection to this issue

There is an additional observation that looks particularly relevant to the Device was already claimed messages reported here.

After the unattended verification failed, the same fprintd process remained active:

fprintd.service
Active: active (running) since 10:57:58
Main PID: 6517

A later Noctalia attempt produced:

Sep 21 11:22:35 arch fprintd[6517]:
Authorization denied to :1.33 to call method 'Claim' for device 'ELAN Fingerprint Sensor': Device was already claimed

I correlated that D-Bus client with the running Noctalia process.

So in my case the sequence was effectively:

Noctalia lock
  -> Claim
  -> VerifyStart
  -> no finger presented
  -> verification remains active
  -> Device disabled to prevent overheating
  -> verification disconnect/error
  -> device remains claimed
  -> subsequent Claim returns AlreadyInUse

Source-level observation

I also inspected the v5.1.0 fingerprint lifecycle.

The lock screen starts fingerprint authentication when locking, and the fingerprint authenticator performs Claim followed by VerifyStart("any").

More importantly, the verify-disconnected path appears to:

  1. call stopVerify();
  2. set m_abort = true.

The later stop() cleanup path appears to skip Release when m_abort is set.

This seems consistent with the runtime sequence above: after the verification error, a later Claim can receive AlreadyInUse.

I have not modified PAM, fprintd, libfprint, the fingerprint enrollment, or the device configuration while investigating this.

Why I think this may help narrow the issue

My reproduction differs from the original report in two useful ways:

  • it uses an ELAN sensor rather than Synaptics;
  • it reproduces the claimed-device state without suspend/resume.

This suggests that suspend/resume may be one trigger for the problem, but may not be required for the underlying fingerprint lifecycle / cleanup issue.

There may actually be two related behaviors involved:

  1. fingerprint verification can remain active for a long time while the lock screen is unattended;
  2. after a verification disconnect/error, the fingerprint device may not always be released before the next Claim.

I hope this additional reproduction helps isolate the common lifecycle path.

alnrog avatar Sep 21 '26 09:09 alnrog

Still having the issue? in the latest v5.4.1?

AdityaKr015 avatar Oct 30 '26 14:10 AdityaKr015

This is an automated message from our backlog cleanup, posted from a maintainer's account.

Hi, and thanks for the report! We are going through older bug reports, and this one was filed against noctalia v5.1.0 (5.1.0-1-dirty) while the latest release is v5.4.1. Even if you commented recently, a lot has changed since, so it may already be fixed. Could you give v5.4.1 a try and let us know whether it still happens? If we do not hear back within 14 days, this issue will be closed automatically. No hard feelings, you can reopen it or comment at any time.

ItsLemmy avatar Oct 30 '26 19:10 ItsLemmy

Hi! Yes, the issue is still there. With 5.4.1 i'm experiencing different behavior. When my laptop wakes up from sleep, the lock screen asks me to enter my password instead of scanning my fingerprint. If I enter the correct password, the lock screen gets stuck for around 10 seconds and then unlocks. If I enter an incorrect password, it gets stuck for the same amount of time and then asks me to scan my fingerprint. Logs recorded when the correct password was entered:

11:37:56  fprintd[3242]: Verification was in progress, stopping it
11:37:56  fprintd[3242]: Async command sending failed: USB error on device 06cb:00bd : No such device (it may have been disconnected) [-4]
11:47:53  fprintd[3242]: Authorization denied to :1.201 to call method 'Claim' for device 'Synaptics Sensors': Device was already claimed
11:47:58  fprintd[3242]: Authorization denied to :1.203 to call method 'Claim' for device 'Synaptics Sensors': Device was already claimed

Pay attention to the timestamps - there's a 10-second gap between the events.

f0xdr0 avatar Oct 31 '26 10:10 f0xdr0

Still reproducible on noctalia 5.4.1, with a different daemon stack. I think the root cause on the noctalia side is: the lock screen makes a single VerifyStart attempt on resume and never retries.

Environment

Arch, niri 26.04, noctalia 5.4.1-1. Fingerprint daemon: open-fprintd 0.7 + python-validity 0.15 (Synaptics 06cb:009a, ThinkPad T480s). lock_before_suspend = true, mem_sleep = deep.

What happens

With lock_before_suspend = true, noctalia claims the device and calls VerifyStart right when logind reports resume. On S3 ("deep") the reader loses power and re-enumerates on USB, and the driver needs about 1–2 s to come back. The first VerifyStart therefore fails, and noctalia never tries again for the rest of that lock session. The reader LED stays off and only the password works. The next lock works normally, and so does sudo via pam_fprintd.

09:44:37.352 [INF] [fingerprint] could not start fingerprint verification: [org.freedesktop.DBus.Python.usb.core.USBError] ...
09:44:41.909 [DBG] [fingerprint] could not release fingerprint device: [net.reactivated.Fprint.Error.ClaimDevice] Client must claim device first
(next lock)
09:44:45.173 [DBG] [fingerprint] fingerprint verification started
09:44:47.338 [DBG] [fingerprint] verify status: verify-match (done=true)

Other errors seen at the same point: Unexpected TLS version 4 0, and [org.freedesktop.DBus.Error.NoReply] Remote peer disconnected when the daemon restarts after resume.

Suggestion

When VerifyStart or Claim fails with a non-match error while locked, retry with backoff (for example 0.5 s, 1 s, 2 s, up to about 10 s), re-querying GetDefaultDevice each time. That would also cover a daemon restart, which gives a new device object.

Doing this on the system side is unsafe: a system-sleep hook that waits for the reader runs before user.slice is thawed, and in my testing it froze the whole session.

DozenTwelve avatar Nov 02 '26 00:11 DozenTwelve

Follow-up with one more data point that may make the fix small: noctalia already re-arms fingerprint verification after a password attempt. It just doesn't do so after a VerifyStart error.

Same setup as above (5.4.1, open-fprintd + python-validity, S3). After a lid-close resume:

11:47:59.258 [INF] [fingerprint] could not start fingerprint verification: [org.freedesktop.DBus.Python.usb.core.USBError] ...
11:48:00.129 [DBG] [fingerprint] could not release fingerprint device: [org.freedesktop.DBus.Error.UnknownMethod] Method "Release" ...
(user submits a wrong password)
11:48:01.890 [INF] [fingerprint] using fingerprint device /net/reactivated/Fprint/Device/0
11:48:01.891 [INF] [fingerprint] claimed fingerprint device
11:48:01.895 [DBG] [fingerprint] fingerprint verification started
11:48:04.105 [DBG] [fingerprint] verify status: verify-match (done=true)

So the code path that restarts verification exists. Calling it (with a short backoff) when the initial VerifyStart/Claim fails while locked would cover the resume race.

Workaround for anyone hitting this: on the first lock after resume, type any character and press Enter (a failed password attempt; an empty Enter is ignored with allow_empty_password = false), then touch the sensor.

DozenTwelve avatar Nov 02 '26 02:11 DozenTwelve

Confirming on 5.4.1 with the same sensor as @f0xdr0 (Synaptics 06cb:00bd, ThinkPad T490s, stock fprintd 1.94.5 / libfprint 1.94.10, S3). Adding the noctalia-side logs, which explain the freeze:

11:07:30.342 [INF] [fingerprint] could not start fingerprint verification: [net.reactivated.Fprint.Error.AlreadyInUse] Verification already in progress
11:08:08     fprintd: Async command sending failed: USB error on device 06cb:00bd : No such device [-4]
11:08:33.864 [DBG] [fingerprint] could not release fingerprint device: [org.freedesktop.DBus.Error.Timeout]
11:08:33.864 [WRN] [main] wl_display_dispatch_pending took 25004.3ms after read
  1. The freeze is the 25 s D-Bus default timeout on Release, called synchronously on the main loop. An async call or a short timeout would fix the freeze on its own.
  2. With stock fprintd the resume failure is AlreadyInUse (the old verification stays "in progress" on the re-enumerated device), not a USB error as with open-fprintd. A retry alone probably won't help here; the stale claim has to be released first, which matches @alnrog's observation that Release is skipped after an abort.

joe-tofu avatar Nov 06 '26 10:11 joe-tofu

Follow-up to my comment above, after more testing. I need to correct point 2: with stock fprintd, a retry does work, but it needs a longer window than ~10 s.

I added a system-sleep hook that restarts fprintd after resume without blocking (systemctl --no-block try-restart fprintd.service on post, the same approach Omarchy uses). That fixes the stale claim: no more 25 s freeze, and every lock after the first one gets fingerprint again. The first lock after resume still fails:

12:57:52.274 kernel: PM: suspend exit
12:57:52.307 kernel: usb 1-9: new full-speed USB device number 6   (sensor re-enumerated)
12:57:52.353 [INF] [fingerprint] could not start fingerprint verification: [org.freedesktop.DBus.Error.UnknownMethod] (object path does not exist)
12:57:52.678 fprintd: Ignoring device due to initialization error: unsupported firmware version
12:58:22.960 systemd: fprintd.service: Deactivated successfully.   (30 s idle exit)

So with this stack:

  • noctalia's single VerifyStart happens 80 ms after resume, before the sensor is back;
  • fprintd's first probe of the re-enumerated sensor fails, and that instance then reports no device until it exits on its 30 s idle timeout;
  • the next fprintd activation finds the sensor fine.

This supports @DozenTwelve's retry suggestion. For stock fprintd the backoff would need to cover about 30–60 s, re-querying GetDefaultDevice each time, so it reaches a fresh fprintd instance. Retrying when the lock screen becomes visible again (user interaction) would also cover it.

joe-tofu avatar Nov 06 '26 12:11 joe-tofu

One more finding that I think pinpoints it. Whether fingerprint survives suspend depends on whether noctalia holds the device while the machine goes to sleep:

  • Lid close → lock → suspend: noctalia does not claim before sleeping. On resume the sensor only gets a USB reset (same device number), noctalia claims at +0.3 s, verify-match. Works every time.
  • Idle lock_and_suspend (or locking manually, then suspending later): noctalia claims and starts VerifyStart ~1.7 s before sleep. On resume the sensor is disconnected and re-enumerated (new device number), the first probe fails with unsupported firmware version, and fingerprint is gone for that lock.

~~So releasing the claim on PrepareForSleep(true) would likely fix this.~~ Edit: not on PrepareForSleep. #3935 deliberately removed that, since fprintd powers the sensor down itself at that point. A spot that may work instead is the case where noctalia triggers the suspend itself (lock_and_suspend / suspend idle actions, SessionActionRunner::requestSuspendDetached()): stop verification and Release there, before launching systemctl suspend, while the sensor is still healthy. Then claim again after resume if still locked. That would make the idle path behave like the lid path. Manual lock followed by an external suspend would still need something else.

joe-tofu avatar Nov 06 '26 13:11 joe-tofu

I see the same delay on Noctalia 5.4.1 with Niri on NixOS. My ThinkPad X1 Carbon Gen 11 has a Synaptics reader (06cb:00fc). Fingerprint unlock works after a manual lock, but after closing and reopening the lid, the correct password takes 10–15 seconds to unlock the screen. /etc/pam.d/login does not use pam_fprintd. After resume, Noctalia logs AlreadyInUse: Verification already in progress.

vinylen avatar Nov 20 '26 09:11 vinylen

Using Noctalia 5.5 + Umbriel on NixOS on Think pad X13 Gen 3 (06cb:00f9 Synaptics, Inc.)

I've just come from Niri + Dux Shell. I've had similar issues over the last year with fingerprint reliability but something they did in the last 2-4 weeks absolutely fixed all issues I had and was 99% reliable. Not sure if there is any inspiration you can glean?

(Maybe: https://github.com/duxlabs-dev/dux-shell/commit/d7074a53ebc7ba4c16ff66f2174a4407b2dd98b7)

It was providing real time feedback as to the status of the fingerprint reader and showed when it was ready to present the finger.

14:50:35.509 [INF] [lockscreen] session is locked
14:50:37.053 [INF] [logind] logind sleep delay inhibit released
14:50:48.674 [INF] [fingerprint] no fprintd device available: [org.freedesktop.DBus.Error.NameHasNoOwner] Could not activate remote peer 'net.reactivated.Fprint': startup job failed
14:50:48.716 [INF] [logind] logind sleep delay inhibit acquired
14:50:48.716 [INF] [app] system resumed; rechecking night light and auto theme schedules
14:50:58.984 [INF] [lockscreen] session unlock requested

Would be great to seem some improvements in this area.

Many thanks

preArcMed821 avatar Nov 22 '26 14:11 preArcMed821