Discussion:
[Thinkfinger-devel] A little workaround
Yann Le Brech
2007-05-14 08:33:39 UTC
Permalink
Hello there,

After a bit of testing to get my fingerprint reader working under Linux, and
after testing the UPEK stuff that didn't work, Ichoose to test your sotware.
Installation was successful, great. But, when I was acquiering, the three
swipes were OK, but not saving. It was complaining about reading from USB
(wanted 0x40 bytes, got only 0x24). I tried to change the code to let it
read 0x24 bytes only, but next usb_write was not working and --verify
neither. After a bit of testing and patching, I saw that the 0x24 bytes I
read and the first 0x24 bytes of the next 0x40 bytes chunk were the same !
So I got a workaround for this problem, and here it is, in libthinkfinger.c,
_libthinkfinger_store_fingerprint :

len = ((data[5] & 0x0f) << 8) + data[6] - 0x37;
usb_retval = _libthinkfinger_usb_read (tf, inbuf, 0x24); // I first
read 0x24 bytes
usb_retval = _libthinkfinger_usb_read (tf, inbuf, len); // Then
whatever it wants
if (usb_retval != len)

I don't know why it works, I don't know why I need this patch, but all I can
say is : it works fine here :-)

If you need some more debugging info, let me know. I'm using a Toshiba
Satellite Pro U200-134, and a Linux 2.6.19 kernel.

T: Bus=03 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#= 2 Spd=12 MxCh= 0
D: Ver= 1.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS= 8 #Cfgs= 1
P: Vendor=0483 ProdID=2016 Rev= 0.01
S: Manufacturer=STMicroelectronics
S: Product=Biometric Coprocessor
C:* #Ifs= 1 Cfg#= 1 Atr=a0 MxPwr=100mA
I: If#= 0 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=(none)
E: Ad=81(I) Atr=02(Bulk) MxPS= 64 Ivl=0ms
E: Ad=02(O) Atr=02(Bulk) MxPS= 64 Ivl=0ms
E: Ad=83(I) Atr=03(Int.) MxPS= 4 Ivl=20ms

Hope this helps...
--
a++
Y.
Yann Le Brech
2007-05-14 08:49:34 UTC
Permalink
And after a while, it looks like the value 0x24 can change (I had 0xc,
0x20...) and some other errors too. I'm hacking again, but sometimes it
works... At least if I can acquire my fingerprint, the verifying always
work, so that good :)
Post by Yann Le Brech
Hello there,
After a bit of testing to get my fingerprint reader working under Linux,
and after testing the UPEK stuff that didn't work, Ichoose to test your
sotware. Installation was successful, great. But, when I was acquiering, the
three swipes were OK, but not saving. It was complaining about reading from
USB (wanted 0x40 bytes, got only 0x24). I tried to change the code to let it
read 0x24 bytes only, but next usb_write was not working and --verify
neither. After a bit of testing and patching, I saw that the 0x24 bytes I
read and the first 0x24 bytes of the next 0x40 bytes chunk were the same !
So I got a workaround for this problem, and here it is, in
len = ((data[5] & 0x0f) << 8) + data[6] - 0x37;
usb_retval = _libthinkfinger_usb_read (tf, inbuf, 0x24); // I
first read 0x24 bytes
usb_retval = _libthinkfinger_usb_read (tf, inbuf, len); // Then
whatever it wants
if (usb_retval != len)
I don't know why it works, I don't know why I need this patch, but all I
can say is : it works fine here :-)
If you need some more debugging info, let me know. I'm using a Toshiba
Satellite Pro U200-134, and a Linux 2.6.19 kernel.
T: Bus=03 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#= 2 Spd=12 MxCh= 0
D: Ver= 1.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS= 8 #Cfgs= 1
P: Vendor=0483 ProdID=2016 Rev= 0.01
S: Manufacturer=STMicroelectronics
S: Product=Biometric Coprocessor
C:* #Ifs= 1 Cfg#= 1 Atr=a0 MxPwr=100mA
I: If#= 0 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=(none)
E: Ad=81(I) Atr=02(Bulk) MxPS= 64 Ivl=0ms
E: Ad=02(O) Atr=02(Bulk) MxPS= 64 Ivl=0ms
E: Ad=83(I) Atr=03(Int.) MxPS= 4 Ivl=20ms
Hope this helps...
--
a++
Y.
--
a++
Y.
Timo Hoenig
2007-06-11 10:39:58 UTC
Permalink
Post by Yann Le Brech
And after a while, it looks like the value 0x24 can change (I had 0xc,
0x20...) and some other errors too. I'm hacking again, but sometimes
it works... At least if I can acquire my fingerprint, the verifying
always work, so that good :)
We can probably predict how many bytes we have to read by the previous
answers of the scanner. Again, this will need some investigation.

Thanks,

Timo

Timo Hoenig
2007-06-11 10:38:58 UTC
Permalink
Hi Yann,

Sorry for the lag.
Post by Yann Le Brech
After a bit of testing to get my fingerprint reader working under
Linux, and after testing the UPEK stuff that didn't work, Ichoose to
test your sotware. Installation was successful, great. But, when I was
acquiering, the three swipes were OK, but not saving. It was
complaining about reading from USB (wanted 0x40 bytes, got only 0x24).
I tried to change the code to let it read 0x24 bytes only, but next
usb_write was not working and --verify neither. After a bit of testing
and patching, I saw that the 0x24 bytes I read and the first 0x24
bytes of the next 0x40 bytes chunk were the same ! So I got a
workaround for this problem, and here it is, in libthinkfinger.c ,
len = ((data[5] & 0x0f) << 8) + data[6] - 0x37;
usb_retval = _libthinkfinger_usb_read (tf, inbuf, 0x24); // I
first read 0x24 bytes
usb_retval = _libthinkfinger_usb_read (tf, inbuf, len); //
Then whatever it wants
if (usb_retval != len)
I don't know why it works, I don't know why I need this patch, but all
I can say is : it works fine here :-)
Those are interesting findings. I'll investigate in order to understand
the different behavior.

Thanks,

Timo
Loading...