# fprint-asus: libfprint patches for ASUS 04f3:0c6e fingerprint sensor Patches for the Elan fingerprint sensor found in ASUS laptops (`04f3:0c6e`, FW 0x0161, 150x52 swipe sensor). ## Problem The device does not implement the blocking behavior of `pre_scan_cmd` (command `0x40 0x3f`). Instead of holding the USB response open until a finger is placed, it returns immediately with a non-0x55 value when no finger is present. The upstream `elan` driver treats this as a fatal protocol error (`FP_DEVICE_ERROR_PROTO`), causing every enrollment attempt to immediately fail with `enroll-disconnected`. ## Patches applied to `libfprint/drivers/elan.c` and `elan.h` | Change | Reason | |---|---| | `CAPTURE_READ_DATA`: retry instead of PROTO error | Device returns immediately with non-0x55 when no finger; retry until 0x55 | | `ELAN_CALIBRATION_ATTEMPTS`: 10 → 30 | Give device more time to recalibrate between swipe stages | | Calibration poll delay: 50ms → 100ms | Device needs ~100ms per calibration cycle | | `bz3_threshold`: 24 → 10 | Accommodate smaller single-press images | | `ELAN_MIN_FRAMES`: 7 → 4 | Allow short press/tap captures | ## Building and installing ```bash # Dependencies (Rocky/RHEL 10) sudo dnf install git meson ninja-build gcc gcc-c++ glib2-devel libgusb-devel nss-devel pixman-devel gobject-introspection-devel # Clone upstream libfprint and apply patches git clone --depth=1 https://gitlab.freedesktop.org/libfprint/libfprint.git cp libfprint/drivers/elan.c libfprint/drivers/elan.h libfprint/libfprint/drivers/ cd libfprint meson setup _build --prefix=/usr --buildtype=release ninja -C _build sudo systemctl stop fprintd sudo ninja -C _build install sudo systemctl start fprintd ``` ## Usage ```bash fprintd-enroll # enroll a finger (slow press/swipe) fprintd-verify $USER # test verification ``` Tested on Rocky Linux 10.1 with ASUS laptop.