omarchy icon indicating copy to clipboard operation
omarchy copied to clipboard

Lock screen: fingerprint reader disabled by libfprint thermal guard after ~3 min, then 250 ms retry loop

Open gfotakis opened this issue 2 months ago • 9 comments

What happens

After the screen has been locked for about three minutes, fingerprint unlock stops working and stays dead until the session is unlocked with the password.

The lock plugin keeps pam_fprintd armed for the whole lock (shell/plugins/lock/Service.qml). libfprint's thermal guard then disables the reader, and from that point every attempt fails instantly with:

fprintd[...]: Device reported an error during identify: Device disabled to prevent overheating.

fingerprintRetryTimer (250 ms) restarts the PAM session after each failure, so the shell retries about 2.4 times per second for as long as the screen stays locked. One overnight lock produced 54,319 of these errors (22:38 to 05:11, roughly 8,500 per hour), and the reader never recovered in that time — presumably because it is never left idle long enough to cool down.

Expected

Fingerprint unlock still works after a long lock, and a device error does not cause a tight retry loop.

Steps to reproduce

  1. Enroll a fingerprint (omarchy setup security fingerprint).
  2. Lock the screen and leave it locked for more than ~3 minutes.
  3. journalctl -b | grep 'prevent overheating' shows the error repeating several times a second; the reader no longer unlocks.

Timeline from the journal: lock at 22:35, normal ~30 s PAM timeouts until 22:37, first overheat error at 22:38:14, then continuous.

System

  • Omarchy 4.0.4-1, kernel 7.2.5-3-omarchy
  • libfprint 1.94.100-1, fprintd 1.94.5-2
  • Reader: 05ba:000a DigitalPersona, Inc. Fingerprint Reader (U.are.U 4000/4000B/4500, press type)
  • Alienware 15 DA15265, AMD Ryzen 7 260 (Radeon 780M) + NVIDIA RTX 5060 Mobile

Suggested fix

Only scan for a short window after lock and after user activity (wakeRequested), abort the fingerprint PAM session when the window closes, and back off when an attempt fails immediately. I am running this as a local clone of omarchy.lock; fingerprint unlock inside the window works. The long-lock case is not yet confirmed overnight.

--- /usr/share/omarchy/shell/plugins/lock/Service.qml	2026-09-15 16:04:52.000000000 -0500
+++ Service.qml	2026-10-01 05:18:55.524369703 -0500
@@ -32,6 +32,14 @@
   property string lastEvent: "init"
   property string lastEventAt: ""
   property bool strandedLock: false
+
+  // The reader only scans for a short window after user activity. Scanning for
+  // the whole lock trips libfprint's thermal guard ("Device disabled to prevent
+  // overheating") after ~3 minutes, and the reader then stays dead until unlock.
+  readonly property int fingerprintWindowMs: 30000
+  readonly property int fingerprintRetryMaxMs: 30000
+  property double fingerprintStartedAt: 0
+  property int fingerprintFastFailures: 0
   property bool strandedLockResolved: false
 
   readonly property bool locked: lockRequested || sessionLock.locked || sessionLock.secure
@@ -120,7 +128,9 @@
     failedAttempts = 0
     authenticatingPassword = false
     fingerprintAuthenticating = false
+    fingerprintFastFailures = 0
     fingerprintRetryTimer.stop()
+    fingerprintWindowTimer.stop()
     if (passwordPam.active) passwordPam.abort()
     if (fingerprintPam.active) fingerprintPam.abort()
   }
@@ -208,22 +218,50 @@
 
   function startFingerprint() {
     if (!lockRequested || !sessionLock.secure || !fingerprintConfigured) return
+    if (!fingerprintWindowTimer.running) return
     if (fingerprintPam.active || fingerprintAuthenticating) return
 
     fingerprintAuthenticating = true
+    fingerprintStartedAt = Date.now()
     if (!fingerprintPam.start()) {
       fingerprintAuthenticating = false
     }
   }
 
+  // Called on lock and on every key press or pointer move on the lock screen.
+  function openFingerprintWindow() {
+    if (!lockRequested || !sessionLock.secure || !fingerprintConfigured) return
+
+    fingerprintWindowTimer.restart()
+    if (!fingerprintRetryTimer.running) startFingerprint()
+  }
+
+  function closeFingerprintWindow() {
+    fingerprintRetryTimer.stop()
+    if (fingerprintPam.active) fingerprintPam.abort()
+    fingerprintAuthenticating = false
+  }
+
+  function retryFingerprint() {
+    if (!lockRequested || !fingerprintConfigured || !fingerprintWindowTimer.running) return
+
+    // An attempt that dies at once is a device error (busy, overheated), not a
+    // timeout or a bad read. Back off so the reader gets time to recover.
+    if (Date.now() - fingerprintStartedAt < 2000) fingerprintFastFailures += 1
+    else fingerprintFastFailures = 0
+
+    fingerprintRetryTimer.interval = Math.min(fingerprintRetryMaxMs, 250 * Math.pow(2, fingerprintFastFailures))
+    fingerprintRetryTimer.restart()
+  }
+
   function handleFingerprintFinished(result) {
     fingerprintAuthenticating = false
 
     if (!lockRequested) return
     if (result === PamResult.Success) {
       finishUnlock()
-    } else if (fingerprintConfigured) {
-      fingerprintRetryTimer.restart()
+    } else {
+      retryFingerprint()
     }
   }
 
@@ -238,7 +276,7 @@
         root.pendingSessionLock = false
         sessionLockStabilizeTimer.stop()
         pendingSessionLockTimer.stop()
-        root.startFingerprint()
+        root.openFingerprintWindow()
       }
     }
 
@@ -280,7 +318,7 @@
         onPasswordTextEdited: function(password) { root.enteredPassword = password }
         onSubmitPassword: function(password) { root.submitPassword(password) }
         onClearFailureRequested: root.failureMessage = ""
-        onWakeRequested: root.runWake()
+        onWakeRequested: { root.runWake(); root.openFingerprintWindow() }
       }
 
     }
@@ -349,11 +387,18 @@
 
     onError: function(error) {
       root.fingerprintAuthenticating = false
-      if (root.lockRequested && root.fingerprintConfigured) fingerprintRetryTimer.restart()
+      root.retryFingerprint()
     }
   }
 
   Timer {
+    id: fingerprintWindowTimer
+    interval: root.fingerprintWindowMs
+    repeat: false
+    onTriggered: root.closeFingerprintWindow()
+  }
+
+  Timer {
     id: fingerprintRetryTimer
     interval: 250
     repeat: false
@@ -381,7 +426,7 @@
     stdout: StdioCollector { id: fingerprintCheckStdout; waitForEnd: true }
     onExited: {
       root.fingerprintConfigured = String(fingerprintCheckStdout.text || "").trim() === "yes"
-      if (root.lockRequested && root.fingerprintConfigured) root.startFingerprint()
+      if (root.lockRequested && root.fingerprintConfigured) root.openFingerprintWindow()
       else if (!root.fingerprintConfigured && fingerprintPam.active) fingerprintPam.abort()
     }
   }
@@ -424,9 +469,8 @@
         root.armBlankTimer()
         return
       }
-      // Only a password check in flight should hold the display up. The
-      // fingerprint PAM stays armed for the whole lock, so gating on
-      // `authenticating` here would keep the panel lit until unlock.
+      // Only a password check in flight should hold the display up; a
+      // fingerprint scan in its window must not keep the panel lit.
       if (root.lockRequested && !root.authenticatingPassword) root.runBlank()
     }
   }

gfotakis avatar Oct 01 '26 10:10 gfotakis

Same retry loop as #13748 and #13906. Open PRs that add backoff or a cap to the lock screen's fingerprint retries: #10393, #11918, #12544 and #13819. The thermal-guard case is the same immediate-failure path they cover.

manuaudio avatar Oct 01 '26 10:10 manuaudio

Strong report — journal timeline and the proposed activity-window + exponential backoff look right for the libfprint thermal guard.

This is the same failure class as:

  • #13906 / #9905 (250 ms retry, no backoff)
  • #12509 (~400 ms indefinite retries)
  • #13748 (overnight overheat / sensor disable)

Please treat those as the tracker cluster; your suggested Service.qml change is a good candidate PR against that cluster.

Note: #13918 adds fingerprint UI feedback and does not implement the thermal window/backoff — do not close this when that merges.

jandrusk avatar Oct 01 '26 13:10 jandrusk

i wonder if somebody goes over issues, a lot of good stuff

konstantin-mohin avatar Oct 01 '26 13:10 konstantin-mohin

Merged #7158 fixes the rapid post-prompt error loop and has demonstrated thermal recovery with the official virtual reader and real fprintd/PAM. It does not prevent continuous healthy scanning from reaching the thermal cutoff again during a long lock. Keeping this open for that remaining long-lock availability problem; physical USB hardware was not tested.

GPT-6 in Codex and Claude Opus 5.5 Medium checked the coverage against the landed source; Claude's agreement does not guarantee independence. This closure review was read-only and did not rerun runtime tests.

omarchybot avatar Oct 04 '26 17:10 omarchybot

Looked at what is left of this on quattro at 47caa9be439e1876b6048a32a868688e9c697d48, which includes #7158.

Fingerprint unlock still drops out during a long lock on quattro, though not for the whole night. The reader is still armed for the entire lock: an attempt that reaches the reader and times out without a finger retries after 250 ms (shell/plugins/lock/Service.qml:404-431, FingerprintModel.js:3), and blanking the display does not stop it (Service.qml:305). Your uru4000 driver uses libfprint's default thermal model, which starts a freshly opened device at the edge of cold and reaches HOT after 180 seconds of continuous scanning (fp-device-private.h:25-40, fpi-device.c:2389-2428). That matches the three minutes in your journal. Once the reader is HOT, #7158 spaces out the instant Device disabled to prevent overheating failures at 1, 2, 4, 8, 16, 32 and then 40 seconds. fprintd counts a device that is not cold as busy (fprintd/src/device.c:290-293), so it never reaches its 30-second idle exit, and the heat model is not reset that way either. The reader only recovers by cooling below the HOT threshold, which takes about 205 seconds. It then scans for about two minutes before going HOT again. So for as long as the screen stays locked, the reader works for about two minutes, then refuses for about 3½ to 4 minutes. A finger placed during the refusing part fails. These figures are worked out from the libfprint and fprintd source, not measured: a worker VM has no fingerprint reader, so nothing was reproduced.

What fixes it is a choice about when the lock screen arms the reader, so it is the maintainer's to make. Three open pull requests each stop the reader scanning through an unattended lock, in different ways:

  • #11273 aborts the scan when the display blanks and starts it again on wake. It has merge conflicts with quattro.
  • #12420 lets the scan in progress finish when the display blanks, starts no new one, and starts again on wake.
  • #12461 stops after six scans that reach the reader, and starts again on a click or a keystroke, but not on pointer motion.

With each of them, a lock left overnight should leave the reader cold, and fingerprint unlock should work on return. With #11273 and #12420, scanning starts again only on a wake the lock recognises, so touching the reader on a dark lock screen does nothing by itself. #12461's six scans add up to just under the 180-second threshold from a cold start, so a reader that is already warm can still reach HOT within one round. Each pull request is reviewed on its own. None of them has been run against a real reader, so none is linked here as the fix yet. Your suggested window after activity is a fourth version of the same choice.

Claude Opus 5.5 reviewed this, with a second opinion from Codex Medium. Codex contributed the fprintd busy-while-warm detail and the cycle timing above, which were then checked against the source. It also considered this issue a duplicate of the lock-screen part of #13748. I have kept this one open: #13748 reports the retry storm that #7158 addresses, while the problem that remains here is a healthy reader that keeps scanning until it overheats. This is waiting on the maintainer to choose between those pull requests.

omarchybot avatar Oct 13 '26 07:10 omarchybot

Another data point, this time on real Goodix hardware: a ThinkPad E14 Gen 5 with a Goodix 27c6:550a reader, using the proprietary TOD driver (libfprint-tod 1.95.2+tod1-1, libfprint-2-tod1-goodix 0.0.9.r3, fprintd 1.94.5-2). Omarchy 4.5.0-3 (stable), Quickshell 0.3.2.r7.

  • The lock was requested at 12:26:17 and fprintd started at 12:26:18. The first Device disabled to prevent overheating came at 12:29:30, about 3 minutes 12 seconds later, so the TOD driver hits the same 180 s thermal threshold.
  • From there until a password unlock at 13:26:30, fprintd logged 1,757 overheating errors at a steady interval of about 1.2 s. The interval never grew, and the lock logged no fingerprint-unreached or fingerprint-unavailable events. Each cycle relays the "Place your right index finger…" prompt before failing, so on this stable build the overheating failure is still handled as an ordinary mismatch and retried after 250 ms. That suggests #7158 hasn't reached stable 4.5.0-3 yet.
  • Short locks (under 3 minutes) unlock by fingerprint normally.

athomas93 avatar Nov 12 '26 19:11 athomas93

@athomas93, the official v4.5.0 source already includes #7158 (retry backoff) and #15294 (pause new scans while the display is blank). Its Service.qml and FingerprintModel.js match those at quattro commit 419a5a7095d118a218d5f84548dbd83ce90067e6. The package version alone does not establish which code the running shell loaded: automatic QML reloading is disabled, and a local lock plugin can also differ.

In this source, a PAM device error within two seconds of the first finger prompt backs off and logs fingerprint-unreached / fingerprint-unavailable. A Failed completion is instead treated as an ordinary mismatch; an Error later than two seconds also keeps the short retry. We need the actual PAM result and timing to distinguish those paths from older running code. The blank timer should also pause new attempts after about five seconds without activity, allowing the current attempt to finish.

Before restarting anything, please provide:

  • pacman -Qi omarchy, omarchy dev status, and ps -C quickshell -o pid,lstart,args. Say whether a local lock-plugin clone is enabled. Include SHA-256 hashes of Service.qml and FingerprintModel.js under the shell's actual runtime path; if it is a checkout, include its full commit and any local lock-file changes.
  • A timestamped journal slice covering the lock, first overheating error, subsequent retries and unlock. Include both the omarchy-shell tag and fprintd service, preserving prompt, PAM completion/error and lock events rather than only overheating lines. Did the display go dark and stay dark, and did new attempts continue without input?

Then reboot and repeat a five-minute untouched lock on the packaged runtime, waking the display before trying the reader. If it still fails, please repeat against this exact source after linking a separate checkout and rebooting:

git clone https://github.com/omacom/omarchy.git ~/omarchy-13944
git -C ~/omarchy-13944 checkout --detach 419a5a7095d118a218d5f84548dbd83ce90067e6
omarchy dev link ~/omarchy-13944

Include the logs from that run too. omarchy dev unlink and a reboot return to the packaged runtime.

GPT-6 High in Codex checked the source, with reviews by Opus 5.5 High and muse-wonder via pi, thinking high. Both agreed that the new report does not yet establish a code fix; independence is not guaranteed. The real lock-service fixture passed on a disposable ISO worker using simulated PAM state. The separate retry-model test was blocked by missing Node; physical Goodix and DigitalPersona hardware were not tested. This is waiting for the runtime details and hardware retest above.

omarchybot avatar Nov 18 '26 04:11 omarchybot

Adding Dell/ControlVault 3 confirmation: same behavior — "checking..." then password fallback, Device disabled to prevent overheating from libfprint's software thermal model (~180s), 250ms retry loop. Confirmed the fix is raising the poll interval to 3000ms with backoff in shell/plugins/lock/FingerprintModel.js. Note the driver-level fix: the ControlVault 3 TOD driver leaves temp_hot_seconds at 0 so libfprint applies its default thermal model — setting fp_device_set_option_uint(device, "temp_hot_seconds", 300) would fix it upstream. Also see #9913 for the related whole-lock-arm problem.

cloppeh avatar Nov 29 '26 14:11 cloppeh

@cloppeh, could you share the exact diff for the 3,000 ms change, your Dell model and reader USB ID, and your Omarchy, Quickshell, libfprint/TOD and fprintd versions? Please include the running Omarchy checkout SHA or hashes of the loaded Service.qml and FingerprintModel.js, plus one timestamped journal slice from an unmodified run with the Quickshell PAM prompt and completion, the fprintd overheating message, and whether the display stayed blank or woke before the next attempt. If you used a dock or external monitor, please say whether it dropped out and reappeared when the lock blanked. It would also help to know whether the change let you unlock after a long lock or only reduced the retry rate.

Current quattro backs off PAM device errors within two seconds of the prompt. Blanking pauses new attempts, and a display reappearing can resume them. The 250 ms interval also serves ordinary retries after a mismatch or an untouched scan. #20688 extends the device-error window to 20 seconds. The PAM result and the time from prompt to error would tell us whether that change covers this Dell report. The older #9913 report covers the original whole-lock scan on DigitalPersona. The newer Dell and Goodix reports still need a trace from a known runtime.

If this still reproduces after rebooting into an unmodified package install, please repeat a five-minute idle lock against the pinned quattro commit, with no input or suspend until you wake the display to try the reader.

git clone https://github.com/omacom/omarchy.git ~/omarchy-13944-dell
git -C ~/omarchy-13944-dell checkout --detach e3c73b38ffab0bb7ccf90da552aa681abf39811e
omarchy dev link ~/omarchy-13944-dell

Reboot to activate it. Run omarchy dev unlink and reboot to return to the package install.

GPT-6 High in Codex reviewed the lock and retry source with Opus 5.5 High and muse-wonder via pi, thinking high. Both reviewers agreed that the Dell report needs hardware logs to identify the failure path. Their independence is unverified. This was a source review. The physical readers are needed for the retest.

omarchybot avatar Nov 29 '26 14:11 omarchybot