Hi Sergio,

Awesome work !!
Got the patch working on my HP dv6 notebook having the VFS101 sensor.

Two issues:
o.      on my sensor, the img_screen() function was always returning
        image height = 1. I added a fp_dbg() call to dump the values 
        in the loop variables to figure out what was going on.
        The 'break' statement in the 'find bottom of image' part
        is not correct since it aborts the screening prematurely.
        Due to this break, the screened image height always ended up = 1
        in my case.

        This happens even during the enrollment phase.
        I have the logs dumped - let me know if you want to take a look at them.

o.      during verification, if I end up just touching the sensor and lifting 
the 
        finger, I get a message 'Unexpected finger find, remove finger from 
sensor'.
        But, it goes into an infinite loop with the same msg since the device's 
        bufffer still contains the old image data. The device buffer needs to be
        flushed upon any such error conditions.

I'm attaching a patch on top of your code that tries to fix both the problems.
Please let me know if it looks OK.

Thanks,
Kunal

On Friday 25 Feb 2011 2:19:23 pm Sergio Cerlesi wrote:
> Hi all,
> 
> i finish to write the driver fo Validity VFS101. I use it for a couple
> of day with good result.
> 
> For verify the implementation i need tester. If i receive positive
> feedback i will work to merge it into library.
> 
> Attached the patch for libfprint 0.3.0. To compile it run:
> 
> autoreconf && ./configure && make
> 
> Important: the match score is much variable (on my experience from 10 to
> 100) so, to have a good chance to match the fingerprint, it's much
> important who scan is done. I use fprint_demo to find the best way to
> scan my finger.
> 
> Waiting feedback.
> 
> Bye
> Sergio
> 

--- libfprint/drivers/vfs101.c.orig	2011-02-26 23:49:12.000000000 +0530
+++ libfprint/drivers/vfs101.c	2011-02-27 16:10:28.000000000 +0530
@@ -683,6 +683,9 @@
 		level = vdev->buffer[offset(283, y)] * 256 +
 			vdev->buffer[offset(282, y)];
 
+		fp_dbg("m_sc_l: %d, top: %d, lvl: %d, last_line: %d, y: %d",
+				VFS_IMG_MIN_SCAN_LEVEL, vdev->top, level, last_line, y);
+
 		if (level >= VFS_IMG_MIN_SCAN_LEVEL && vdev->top == last_line)
 			/* Found top fingerprint line */
 			vdev->top = y;
@@ -690,7 +693,7 @@
 		{
 			/* Found bottom fingerprint line */
 			vdev->bottom = y + 1;
-			break;
+			// break;
 		}
 	}
 
@@ -842,6 +845,8 @@
 	M_LOOP_GET_STATE3,
 	M_LOOP_LOAD_IMAGE3,
 	M_LOOP_EXRACT_IMAGE,
+	M_LOOP_FLUSH_DEVICE_BUFFER1,
+	M_LOOP_FLUSH_DEVICE_BUFFER2,
 	M_LOOP_CHECK_ACTION,
 	M_LOOP_NUM_STATES,
 };
@@ -874,7 +879,7 @@
 			/* The user should remove their finger from the scanner */
 			fp_warn("Unexpected finger find, remove finger from the scanner");
 			fpi_imgdev_session_error(dev, result_code(dev, RESULT_RETRY_REMOVE));
-			fpi_ssm_next_state(ssm);
+			fpi_ssm_jump_to_state(ssm, M_LOOP_FLUSH_DEVICE_BUFFER1);
 		}
 		else
 			/* Finger not present, continue */
@@ -984,6 +989,17 @@
 		async_recv(ssm);
 		break;
 
+	case M_LOOP_FLUSH_DEVICE_BUFFER1:
+		/* Flush the device buffer */
+		vdev->ignore_error = TRUE;
+		vfs_get_print(ssm, VFS_IMG_MAX_HEIGHT, 1);
+		break;
+
+	case M_LOOP_FLUSH_DEVICE_BUFFER2:
+		memset(vdev->buffer, 0, VFS_IMG_MAX_SIZE);
+		fpi_ssm_next_state(ssm);
+		break;
+
 	case M_LOOP_CHECK_ACTION:
 		/* Check if action is completed */
 		if (!action_completed(dev))
@@ -1122,7 +1138,7 @@
 	if (!ssm->error && vdev->active)
 	{
 		/* Start loop ssm */
-		ssm_loop = fpi_ssm_new(dev->dev, m_loop_state,M_LOOP_NUM_STATES);
+		ssm_loop = fpi_ssm_new(dev->dev, m_loop_state, M_LOOP_NUM_STATES);
 		ssm_loop->priv = dev;
 		fpi_ssm_start(ssm_loop, m_loop_complete);
 	}
@@ -1152,7 +1168,7 @@
 	vdev->enroll_stage = 0;
 
 	/* Start init ssm */
-	ssm = fpi_ssm_new(dev->dev, m_init_state,M_INIT_NUM_STATES);
+	ssm = fpi_ssm_new(dev->dev, m_init_state, M_INIT_NUM_STATES);
 	ssm->priv = dev;
 	fpi_ssm_start(ssm, m_init_complete);
 
_______________________________________________
fprint mailing list
[email protected]
http://lists.reactivated.net/mailman/listinfo/fprint

Reply via email to