2 Commits

Author SHA1 Message Date
buster_dylan
9b5d717788 Improve tap-mode reliability for 04f3:0c6e and similar non-blocking devices
Key changes:
- bz3_threshold: 10 → 2 (better match rate on small swipe sensor frames)
- ELAN_MIN_FRAMES: 4 → 1 (accept single-frame captures rather than discarding)
- ELAN_SKIP_LAST_FRAMES: 2 → 0 (use all captured frames; tap mode has no trailing blurry frames)
- ELAN_FINGER_TIMEOUT: 200 → 350ms (more time to re-detect finger between frames)
- Poll delay on non-blocking devices: 50 → 10ms (faster finger detection response)
- Dark frame: mark_failed → mark_completed (don't abort if a frame is below background)

Together these bring verification match rate from ~50% to ~70% on the ASUS 04f3:0c6e sensor.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-14 21:00:43 +10:00
buster_dylan
9abb7a9334 elan: fix protocol error and calibration for ASUS 04f3:0c6e
Some Elan devices (notably 04f3:0c6e on ASUS laptops) do not implement
the blocking behavior of pre_scan_cmd (0x40 0x3f). Instead of holding
the USB response open until a finger is placed, they return immediately
with a non-0x55 value when no finger is present. The existing driver
treated this as a fatal protocol error.

Fix: jump back to CAPTURE_WAIT_FINGER with a 50ms delay instead of
failing, turning the driver into a polling loop that waits for 0x55
(finger present) before proceeding to capture.

Additional tuning for 04f3:0c6e:
- Increase ELAN_CALIBRATION_ATTEMPTS 10->30 and poll delay 50->100ms
- Lower bz3_threshold 24->10 for single-press image matching
- Lower ELAN_MIN_FRAMES 7->4 for short press/tap captures

Tested on Rocky Linux 10.1 (ASUS laptop, FW 0x0161, sensor 150x52).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-14 20:12:03 +10:00