Repository navigation
soc: apple: sep: arm the next Touch ID capture when the finger lifts - #1087
Conversation
Linux only took back-to-back Touch ID touches with a gap: after every touch the next capture waited a fixed 1.8 s from the end of the last one (MATCH_SETTLE_MS), and an enrolment waited 1.8 s between every placement (ENROL_REPOSITION_MS). A finger journal shows touches inside one sudo prompt 2.5-3 s apart, 1.8 s of it this pause. A trace of a macOS 26.6.2 Touch ID prompt on the same MacBook Neo (three wrong touches; sensor SPI traffic and SBIO calls with microsecond timestamps) shows what macOS does instead: - After the frames of a touch are taken it sends PAUSE_CAPTURE (0x80 0x41) rather than idling the sensor. The sensor stops imaging but keeps watching the finger and falls to idle (state 0) the moment the finger is lifted; macOS arms the next capture (START_CAPTURE) 1-2 ms later. Touches were 1.35-1.37 s apart: the finger lifted 0.3-0.4 s after each result and was back 0.5-0.7 s after the lift. - One START_CAPTURE yields a frame every ~80 ms while the finger stays down; the no-match tail relays the frames taken while MATCH_RESULT ran (13 ms for the whole tail). - The no-match reaches LocalAuthentication 0.36 s after the finger lands. SAVE_LOCKOUT and the background result follow it (after MATCH_CANCEL when the prompt ends) while the finger is lifted. Do the same: - End every verify and enrolment touch with PAUSE_CAPTURE and arm the next capture when the sensor reports the finger lifted (idle or armed), interrupt-driven with a 20 ms backstop. Frames imaged before the pause took effect are read and dropped. While the finger stays down the poll reports the new SEP_BIO_GUIDANCE_LIFT. The fixed 1.8 s waits are gone. - Take the no-match tail's frames from the running capture first, and start it again only when the sensor stopped imaging. - Report a no-match as soon as the touch is finished, then save the lockout record (once per result, after MATCH_CANCEL when the prompt ends, as macOS does; it was saved twice), collect the background result and persist. The next verify waits for this work before its capture, as before. A match is still reported only after its template update is persisted. The per-prompt match operation, the no-match tail and the host retry limit from the lockout fix are unchanged. Signed-off-by: Ryan Murray <[email protected]> Assisted-by: LLM
An enrolment touch gives one frame. In a macOS 26.6.2 enrolment trace on the MacBook Neo, PAUSE_CAPTURE (0x80 0x41) follows the frame by about 200 ms, while the enclave is still processing it. The sensor reports the lift with the enclave's answer still pending, and the next capture is armed 3 ms after the lift. Touches were about 1 s apart. Pause right after the frame is read instead of after the enclave's answer, and pause in the loop only if the frame could not be read. Signed-off-by: Ryan Murray <[email protected]> Assisted-by: LLM
Read the lift from the sensor's finger detector, not from its state alone. In the macOS trace the status flags byte (status[11]) reads 0x0c while the sensor is armed or idle with no finger, 0x0e once a finger is on, and 0x8e with a frame ready. At the lift interrupt macOS reads state 0 with flags 0x0c. A paused sensor whose state is idle but whose detector still sees the finger must not count as lifted, or the next capture would take the resting finger. Log the first status and the lifting status, so the finger test shows what the sensor reports while paused. Signed-off-by: Ryan Murray <[email protected]> Assisted-by: LLM
|
Neo no-finger gate (fleet22 + these 3 commits, 7.3.0-aurora-fleet22-tid25): PASS. The #904 lifecycle is unchanged: re-arm status 0, every verify 0x88, 0x7d/MATCH_CANCEL balanced 4/4, 0 apple_sep errors, 0 AVC. The sensor accepts PAUSE_CAPTURE (80 41). After an empty capture the next verify is armed 159 ms later (it used to wait out the 1.8 s settle), and a fresh verify is armed 142 ms after fprintd starts it. Post-result bookkeeping takes 16-22 ms. The finger-lift wait itself still needs Ryan's finger test (back-to-back misses, a held finger, then a match). This PR stays unmerged until that test passes. |
Touch ID gave no reason when a capture did not count. A verify that ended with the retry status (no finger in time, an unreadable frame, partial contact) carried whatever guidance the capture last had, so userspace could only say "scan again". An enrolment capture that did not count was never reported at all: the poll's retry status, which libfprint's aurora driver already maps to a retry, was never set. Name the cause in the poll's guidance alongside the retry: PLACE when no finger came in time, LIFT_AND_MOVE for a frame that could not be read, and the new SEP_BIO_GUIDANCE_CENTER (5) for partial contact. SEP_BIO_GUIDANCE_TOO_FAST (6) and SEP_BIO_GUIDANCE_CLEAN (7) are reserved for the image-assessment feedback (the finger moved; dirt or moisture), which the matching code can report later. A running enrolment's poll now carries the retry status once per capture that did not count, with its cause. Older readers ignore the guidance of a failed verify and already handle the enrolment retry. Decode the sensor status in Status::parse and name the lift test Status::finger_off(). Add KUnit cases that replay the GET_STATUS replies the sensor gave macOS in our own trace (an LA prompt with three misses and an enrolment): every status decodes to the finger-on/finger-off verdict macOS reached, and a lift detector over the three-touch sequence fires exactly at macOS's three FingerOFF events and never on a frame. Signed-off-by: Ryan Murray <[email protected]> Assisted-by: LLM
… once Split the enrolment poll into what it reports (enrol_poll_report) and marking its one-shot reports seen (mark_enrol_seen), which now happens only once the poll reached userspace. A KUnit case drives a session: an uncounted capture is reported once with its cause, the next poll carries none, a later stage is reported without a retry, and a stale worker cannot report into a newer enrolment. Signed-off-by: Ryan Murray <[email protected]> Assisted-by: LLM
…nger Take aurora-sep-userspace 95776d69 (#9): patch 0007 maps the apple_sep kernel's retry causes (aurora-silicon/linux#1087: partial contact, a moving finger, dirt or moisture, an unreadable frame) onto fprintd's CENTER_FINGER, TOO_FAST and REMOVE_FINGER prompts, and starts the match again silently after a no-finger capture timeout, as a macOS Touch ID prompt keeps waiting. apple-sep.h follows the kernel UAPI. Signed-off-by: Ryan Murray <[email protected]> Assisted-by: LLM
|
Hardware finger test PASSED on the MacBook Neo, 2026-11-08 ~14:20, by Ryan on kernel 7.3.0-aurora-fleet22-tid27 (#1087 + #1134 + #1143), libfprint aurora10, aurora-touchid-rearm 1-2.
|
|
Merged after the cross-Mac gate. The Touch ID path here has no SoC gating, and it now runs the same on every Touch ID Mac:
|
Take aurora-sep-userspace 21399524 (aurora-silicon#8): patch 0006 reports the kernel's new SEP_BIO_GUIDANCE_LIFT (the last touch's finger is still down; the apple_sep kernel arms the next capture when it is lifted, as macOS does, aurora-silicon/linux#1087) as finger present, and names the Touch ID lockout status. apple-sep.h follows the kernel UAPI. Signed-off-by: Ryan Murray <[email protected]> Assisted-by: LLM
…nger Take aurora-sep-userspace 95776d69 (aurora-silicon#9): patch 0007 maps the apple_sep kernel's retry causes (aurora-silicon/linux#1087: partial contact, a moving finger, dirt or moisture, an unreadable frame) onto fprintd's CENTER_FINGER, TOO_FAST and REMOVE_FINGER prompts, and starts the match again silently after a no-finger capture timeout, as a macOS Touch ID prompt keeps waiting. apple-sep.h follows the kernel UAPI. Signed-off-by: Ryan Murray <[email protected]> Assisted-by: LLM
Touch ID on Linux only took back-to-back touches with a gap. After every touch the next capture waited a fixed 1.8 s (
MATCH_SETTLE_MS), and enrolment waited 1.8 s between placements (ENROL_REPOSITION_MS). In the touchid24 finger journal, touches inside one sudo prompt were 2.5-3 s apart, and 1.8 s of that was this sleep (fprintdVerifyStartat 21:09:55.894, kernel capture at 21:09:57.715).What macOS does (Neo, macOS 26.6.2, our own trace: sensor SPI bytes from the unified log plus fbt timestamps in µs)
0x65+0x3e,0x0c)80 40) streams a frame every ~80 ms, and the tail relays the frames taken while MATCH_RESULT ran80 41): imaging stops, the finger detector keeps runningChange
SEP_BIO_GUIDANCE_LIFT(4); older readers treat it asNONE. Both fixed 1.8 s waits are removed.Follow-up commits
status[11]bit 0x02 together with the state. In the macOS SPI log the flags read 0x0c when armed or idle with no finger, 0x0e with a finger on, and 0x8e with a frame ready. A sensor that is idle while its detector still sees the finger does not count as lifted.guidance: PLACE when no finger came in time, LIFT_AND_MOVE for an unreadable frame, and the newSEP_BIO_GUIDANCE_CENTER(5) for partial contact.TOO_FAST(6) andCLEAN(7) are reserved for the image-assessment feedback. A running enrolment's poll now reports the retry status once for each capture that did not count; libfprint expected that, but the kernel never sent it. Also addsStatus::parseandStatus::finger_off().Testing
apple_sep*: all new cases pass. The only failures are the 4apple_sep_host_storecases, which also fail on the base. New cases:apple_sep_sensor_status: the GET_STATUS replies the sensor gave macOS (7 distinct vectors from our trace) decode to macOS's finger-on/off verdict.apple_sep_enrol_request: an uncounted enrolment capture is reported once, with its cause.Userspace: libfprint maps
SEP_BIO_GUIDANCE_LIFTtoFP_FINGER_STATUS_PRESENTand names the lockout status. That ships as a distro patch; the kernel change works without it.🤖 Generated with Claude Code