Skip to content

omamobile-fingerprint 0.1.11: touches in panel pixels, the circle lit before the capture, the refresh rate the HAL parses - #135

Merged
derekross merged 2 commits into
derekross:mainfrom
W4HO-ham:fp-tegu-capture-fixes
Oct 29, 2026
Merged

derekross merged 2 commits into
derekross:mainfrom
W4HO-ham:fp-tegu-capture-fixes

Conversation

@W4HO-ham

Copy link
Copy Markdown
Contributor

On the palmtop (Pixel 9a) every authenticate touch came back ACQUIRED_PARTIAL. The HAL's log showed three causes:

  • The bridge scaled touches to panel pixels for its own hit test, but handed the HAL the raw touchscreen values, ten times too large (5432,17847 for a finger on the 540,1756 circle). It now sends the scaled position.
  • The HAL captures at onPointerDownWithContext, not at onUiReady, so the circle was still dark when it took the picture. The bridge now lights the circle and waits the settle time before it reports the finger.
  • The HAL reads the refresh rate from panel0-backlight/state after the "@" (gs-panel's on: WxH@Hz), and it logged "Failed to parse refresh rate" on our bare on. The runner now writes the panel size and rate per device: cheetah 60, tegu 120, which is the rate the 9a's local HBM needs.

Tested on the palmtop: enrollment completes, and authenticate captures come back GOOD and reach the matcher (NOMATCH instead of PARTIAL). Matching itself still fails, with image quality 15-26, so that's next. The 7 Pro only gets the per-device rate (60, as before) plus the touch fix; I haven't rerun it there.

… before the capture, and the refresh rate the HAL parses

On the Pixel 9a every authenticate touch came back ACQUIRED_PARTIAL. Three things were wrong, all found from the HAL's own log.

The bridge scaled touches to panel pixels for its own hit test but handed the HAL the raw touchscreen values, ten times too large (5432,17847 for a finger on the 540,1756 circle), so the HAL saw every finger off the sensor. It now sends the scaled position.

The HAL captures at onPointerDownWithContext, not at onUiReady, so the circle was still dark for the first frame. The bridge now lights the circle and waits the settle time before it reports the finger.

The HAL reads the refresh rate from panel0-backlight/state after its "@" (gs-panel's "on: WxH@Hz") and logged "Failed to parse refresh rate" on our bare "on". The runner now writes the panel's size and rate, per device (cheetah 60 Hz, tegu 120 Hz, the rate the 9a's local HBM needs).

With these, captures are GOOD and reach the matcher (NOMATCH rather than PARTIAL); image quality is still low (15-26) and matching is the next step.
@W4HO-ham

Copy link
Copy Markdown
Contributor Author

Update from the palmtop (2026-10-29): with these three fixes plus tg4c's LHBM on the panel's normal bands, matching works. The enrolled finger gave MATCH on the first touch twice, and a different finger gave NOMATCH. Through fprintd, enrollment and verify work, and the lock screen unlocks with the enrolled finger and refuses a different one. The panel side is coming as a kernel PR on top of linux-omarchy-mobile#125 (DCS reads). The results are in #138's FINGERPRINT-PLAN.

@derekross

Copy link
Copy Markdown
Owner

Thank you for this. Tracking all three causes down from the HAL's own log is careful work, and the update that the palmtop now matches and unlocks is great to read. The tegu side looks right to me. Before I merge, there's one thing to sort out for the Pixel 7 Pro, and one thing I have to do on my side.

The 7 Pro changes more than the description says. Fingerprint unlock works on my 7 Pro every day, and this package and the bridge are shared. Here's what I found for cheetah:

  1. Touch scaling: no change on cheetah. I checked this one. Its Synaptics firmware reports a 1440x3120 range (the probe line app fw …, 1440x3120, 10 objects), and the board DT doesn't override it, so scale(v, 1439, 1440) returns v exactly. The HAL gets the same numbers as before. Thanks for keeping the scaling driven by the evdev maxima.
  2. The order in pointer() changes on cheetah (fingerprint/bridge/omamobile-fp-bridge.c, lines 949-958). Before, cheetah's HAL got onPointerDown, then the circle, then 120 ms, then onUiReady. Now it gets the circle, then 120 ms, then onPointerDown and onUiReady back to back. Cheetah enrolled and matched with the old order (cheetah FINGERPRINT-PLAN F8, F9, F16b), so its HAL clearly doesn't capture at pointer down. I have nothing showing it's happy with no gap between the two calls. This path runs on every phone, and the description doesn't mention it.
  3. The backlight state changes on cheetah, and its rate would be wrong (packages/omamobile-fingerprint/lib/omamobile-fp-chroot, lines 52 and 194). Cheetah's HAL used to read a bare on. Now it reads on: 1440x3120@60. "60, as before" was true of op_hz, but the HAL never got a rate from state until now. Cheetah also runs 1440x3120 at 120 Hz by default (cheetah NOTES, 2026-10-12: "Hyprland runs 1440x3120@120"; the matrix says "works (120 Hz)"). So the HAL would go from no rate to the wrong one. If it uses the rate for exposure, that could make cheetah's captures worse.

The project's rule for shared code is that the 7 Pro stays as it is unless there's a reason that holds there too and a run on my phone before the merge. The simplest way through:

  • Gate both behaviours per device, as MAP_STORES does. For example, a POINTER_AFTER_LHBM=1 (tegu) / 0 (cheetah) value in the runner's case, passed to the bridge as a new option such as ${…:+--lhbm-first} on the spawn bridge line. Cheetah keeps the current order. And a per-device state line, with cheetah keeping the bare on. The new option has a side benefit: the package test from omamobile-fingerprint: the prebuilt bridge must know the runner's options #129 then refuses an old prebuilt bridge. Today it can't, because this PR adds no option (more on that below). Please check that the bridge command line comes out right under set -u with both values.
  • If you think the reorder or the rate also fixes something on the 7 Pro, that's fine too. Then cheetah's state should say @120, and I'll run it on my phone before merging.

Two small things while you're in there (not blocking):

  • Google's panel drivers write a capital On: disp_state_str[DISPLAY_STATE_ON] = "On", then ": %ux%u@%d\n", in both samsung/panel/panel-samsung-drv.c (android-gs-pantah-5.10-android15) and common/gs_panel/gs_panel.c / gs_panel_sysfs.c (android-gs-tegu-6.1-android16). Writing On: … matches what the HAL sees on stock, in case it ever compares the word. The comment's "gs-panel's on: WxH@Hz" could say On too.
  • time is taken before the 120 ms settle, so the PointerContext that onPointerDown now carries is 120 ms old. Taking the time after the settle would match the moment the call is made.
  • A grep or two in test/all for each device's PANEL_HZ, and for the @ in the state line, would keep these per-device values from drifting.

Evidence for the PR (CONTRIBUTING §6.5): please add uname -r from the palmtop run and a tools/phone-smoke report from it. Your comment and #138 have the results; the PR itself has neither.

On my side: the package installs a bridge that I build by hand, and this PR changes only the bridge's code, not its options. So the check from #129 passes even with today's bridge. I confirmed that: the test passes with main's prebuilt, which I rebuilt byte for byte from main's source. Before the next publish after this merges, I'll rebuild the bridge on my laptop and on the build machine, and I'll run the 7 Pro check.

Squash title and version (0.1.11, free on main) look right. CI is green.

… line

Review: the reorder and the rate in the backlight state are the 9a's needs, so both are per device now. The 9a passes --lhbm-first 1 and writes gs_panel's "On: 1080x2424@120"; the 7 Pro keeps pointer down before the circle and its bare "on". The PointerContext time is taken after the settle, and the package test checks each phone's values under set -u.
@W4HO-ham

Copy link
Copy Markdown
Contributor Author

Thanks, all done in ba4d1f2. Both behaviours are now per device, so the 7 Pro stays as it was:

  • Circle order: a new bridge option, --lhbm-first 0|1. The runner's case sets LHBM_FIRST=1 for tegu and 0 for cheetah, and the spawn line always passes --lhbm-first "$LHBM_FIRST". With 0, pointer() is cheetah's old order again: onPointerDown, the circle, the settle, then onUiReady. So omamobile-fingerprint: the prebuilt bridge must know the runner's options #129's check now refuses a prebuilt bridge that doesn't know the option.
  • State line: PANEL_STATE per device. Cheetah keeps its bare on. Tegu writes On: 1080x2424@120, with the capital you found in gs_panel_sysfs.c, and the comment says On too. Cheetah's op_hz stays 60, as before.
  • Time: taken after the settle on the lhbm-first path, so the PointerContext carries the moment of the call.
  • Tests: test/all checks each phone's PANEL_HZ/PANEL_STATE/LHBM_FIRST line, that the spawn line passes the option, and runs each phone's case under bash -u to make sure nothing the spawn line uses is unset.

Evidence from the palmtop, with the bridge and runner built from this head and installed by hand over package 0.1.8 (the bridge with NDK r30 against the image's libbinder_ndk). The bridge command line ends in --panel 1080x2424 --lhbm-first 1, the HAL reads On: 1080x2424@120 from state, and "Failed to parse refresh rate" no longer appears. The match and lock-screen results in my earlier comment came from the build before this one. The tegu behaviour hasn't changed since, apart from the capital O and the timestamp, but I'll re-run a match on this exact build when W4HO is back at the palmtop and post it here.

The failed omamobile-tegu-modem.service below is from tonight's GNSS run (the modem profile, not this package).

phone-smoke: tegu

Kernel 7.3.0-rc6-omamobile-tegu-s2mpg15-m1-g991042e2eff3-dirty, tools at 3387789, 2026-10-29T02:46Z.

Check Result Detail
boot (required) ok kernel 7.3.0-rc6-omamobile-tegu-s2mpg15-m1-g991042e2eff3-dirty, slot b, up 581s
storage guard (required) ok 62 partitions; only userdata and slot B's boot images writable
root (required) ok ext4 on userdata, 21G free
kernel health (required) ok no oops or BUG; 0 WARN, 631 error lines in dmesg
systemd units not ok failed: omamobile-tegu-modem.service
USB gadget (required) ok bound to 11210000.usb
display ok card1-DSI-1 connected, 1080x2424
GPU ok render node on panthor
session (required) ok Hyprland and the Omarchy shell running
lock ok PAM file present, the shell can lock (passwordPam true, locked false)
touch ok Synaptics TouchComm Touchscreen
buttons ok gpio-keys
Wi-Fi ok wlan0 on brcmfmac, link up
Bluetooth ok hci0, powered true
battery ok 88% Unknown, 33 °C
sound cards ok googleteguaocsn
sensors ok Accelerometer AmbientLight Proximity
cameras ok 3 listed by libcamera
thermal ok hottest zone 47 °C

Packages: hyprland 0.56.2-5.1, libcamera 0.7.2-4.22, mesa 1:26.2.4-1.4, omacam 0.3.3-1, omamobile-apps 0.2.0-1, omamobile-audio 0.4.1-1, omamobile-device-tegu 0.1.0-1, omamobile-fingerprint 0.1.8-1, omamobile-firstboot 0.1.0-1, omamobile-gnss 0.2.1-1, omamobile-keyring 20261013-1, omamobile-mirror 0.1.1-1, omamobile-modem 0.1.4-1, omamobile-omarchy 0.1.12-1, omamobile-owl-widgets 0.1.1-1, omamobile-sensors 0.2.1-1, omamobile-shell 0.2.36-1, omarchy 4.0.6-1

@W4HO-ham

Copy link
Copy Markdown
Contributor Author

Morning check on this exact build (the 0.1.11 bridge and runner, omamobile-fp-chroot baebafed on the palmtop, fresh boot): omamobile-fp-ctl auth with the enrolled finger: FINGER DOWN, ACQUIRED 8, MATCH on the second touch (the first touch was too short and gave ACQUIRED 2). With a finger that isn't enrolled: ACQUIRED 8, then ACQUIRED 1 and NOMATCH. So the capture, the circle order and the pixel coordinates hold up after a reboot.

@derekross

Copy link
Copy Markdown
Owner

Thank you, both for the rework and for the morning re-run on the exact build. Keeping the 7 Pro's behaviour behind --lhbm-first and PANEL_STATE is exactly what I was hoping for, and the bash -u check in the test is a nice touch.

I went through each point from my last comment against ba4d1f2:

  • Circle order: with --lhbm-first 0, pointer() makes the same calls in the same order as main: onPointerDown, then the circle, then the settle, then onUiReady. The only cheetah difference is that "FINGER DOWN" now goes to fprintd a moment before the pointer parcel is written, which the HAL never sees.
  • State line and rate: I built the bridge command line from main's runner and from yours, for both phones, with and without OMAMOBILE_FP_LHBM_SETTLE_MS. Cheetah gets main's arguments plus --lhbm-first 0, and still writes 60 to op_hz and a bare on to state. The 9a gets --lhbm-first 1 and On: 1080x2424@120.
  • Touch coordinates: no change on cheetah, as before (its touch range equals the panel's).
  • Timestamp, the capital On, the test greps: all in.
  • Evidence: the smoke report and kernel release from the palmtop are in the thread, and the 13:27 run (MATCH with the enrolled finger, NOMATCH with another, after a reboot) was on this build. The runner's checksum you quoted matches this head's file.

I also built the bridge from this head with the project's Makefile (-Wall -Wextra -Werror, clean). The package test passes with that bridge, and it refuses my current prebuilt with "doesn't know --lhbm-first", which is the guard doing its job.

So this is ready from my side. What happens next is on me:

  1. I'll write the squash message myself, because the description and the first commit still say the reorder and the rate apply to every phone.
  2. Before the next publish I'll rebuild the prebuilt bridge on my laptop and on the build machine. This PR adds a bridge option, so the package won't build there until I do.
  3. With the rebuilt bridge I'll run a verify on my 7 Pro before publishing.

One note for later, nothing to do here: matching on the 9a also depends on the panel change you mentioned (LHBM on tg4c's normal bands), which isn't in a kernel PR yet. Until it is, the 9a's fingerprint status should say it needs that change.

Thanks again. Finding all three causes in the HAL's log and then splitting them cleanly per phone made this easy to review.

@derekross
derekross merged commit e831f6a into derekross:main Oct 29, 2026
2 checks passed
W4HO-ham added a commit to W4HO-ham/omarchy-mobile that referenced this pull request Oct 29, 2026
…ile#138 now

Kernel derekross#135 went up without a sign-off and is replaced by derekross#138 with the same two commits; the parked paragraph links the live one.
robertzas pushed a commit to robertzas/omarchy-mobile that referenced this pull request Nov 14, 2026
… before the capture, the refresh rate the HAL parses (derekross#135)

On the Pixel 9a every authenticate touch came back ACQUIRED_PARTIAL.
The bridge now hands the HAL touch positions in panel pixels (it scaled
them only for its own hit test; no change on the 7 Pro, whose touch
range equals the panel). Two 9a-only settings: --lhbm-first 1 lights
the circle and waits the settle time before onPointerDown, since the
9a's HAL captures there, and the runner writes gs_panel's
"On: 1080x2424@120" to the backlight state, where the HAL parses the
rate. The 7 Pro keeps pointer down before the circle and its bare "on".
Captures on the 9a are GOOD and match the enrolled finger. The bridge
gains an option, so the prebuilt must be rebuilt.

Co-authored-by: W4HO-ham <87742609+W4HO-ham@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants