mincrmatt12 / elan-spi-fingerprint

prototype linux driver for elantech spi-based fingerprint sensors
38 stars 4 forks source link

Asus ExpertBook P2451FA skipping because failed to open #4

Closed nguyenhai97 closed 3 years ago

nguyenhai97 commented 3 years ago

I tried to build your prototype but for some reason when runing ./prototype udev it gave me a lot of error about 'skipping because failed to open'. The result come as following

./prototype udev
Prototype starting...
Compiled with HKEY values : TP_VID 4f3; TP_PID 3148; ACPI_ID ELAN7001
Got HID entry /sys/devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2:1.0/0003:046D:C534.0001/hidraw/hidraw0
skipping because failed to open
Got HID entry /sys/devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2:1.1/0003:046D:C534.0002/0003:046D:4054.0003/hidraw/hidraw2
skipping because failed to open
Got HID entry /sys/devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2:1.1/0003:046D:C534.0002/hidraw/hidraw1
skipping because failed to open
Got HID entry /sys/devices/pci0000:00/0000:00:15.1/i2c_designware.1/i2c-1/i2c-ASUE1201:00/0018:04F3:3148.0004/hidraw/hidraw3
skipping because failed to open
Failed to detect SPI or HID!

I don't have much experience about this kind of work so if you need more info then just tell me

Distro: Fedora 34 Beta Kernel: 5.11.11-300.fc34.x86_64

mincrmatt12 commented 3 years ago

It's complaining since it doesn't have permission to open the hidraw interface, try running the prototype as root.

nguyenhai97 commented 3 years ago

It did work, The only problem now is that it failed to detect SPI or HID

Prototype starting...
Compiled with HKEY values : TP_VID 4f3; TP_PID 3148; ACPI_ID ELAN7001
Got HID entry /sys/devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2:1.0/0003:046D:C534.0001/hidraw/hidraw0
Got HID entry /sys/devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2:1.1/0003:046D:C534.0002/0003:046D:4054.0003/hidraw/hidraw2
Got HID entry /sys/devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2:1.1/0003:046D:C534.0002/hidraw/hidraw1
Got HID entry /sys/devices/pci0000:00/0000:00:15.1/i2c_designware.1/i2c-1/i2c-ASUE1201:00/0018:04F3:3148.0004/hidraw/hidraw3
Found TP ID!
Failed to detect SPI or HID!
mincrmatt12 commented 3 years ago

Did you install the udev rules? You should have a device /dev/spidev<something> if they're working.

nguyenhai97 commented 3 years ago

ok it kinda embarrassing now, it start to run alot of ImgCorrection BG now so it seem to work it 14% at the moment, so I guess it will take quite some time to finish

mincrmatt12 commented 3 years ago

It's not a completion percentage, if it gets to there you should be able to put your finger on the sensor and have it stop. Could you attach the output of the prototype up to the line "Taking background image" please? I'll look it over tomorrow when I get some time.

nguyenhai97 commented 3 years ago

OK here is the prototype log my gist. Btw put my finger on the sensor doesn't stop the ImgCorrection BG

mincrmatt12 commented 3 years ago

Please follow the instructions here

nguyenhai97 commented 3 years ago

It did work, thank for your work. Now moving on with the libfprint 😁

mincrmatt12 commented 3 years ago

Right now these sensors aren't working in my libfprint fork, see mincrmatt12/libfprint#1.

nguyenhai97 commented 3 years ago

So could I use DupiDachs folk instead? I just try to build your and it already said something about fail to link FPimage or something like that

mincrmatt12 commented 3 years ago

You can certainly try, I haven't looked at it too closely though. I think their fork isn't correctly rotating the images (or more accurately it's rotating them when it shouldn't be) Currently I'm working on rewriting my version of the driver with some upstream changes and part of that rewrite will be adding support for these newer sensors.

nguyenhai97 commented 3 years ago

Ok I will wait for you new rewrite 😁 btw did you have any info related to elan track point? My laptop have that working with the preinstalled endless os but with newer version that I installed and even fedora, ubuntu it not working at all, xinput not detect it and can't found any problem in dmesg at all, I know this not related to your project but I'm kinda desperate so ☹️

DupiDachs commented 3 years ago

You can use my branch. It works and validates if you swipe your finger over the sensor.

I am still in the process of writing another algorithm based on openCV. With that it should work without swiping...

mincrmatt12 commented 3 years ago

Just FYI, my rewrite is mostly complete and should work with your sensors (it's apparently working for other similar ones, see mincrmatt12/libfprint#1). Try the mincrmatt12/elan-spi-new branch.

nguyenhai97 commented 3 years ago

Did I need to clone the prototype or just build libfprint with drivers=all are enough

mincrmatt12 commented 3 years ago

You only need libfprint with drivers=all (either from my gh or the official libfprint gitlab since I'm there too now) to try it (make sure you're using the mincrmatt12/elan-spi-new branch though)

nguyenhai97 commented 3 years ago

Not sure how output should look like but it doesn't work for me as before (stop at html stuff), here is my commands and build output: https://paste.ee/p/J3fWh

mincrmatt12 commented 3 years ago

That looks like it compiled properly but it failed to build the documentation, just build it again with -D doc=false

nguyenhai97 commented 3 years ago

It did build but still fprint-enroll show Impossible to enroll: GDBus.Error:net.reactivated.Fprint.Error.NoSuchDevice: No devices available, here is my ninja log https://paste.ee/p/l6ryE

nguyenhai97 commented 3 years ago

already add the modprobe and udev rule

mincrmatt12 commented 3 years ago

Do the libfprint examples work? (the things that should be in build/examples/)

nguyenhai97 commented 3 years ago

There are no libfprint in example, there is a libfprint folder, here is all the files in that two folder: https://paste.ee/p/5fP1h

mincrmatt12 commented 3 years ago

Yes, try running enroll then verify. Make sure you swipe your finger across the sensor.

nguyenhai97 commented 3 years ago

it fail to detect the fingerprint: https://paste.ee/p/50mzf

mincrmatt12 commented 3 years ago

You're sure you're on the correct branch (git checkout mincrmatt12/elan-spi-new) and build with -D drivers=all -D doc=false?

nguyenhai97 commented 3 years ago

Sorry for late reply, I'm quite busy at this time. I'm sure that I'm clone the right branch

[ndhai@fedorabox libfprint]$ git branch --show-current 
mincrmatt12/elan-spi-new

and yes, I do build with -D drivers=all -D doc=false

nguyenhai97 commented 3 years ago

I'm even remove the build dir before run meson build -D drivers=all -D doc=false

mincrmatt12 commented 3 years ago

You might need to run the examples as root for it to work.

nguyenhai97 commented 3 years ago

Here is the start of log file: https://paste.ee/p/QfbCo, here is the end of the log file: https://paste.ee/p/bY2KP

nguyenhai97 commented 3 years ago

the between are loop of entering state x x is some integer number, full log are quite long so it hard to copy all that and send it to paste services

mincrmatt12 commented 3 years ago

You have to swipe your finger across the sensor for it to work properly, from your logs it looks like you aren't swiping for long enough (or are doing it too fast for it to register).

nguyenhai97 commented 3 years ago

it seem kinda working? it said wrote scanned image to enrolled.pgm like this: https://paste.ee/p/r2Zuu