From 1ce6db6e2cf9f93d12286153394908b6a92a4f05 Mon Sep 17 00:00:00 2001 From: buster_dylan Date: Wed, 15 Apr 2026 00:15:28 +1000 Subject: [PATCH] Skip active recalibration for unreliable devices MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ELAN_CALIBRATION_MAX_DELTA raised to 65535 to prevent the recalibration state machine from running on devices like 04f3:0c6e where the 0x01→0x03 status transition is intermittently absent, causing frequent 'Calibration failed!' session errors. The background image is still re-captured fresh on each activation — we just skip the active recalibration handshake. Also bumps ELAN_CALIBRATION_ATTEMPTS to 100 as a safety net for devices that do support the full calibration sequence. Co-Authored-By: Claude Sonnet 4.6 --- libfprint/drivers/elan.h | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/libfprint/drivers/elan.h b/libfprint/drivers/elan.h index c2f9a66..0aac905 100644 --- a/libfprint/drivers/elan.h +++ b/libfprint/drivers/elan.h @@ -39,12 +39,15 @@ #define ELAN_MIN_CALIBRATION_FW 0x0138 /* max difference between background image mean and calibration mean - * (the response value of get_calib_mean_cmd)*/ -#define ELAN_CALIBRATION_MAX_DELTA 500 + * (the response value of get_calib_mean_cmd). + * Set very high to skip active recalibration — background is always + * re-captured at activation, and the recalibration handshake is + * unreliable on some devices (e.g. 04f3:0c6e). */ +#define ELAN_CALIBRATION_MAX_DELTA 65535 /* times to retry reading calibration status during one session * generally prevents calibration from looping indefinitely */ -#define ELAN_CALIBRATION_ATTEMPTS 30 +#define ELAN_CALIBRATION_ATTEMPTS 100 /* min and max frames in a capture */ #define ELAN_MIN_FRAMES 1