Mcetool source code

I suspect double tap to wake feature implementation is within mcetool, but can’t find it’s source code.
Any help?

Mcetool source code is here: https://github.com/sailfishos/mce/blob/master/tools/mcetool.c

Check tagged versions to find the version you have on your device.

4 Likes

More like: First you need to have a device that has double tap support in touch panel and related kernel drivers. Then it is possible to use mcetool for controlling some aspects of whether/how/when double tap support is enabled / used.

1 Like

I have PinePhone which apparently has the feature in hw, but I can’t find how it can even work since the touch driver doesn’t seem send any Gesture mode commands over I2C:

What I’d expect to see is roughly: suspend/resume hooks that toggle panel to DOZE mode and back ON, has irq/work handler that differentiates between doze (gesture data from i2c) and on (touch data from i2c). But at least on a quick glance this driver seems to do complete panel power off on suspend releasing irqs etc, and handles / emits only touch events (and possibly those on screen android home/menu/back keys) when reading i2c data i.e. no signs of double tap support.

Still, people in different medias claim the actual support…
Here user got wake on double tap even after hours of sleep:

All these are very confused, because I can’t get it work here (still I have old PP revision with hw bug, not sure if it’s related)

Yesterday I flashed a bunch of Plasma based Images and I can confirm that sometimes, you could get the impression of a double-tap-to-wake, but it’s inconsistent and If the panel is driven the way @spiiroin explained (the code suggests it and I fear he is correct), what we experience in Plasma mobile is likely a bug. The driver needs to be enhanced like explained above to properly support this.

So you saying what was perceived as double-tap-to-wake, is actually happened when the phone was awaken for some reason? I don’t see other explanation of that behavior…

One possible explanation comes to mind: When display is off or lpm/glance ui is on screen, mce “owns” touch input. If mce sees touch input sequence that looks like double tap under such conditions, a “fake double tap” event is generated internally. Normally this is useful only for waking up from lpm, but it can/will also happen if the display is not actually powered down (i.e. display is dark, but touch events are still emitted).

I couldn’t put it better. That’s completely unsatisfactory, I know. It feels like Plasma was only blanking the screen, not really switching off the touchscreen. And indeed, tapping /dev/input/eventX (with appropriate X) will reveal that this feature is actually done in software, not by the driver, but by the UI. The touchscreen is “awake” all the time. That’s not an ideal solution.

I found alternative Goodix driver that claims the Gesture (Doze) mode support:

Hope it fits. Tests are welcome

If you think the driver above might fit, any ideas where to put the info on the Wiki maybe, to give it broader audience?

I put it to the Pine forum:
https://forum.pine64.org/showthread.php?tid=15255