sailfishos-open / sailfish-fpd-community

Sailfish OS fingerprint support
GNU General Public License v3.0
6 stars 8 forks source link

No communication with daemon after reboot #31

Open calebccff opened 4 years ago

calebccff commented 4 years ago

After rebooting the device for the first time fingerprint will no longer be functional, the daemon outputs the following:

Aug 16 00:11:27 OnePlus6 sailfish-fpd-community[5933]: setActiveGroup to /data/system/users/100000/fpdata
Aug 16 00:11:27 OnePlus6 sailfish-fpd-community[5933]: void FPDCommunity::enumerate()
Aug 16 00:11:27 OnePlus6 sailfish-fpd-community[5933]: void FPDCommunity::setState(FPDCommunity::State) FPDCommunity::State(FPSTATE_ENUMERATING)
Aug 16 00:11:27 OnePlus6 sailfish-fpd-community[5933]: void AndroidFP::enumerate()
Aug 16 00:11:27 OnePlus6 sailfish-fpd-community[5933]: void FPDCommunity::registerDBus()
Aug 16 00:11:27 OnePlus6 sailfish-fpd-community[5933]: Registering service on dbus org.sailfishos.fingerprint1
Aug 16 00:11:27 OnePlus6 sailfish-fpd-community[5933]: Sucessfully registered to dbus systemBus
Aug 16 00:11:27 OnePlus6 sailfish-fpd-community[5933]: QString FPDCommunity::GetState()
Aug 16 00:11:27 OnePlus6 sailfish-fpd-community[5933]: QString FPDCommunity::GetState()
Aug 16 00:11:27 OnePlus6 sailfish-fpd-community[5933]: QStringList FPDCommunity::GetAll()

Deleting /data/system/users/100000/fpdata, deleting the registered fingerprints in UI and rebooting will let me add a finger again:

Aug 16 00:15:52 OnePlus6 sailfish-fpd-community[5913]: void FPDCommunity::loadFingers()
Aug 16 00:15:52 OnePlus6 sailfish-fpd-community[5913]: QList<unsigned int> AndroidFP::fingerprints() const
Aug 16 00:15:52 OnePlus6 sailfish-fpd-community[5913]: Loaded finger  1967826898 "finger1" not found in store, removing
Aug 16 00:15:52 OnePlus6 sailfish-fpd-community[5913]: void FPDCommunity::saveFingers()
Aug 16 00:15:52 OnePlus6 sailfish-fpd-community[5913]: Loaded finger map: QMap()
Aug 16 00:15:52 OnePlus6 sailfish-fpd-community[5913]: void FPDCommunity::setState(FPDCommunity::State) FPDCommunity::State(FPSTATE_IDLE)
Aug 16 00:15:52 OnePlus6 sailfish-fpd-community[5913]: QString FPDCommunity::GetState()
Aug 16 00:15:52 OnePlus6 sailfish-fpd-community[5913]: QString FPDCommunity::GetState()
Aug 16 00:15:52 OnePlus6 sailfish-fpd-community[5913]: QStringList FPDCommunity::GetAll()
Aug 16 00:15:52 OnePlus6 sailfish-fpd-community[5913]: QStringList FPDCommunity::GetAll()
Aug 16 00:16:26 OnePlus6 sailfish-fpd-community[5913]: int FPDCommunity::Enroll(const QString&, const QDBusMessage&) "finger1" ":1.14"
Aug 16 00:16:26 OnePlus6 sailfish-fpd-community[5913]: void FPDCommunity::setState(FPDCommunity::State) FPDCommunity::State(FPSTATE_ENROLLING)
Aug 16 00:16:26 OnePlus6 sailfish-fpd-community[5913]: void AndroidFP::enroll(uid_t) 100000
Aug 16 00:16:28 OnePlus6 sailfish-fpd-community[5913]: static void AndroidFP::acquired_cb(uint64_t, UHardwareBiometryFingerprintAcquiredInfo, int32_t, void*) 0
Aug 16 00:16:28 OnePlus6 sailfish-fpd-community[5913]: void AndroidFP::acquiredCallback(UHardwareBiometryFingerprintAcquiredInfo) 0
Aug 16 00:16:28 OnePlus6 sailfish-fpd-community[5913]: static void AndroidFP::enrollresult_cb(uint64_t, uint32_t, uint32_t, uint32_t, void*) 3596517067 15
Aug 16 00:16:28 OnePlus6 sailfish-fpd-community[5913]: void FPDCommunity::slot_acquired(int) 0
Aug 16 00:16:28 OnePlus6 sailfish-fpd-community[5913]: void AndroidFP::enrollCallback(uint32_t, uint32_t) 3596517067 15
Aug 16 00:16:28 OnePlus6 sailfish-fpd-community[5913]: void FPDCommunity::slot_enrollProgress(float) 0.0625
...

It seems like the settings UI just stops communicating.

calebccff commented 4 years ago

Running dbus-monitor --system "interface=org.sailfishos.fingerprint1" as root on first boot shows pretty normal stuff and matches the daemon log, however after reboot, similarly to the daemon nothing appears (including after first unlock and when trying to add another finger).

It seems like sailfish UI just stops talking to the daemon after first reboot. Perhaps some early initialisation stuff is missing?


Aug 16 00:15:52 OnePlus6 sailfish-fpd-community[5913]: void FPDCommunity::loadFingers()
Aug 16 00:15:52 OnePlus6 sailfish-fpd-community[5913]: QList<unsigned int> AndroidFP::fingerprints() const
Aug 16 00:15:52 OnePlus6 sailfish-fpd-community[5913]: Loaded finger  1967826898 "finger1" not found in store, removing
Aug 16 00:15:52 OnePlus6 sailfish-fpd-community[5913]: void FPDCommunity::saveFingers()```
calebccff commented 4 years ago

I've noticed that after rebooting the daemon will start and try to enumerate with HAL:

Aug 16 20:30:00 OnePlus6 sailfish-fpd-community[8768]: void FPDCommunity::enumerate()
Aug 16 20:30:00 OnePlus6 sailfish-fpd-community[8768]: void FPDCommunity::setState(FPDCommunity::State) FPDCommunity::State(FPSTATE_ENUMERATING)
Aug 16 20:30:00 OnePlus6 sailfish-fpd-community[8768]: void AndroidFP::enumerate()
Aug 16 20:30:00 OnePlus6 sailfish-fpd-community[8768]: void FPDCommunity::registerDBus()

However enumerate_cb is never called. Deleting /data/system/users/100000/fpdata and restarting the daemon will call enumerate_cb to be called:

Aug 16 20:31:15 OnePlus6 sailfish-fpd-community[9192]: void AndroidFP::enumerate()
Aug 16 20:31:15 OnePlus6 sailfish-fpd-community[9192]: void FPDCommunity::registerDBus()
Aug 16 20:31:15 OnePlus6 sailfish-fpd-community[9192]: static void AndroidFP::enumerate_cb(uint64_t, uint32_t, uint32_t, uint32_t, void*) 0 0
Aug 16 20:31:15 OnePlus6 sailfish-fpd-community[9192]: void AndroidFP::enumerateCallback(uint32_t, uint32_t) 0 0
Aug 16 20:31:15 OnePlus6 sailfish-fpd-community[9192]: Registering service on dbus org.sailfishos.fingerprint1
Aug 16 20:31:15 OnePlus6 sailfish-fpd-community[9192]: Sucessfully registered to dbus systemBus
Aug 16 20:31:15 OnePlus6 sailfish-fpd-community[9192]: void FPDCommunity::slot_enumerated()
Aug 16 20:31:15 OnePlus6 sailfish-fpd-community[9192]: void FPDCommunity::loadFingers()

Is this a HAL quirk?

piggz commented 4 years ago

In the official FPD, there is a skip_enumerate_quirk, might be related? https://github.com/mer-hybris/droid-config-sony-ganges-pie/blob/master/sparse/etc/sailfish-fpd/50-settings-ganges.ini

Open to porters to play with the code and PR ;)

calebccff commented 4 years ago

Thanks, I've also messed about with the quirks and skip_enumerate didn't seem to make a difference.

I'll maybe try stubbing the community fpd enumerate method? It seems like userspace isn't community at all with the daemon?

piggz commented 4 years ago

The quirks are not implemented in the community fpd daemon. we need porters with issues, and an eye for coding to try and implement them, by guessing what they do from the names in the offical fpd program.