Closed DupiDachs closed 3 years ago
OK. Already got a step further and simply hardcoded sensIcVersion = 1; to the code.
It is now running and returns somehow sensible values:
So I guess there is still something off with the register that sets the gain. I'll take a look ...
OK so I opened up the build of the driver for your laptop and it seems to be a newer sensor than what the version I originally reversed supported, and I think it's using a different calibration sequence. I'm still reading through it but I might have some new initialization/calibration stuff pushed soon.
I would ask for windows driver logs but the new drivers don't use OutputDebugString
so you can't use something simple like sysinternals debugview to view them, and I'm not sure how to view UMDF 2 TraceMessage
outputs. In theory you can do it with windbg, like how msdn explains it here but I don't have any experience with that, although if you manage to get anything going that route (something containing logs with "FpDeviceInitialize" in them) they'd be useful for understanding the driver.
Thanks for the hint. I'll give that link of yours a try once I have some time again - possibly this weekend. :)
One more info: Ignoring the calibration procedure and allowing a far higher mean_value lets me proceed with taking an image. At least the process runs reliable here. I then ran the python script to get an visual output, changing the size from 96x96 to 80x80 (as indicated by my sensor) in the script. Output is pretty useless, but reproducable. :D
You might think it's useless but that confirms my basic understanding of the capture image code for this sensor is correct. Specifically unlike the other sensors which you request line-by-line, for this one it seems you have to request the entire image at once. Since the current code doesn't know that, it's requesting the entire image for each line and so you get 80 first lines (plus a bunch of junk since you also apparently have to filter 0xff
s from the bytestream)
Alright in theory you should be able to use the new code to capture an image.
Thanks for the input! I did a git pull just now, rebuilt the prototype and ran another test. I found a couple of things:
I'll try later to take a closer look. Thanks again for your efforts!
I should have fixed the missing sensor name in 33e5c9a, but hmm that is interesting. When you hardcoded it did you also have it use the HV version of the calibration code too? What kind of output did it end up giving you?
Yes. It also enters CalibrateHV. Just checked that with a simple printf in there.
Another thing I have found. Linux lists TP_PID = 0x3134; When I am in Windows, I found the following HKLM regedit: // These values come from HKLM\System\CurrentControlSet\Control\ElanFP\OtherSetting\TP_VID,TP_PID // available PIDs: 22FE, 3028, 304D, 3059, 306F, 30B1, 30B2, 3104 You also find 3104 in there, which is the ID for which you have set up an assert. I am not using this PID, but is it actually the right one? On linux, I do not see it.
The PID that the touchpad is reporting shows up in the path in /sys
, and based on what you showed earlier you have it set correctly. Plus, the driver refers to that mode (the reason that I've specifically asserted against that specific touchpad) as "x571_special_parameter", which I assume means the X571 which is not what you have.
Based on those results though CaptureImage doesn't seem to actually be getting new (or even any valid) data at all.
I just re-read the CaptureImage method in the windows driver and it seems like I was missing a "wait for ready" bit thing; I just pushed code that does wait for it so maybe now it will actually have some valid data?
That did not do it unfortunately. :/ I'll keep looking. :)
Anything noticeably different in the output?
Interestingly, the "waiting for image" part never gets printed... Did not see any difference. From time to time, I get now "EMPTY" instead of "UNKNOWN", but I guess that is just passing a different threshold by accident.
Maybe I'm hitting the upper limit on the size of an SPI transfer, some googling says they can only be at most 4096 bytes long by default and I'm doing what the windows driver does which is one huge 16k transfer.
I just pushed some slightly suspicious code that tries to chunk up big transfers into 2048byte segments.
I put this printf statement there and it never gets printed. Nevermind the for loop, played a bit there as well...
Trying your push now...
Actually I just checked the spidev code directly and that push wouldn't bypass the limit (it's applied to the entire ioctl) so I made another one that just uses multiple reads. Based on the fact that it's never seeing any data it probably was never actually doing any transferring and the "image" was just junk on the stack.
Crap. Gotta continue tomorrow - no more time. From what I tried just now it simply proceeds and writes out an image, but it its all zeros. I'll be back...
OK! So, I do not know why the sequential read process in blocks of 0x300 fails, but I managed to get a successful reading by going back to the previous code and setting the kernel parameter spidev.bufsiz=65536! I might reduce that to a value that is actually required... I then get a very clean reading of my finger :) Thanks again for your great work! And btw: Also the calibration is now working.
Cool! I guess the sensor doesn't like it if you deselect it while receiving the image partway through. At some point (bit busy rn) I'll start work on adding the new routines to the libfprint driver.
Just wanted to let you know that with your latest push, I could remove my manual tweaks and have it run successfully without them. I will continue taking a look at your fprint branch...
First of all: Thanks a lot for all the work you have put into this!
I am currently trying to get your prototype running on an ASUS Expertbook B9400. This device has a somewhat different sensor, but is also based on SPI ELAN device.
Hence, I set up 04F3:3134 as VID:PID and the ACPI ID ELAN70A1. Then I built the prototype and ran it:
Speicherzugriffsfehler is German for memory access error. Any ideas on how I might get this working? Maybe I need to somehow follow what you have done in Windows for your ELAN reader chasing logs. Is there any help on how to get me started?