Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Nagara][PDX224] Fingerprint service fails to initialise due to missing device #796

Open
faenil opened this issue Apr 5, 2023 · 6 comments
Labels

Comments

@faenil
Copy link

faenil commented Apr 5, 2023

Platform: Nagara
Device: pdx224 (Xperia 5 IV)
Kernel version: 5.10 from android-13.0.0_r30 branch (commit: a4a72efafecae951d7faa8e2946bdbc4f2f826bb)
Android version: android-13.0.0_r30, repo-update'd
Software binaries version: 64.0.H.4.18 + SW_binaries_for_Xperia_Android_13_5.10_v1b_nagara.zip

The target is -eng variant

Previously working on
n/a

Description
Fingerprint service fails to initialise and crashes in a loop. Log excerpt below:

02-27 11:28:49.910  1024  1024 F DEBUG   : *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
02-27 11:28:49.910  1024  1024 F DEBUG   : Build fingerprint: 'Sony/aosp_xqcq54/pdx224:13/TQ1A.230205.002/eng.faenil.20230224.001727:eng/test-keys'
02-27 11:28:49.910  1024  1024 F DEBUG   : Revision: '0'
02-27 11:28:49.910  1024  1024 F DEBUG   : ABI: 'arm64'
02-27 11:28:49.910  1024  1024 F DEBUG   : Timestamp: 1970-02-27 11:28:49.904183903+0000
02-27 11:28:49.910  1024  1024 F DEBUG   : Process uptime: 1s
02-27 11:28:49.910  1024  1024 F DEBUG   : Cmdline: /vendor/bin/hw/android.hardware.biometrics.fingerprint@2.1-service.sony
02-27 11:28:49.883   998   998 I dpmd    : type=1400 audit(0.0:661): avc: denied { call } for scontext=u:r:dpmd:s0 tcontext=u:r:diag:s0 tclass=binder permissive=1
02-27 11:28:49.910  1024  1024 F DEBUG   : pid: 980, tid: 980, name: android.hardwar  >>> /vendor/bin/hw/android.hardware.biometrics.fingerprint@2.1-service.sony <<<
02-27 11:28:49.910  1024  1024 F DEBUG   : uid: 1000
02-27 11:28:49.910  1024  1024 F DEBUG   : tagged_addr_ctrl: 0000000000000001 (PR_TAGGED_ADDR_ENABLE)
02-27 11:28:49.910  1024  1024 F DEBUG   : pac_enabled_keys: 000000000000000f (PR_PAC_APIAKEY, PR_PAC_APIBKEY, PR_PAC_APDAKEY, PR_PAC_APDBKEY)
02-27 11:28:49.910  1024  1024 F DEBUG   : signal 6 (SIGABRT), code -1 (SI_QUEUE), fault addr --------
02-27 11:28:49.910  1024  1024 F DEBUG   : Abort message: 'terminating with uncaught exception of type 15FormatException: Failed to open fingerprint device! fd=-1, strerror=No such file or directory'
02-27 11:28:49.910  1024  1024 F DEBUG   :     x0  0000000000000000  x1  00000000000003d4  x2  0000000000000006  x3  0000007ff3e6e1b0
02-27 11:28:49.910  1024  1024 F DEBUG   :     x4  736f646277641f73  x5  736f646277641f73  x6  736f646277641f73  x7  7f7f7f7f7f7f7f7f
02-27 11:28:49.912   985   985 E cnss-daemon: NL group_id 13, cnss_nl.family_id 35
02-27 11:28:49.918  1035  1035 I ueventd : firmware: loading 'adsp.b08' for '/devices/platform/soc/3000000.remoteproc-adsp/firmware/adsp.b08'
02-27 11:28:49.921  1024  1024 F DEBUG   :     x8  00000000000000f0  x9  000000715dbc19e0  x10 0000000000000001  x11 000000715dbffb14
02-27 11:28:49.921  1024  1024 F DEBUG   :     x12 000000003b9ac9ff  x13 000000007fffffff  x14 0000000000000d36  x15 0000000014316b74
02-27 11:28:49.921  1024  1024 F DEBUG   :     x16 000000715dc63d50  x17 000000715dc419a0  x18 0000007161522000  x19 00000000000003d4
02-27 11:28:49.922  1024  1024 F DEBUG   :     x20 00000000000003d4  x21 00000000ffffffff  x22 0000007ff3e6e2e0  x23 ffffff80ffffffc8
02-27 11:28:49.922  1024  1024 F DEBUG   :     x24 000000715dc65f70  x25 0000000000000000  x26 0000000000000000  x27 0000000000000000
02-27 11:28:49.922  1024  1024 F DEBUG   :     x28 0000000000000000  x29 0000007ff3e6e230
02-27 11:28:49.922  1024  1024 F DEBUG   :     lr  000000715dbf1718  sp  0000007ff3e6e190  pc  000000715dbf1744  pst 0000000000001000
02-27 11:28:49.922  1024  1024 F DEBUG   : backtrace:
02-27 11:28:49.922  1024  1024 F DEBUG   :       #00 pc 0000000000051744  /apex/com.android.runtime/lib64/bionic/libc.so (abort+164) (BuildId: a233a8c1a23ee63f36f4b138880288f3)
02-27 11:28:49.922  1024  1024 F DEBUG   :       #01 pc 000000000004910c  /apex/com.android.vndk.v33/lib64/libc++.so (abort_message+248) (BuildId: a5247afe9d3506dcb8946ad5a5671997)
02-27 11:28:49.922  1024  1024 F DEBUG   :       #02 pc 00000000000492bc  /apex/com.android.vndk.v33/lib64/libc++.so (demangling_terminate_handler()+208) (BuildId: a5247afe9d3506dcb8946ad5a5671997)
02-27 11:28:49.922  1024  1024 F DEBUG   :       #03 pc 0000000000049e30  /apex/com.android.vndk.v33/lib64/libc++.so (std::__terminate(void (*)())+12) (BuildId: a5247afe9d3506dcb8946ad5a5671997)
02-27 11:28:49.922  1024  1024 F DEBUG   :       #04 pc 00000000000494cc  /apex/com.android.vndk.v33/lib64/libc++.so (__cxxabiv1::failed_throw(__cxxabiv1::__cxa_exception*)+28) (BuildId: a5247afe9d3506dcb8946ad5a5671997)
02-27 11:28:49.922  1024  1024 F DEBUG   :       #05 pc 0000000000049438  /apex/com.android.vndk.v33/lib64/libc++.so (__cxa_throw+116) (BuildId: a5247afe9d3506dcb8946ad5a5671997)
02-27 11:28:49.922  1024  1024 F DEBUG   :       #06 pc 000000000000a030  /vendor/bin/hw/android.hardware.biometrics.fingerprint@2.1-service.sony (egistec::EgisFpDevice::EgisFpDevice()+136) (BuildId: cebea304e7b75ad4ee78df949234d912)
02-27 11:28:49.922  1024  1024 F DEBUG   :       #07 pc 000000000000ee48  /vendor/bin/hw/android.hardware.biometrics.fingerprint@2.1-service.sony (main+44) (BuildId: cebea304e7b75ad4ee78df949234d912)
02-27 11:28:49.922  1024  1024 F DEBUG   :       #08 pc 000000000004a064  /apex/com.android.runtime/lib64/bionic/libc.so (__libc_init+96) (BuildId: a233a8c1a23ee63f36f4b138880288f3)

Symptoms
The device overheats while it keeps trying to start fingerprint service (and other crashing services)

How to reproduce
Build the kernel via the build-clang-shared.sh script (prebuilt kernel for this device is not yet released)
Build and flash the OS image.
Boot the device.
Wait for a few minutes and notice the temperature increase.

Additional context
first_logcat_5Apr.zip

@faenil faenil added the bug label Apr 5, 2023
@MarijnS95
Copy link
Contributor

Failed to open fingerprint device! fd=-1, strerror=No such file or directory

Alin asked me to port the fingerprint on the kernel side (and then perform the usual validation suite in userspace) before definitively releasing this, but I've been hampered by unstable devices. Fortunately you just caught and fixed the biggest derailer in #795 and I have a long weekend coming up, will test and push the port on Friday!

@faenil
Copy link
Author

faenil commented Apr 5, 2023

amazing, thanks for the update, I will skip and focus on something else then 🚀

@faenil faenil changed the title [Nagara][PDX224] Fingerprint service fails to initialise [Nagara][PDX224] Fingerprint service fails to initialise due to missing device Apr 5, 2023
@MarijnS95
Copy link
Contributor

Turns out Nagara isn't as easy to port, it has been a few platforms since that happened. I still have to refactor more parts of the HAL but the basics are there to support the new DMA-BUF heap API over ION (and after some digging, there's a helper library I'll use instead of manually doing the switcheroo):

https://github.com/MarijnS95/vendor-sony-oss-fingerprint/commits/dma-heap

Then for the kernel side the IRQ pin remains high and the hardware always returns ID 0, probably missing some setup or doing the setup (most likely resets) wrong. When flipping IRQ polarity the scanner gets all the way into enroll (because the HAL isn't deathlooping itself on some inexistant Finger event) but then never raises the IRQ when a finger is presented as if the HW is dormant. I strongly doubt it'd get this far if it doesn't touch the memory so something - likely the TZapp itself - is alive and pretending the HW is too.

Here's the kernel part, but be careful with it:

https://github.com/MarijnS95/kernel/commits/nagara-egistec

I'll do some more digging through the downstream kernel driver later in hopes of uncovering its dirty secrets.

@flightmansam
Copy link

flightmansam commented Jul 9, 2023

@MarijnS95 Did you ever find the solution to this?

@MarijnS95
Copy link
Contributor

MarijnS95 commented Jul 11, 2023

@flightmansam I've been away for a while and haven't yet had an opportunity to figure out what should be changed in the HAL to support this new sensor. The DMAbufheap changes have already been finished and merged though.

@flightmansam
Copy link

Thanks so much!

I am hankering to build AOSP/LineageOS for my XQ-CQ72.

Best,

Sam

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants