Hello Igor,
On 2018-01-15 17:38, Igor Filatov wrote:
I don't quite understand what happens though. You've replaced a number
of stages by plain image read commands (CALIBRATE, CAPTURE_START,
DEACTIVATE) which don't seem to do anything but read and discard the
image. Maybe it's fine to not do anything at all at those phases? My
scanner needed to "scan the air" a few times for calibration and such
reads always follow other specific commands (0x4023, 0x4024). Did you
try to just skip the reads instead?
It is working when we skip the "scan the air" read command. Nevertheless
the binary driver abuses the read: there must be a good reason? Do you
think we can avoid calibrate_states?
Do 0903 and 0c03 have leds? If they do, how do you turn them on and
off?
- No LED for 04f3:0903. Device is integrated with the trackpad.
See here :
https://dlcdnimgs.asus.com/websites/global/products/jlHvIhXRAPm1WpRr/V1/images/main/response.png
- I don't know for 04f3:0c03. Konata?
- BUT i have a good news: it seems 0x0b working. The bugframesup30.diff
bug misled me (this is a _must_ patch)
Also the orientation. IIRC 0903 is square. Do you swipe the finger on
it? Square sensors could cause problems because it's impossible to
know how they are oriented relatively to the user. Stitching of frames
could fail if the assumptions in the driver are wrong.
I tried examples / img_capture this morning. The orientation is good for
04f3:0903.
Konata, can you try for 04f3:0c03?
Igor, do you think i can try to adapt POC to orginal driver? What is the
best solution?
What do you think about this patch? Last problem for me is
ELAN_FRAME_MARGIN
Bye
diff --git a/libfprint/drivers/elan.c b/libfprint/drivers/elan.c
index 976ce07..617c525 100644
--- a/libfprint/drivers/elan.c
+++ b/libfprint/drivers/elan.c
@@ -348,8 +348,12 @@ static void elan_capture_run_state(struct fpi_ssm *ssm)
switch (ssm->cur_state) {
case CAPTURE_START:
- elan_run_cmds(ssm, capture_start_cmds, capture_start_cmds_len,
- ELAN_CMD_TIMEOUT);
+ /* hardware version 3 */
+ if ((ssm->dev->drv->id_table->product & 0x0F) == 3)
+ fpi_ssm_next_state(ssm);
+ else
+ elan_run_cmds(ssm, capture_start_cmds, capture_start_cmds_len,
+ ELAN_CMD_TIMEOUT);
break;
case CAPTURE_WAIT_FINGER:
elan_run_cmds(ssm, capture_wait_finger_cmds,
@@ -371,6 +375,8 @@ static void elan_capture_run_state(struct fpi_ssm *ssm)
/* quickly stop if finger is removed */
elandev->cmd_timeout = ELAN_FINGER_TIMEOUT;
fpi_ssm_jump_to_state(ssm, CAPTURE_WAIT_FINGER);
+ } else {
+ fpi_ssm_next_state(ssm);
}
break;
}
@@ -447,8 +453,12 @@ static void elan_calibrate_run_state(struct fpi_ssm *ssm)
switch (ssm->cur_state) {
case CALIBRATE_START_1:
case CALIBRATE_START_2:
- elan_run_cmds(ssm, calibrate_start_cmds,
- calibrate_start_cmds_len, ELAN_CMD_TIMEOUT);
+ /* hardware version 3 */
+ if ((ssm->dev->drv->id_table->product & 0x0F) == 3)
+ fpi_ssm_next_state(ssm);
+ else
+ elan_run_cmds(ssm, calibrate_start_cmds,
+ calibrate_start_cmds_len, ELAN_CMD_TIMEOUT);
break;
case CALIBRATE_READ_DATA_1:
case CALIBRATE_READ_DATA_2:
@@ -456,8 +466,12 @@ static void elan_calibrate_run_state(struct fpi_ssm *ssm)
break;
case CALIBRATE_END_1:
case CALIBRATE_END_2:
- elan_run_cmds(ssm, calibrate_end_cmds, calibrate_end_cmds_len,
- ELAN_CMD_TIMEOUT);
+ /* hardware version 3 */
+ if ((ssm->dev->drv->id_table->product & 0x0F) == 3)
+ fpi_ssm_next_state(ssm);
+ else
+ elan_run_cmds(ssm, calibrate_end_cmds, calibrate_end_cmds_len,
+ ELAN_CMD_TIMEOUT);
}
}
@@ -519,15 +533,23 @@ static void elan_activate_run_state(struct fpi_ssm *ssm)
fpi_ssm_next_state(ssm);
break;
case ACTIVATE_START:
- elan_run_cmds(ssm, init_start_cmds, init_start_cmds_len,
- ELAN_CMD_TIMEOUT);
+ /* hardware version 3 */
+ if ((ssm->dev->drv->id_table->product & 0x0F) == 3)
+ fpi_ssm_next_state(ssm);
+ else
+ elan_run_cmds(ssm, init_start_cmds, init_start_cmds_len,
+ ELAN_CMD_TIMEOUT);
break;
case ACTIVATE_READ_DATA:
elan_run_cmds(ssm, read_cmds, read_cmds_len, ELAN_CMD_TIMEOUT);
break;
case ACTIVATE_END:
- elan_run_cmds(ssm, init_end_cmds, init_end_cmds_len,
- ELAN_CMD_TIMEOUT);
+ /* hardware version 3 */
+ if ((ssm->dev->drv->id_table->product & 0x0F) == 3)
+ fpi_ssm_next_state(ssm);
+ else
+ elan_run_cmds(ssm, init_end_cmds, init_end_cmds_len,
+ ELAN_CMD_TIMEOUT);
}
}
@@ -607,6 +629,8 @@ static void dev_deactivate(struct fp_img_dev *dev)
}
static const struct usb_id id_table[] = {
+ {.vendor = 0x04f3,.product = 0x0903},
+ {.vendor = 0x04f3,.product = 0x0c03},
{.vendor = 0x04f3,.product = 0x0907},
{0, 0, 0,},
};
diff --git a/libfprint/drivers/elan.h b/libfprint/drivers/elan.h
index 1b47dbc..5acdc43 100644
--- a/libfprint/drivers/elan.h
+++ b/libfprint/drivers/elan.h
@@ -26,7 +26,7 @@
/* number of pixels to discard on left and right (along raw image height)
* because they have different intensity from the rest of the frame */
-#define ELAN_FRAME_MARGIN 12
+#define ELAN_FRAME_MARGIN 0
/* min and max frames in a capture */
#define ELAN_MIN_FRAMES 7
@@ -79,7 +79,7 @@ static const struct elan_cmd init_start_cmds[] = {
static const size_t init_start_cmds_len = array_n_elements(init_start_cmds);
static const struct elan_cmd read_cmds[] = {
- /* raw frame sizes are calculated from image dimesions reported by the
+ /* raw frame sizes are calculated from image dimensions reported by the
* device */
{
.cmd = {0x00, 0x09},
_______________________________________________
fprint mailing list
fprint@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/fprint