hysteresis enabled by wobble detection unnecessarily
Summary
During normal laptop use, hysteresis is always sooner or later (minutes rather than days) turned on by wobble detection and since then, the touchpad is imprecise (as described in https://bugs.freedesktop.org/show_bug.cgi?id=98839).
Steps to reproduce
$ sudo ./libinput-debug-events --verbose /dev/input/event1
- move finger vertically
- sooner or later,
event1 - hysteresis enabled.
appears
The output around this happening looks like this:
event1 POINTER_MOTION +16.90s -0.23/ 0.92 ( -1.00/ +3.91)
event1 POINTER_MOTION +16.91s 0.00/ 1.22 ( +0.00/ +5.22)
event1 POINTER_MOTION +16.92s 0.23/ 1.53 ( +1.00/ +6.52)
event1 POINTER_MOTION +16.93s -0.23/ 1.53 ( -1.00/ +6.52)
event1 POINTER_MOTION +16.95s 0.23/ 1.53 ( +1.00/ +6.52)
event1 - hysteresis enabled. See https://wayland.freedesktop.org/libinput/doc/latest/touchpad-jitter.html for details
event1 POINTER_MOTION +16.97s -2.81/ 2.29 (-12.00/ +9.78)
event1 POINTER_MOTION +16.98s 0.70/ 0.76 ( +3.00/ +3.26)
event1 POINTER_MOTION +16.99s 0.70/ 1.53 ( +3.00/ +6.52)
event1 POINTER_MOTION +17.01s 0.47/ 1.37 ( +2.00/ +5.87)
Note that this touchpad has absolutely no jitter when holding a finger still even before hysteresis is turned on -- I can confirm this by running libinput-debug-events
. There's not a single movement between two button state:
events if I hold the finger still. There is also no fuzz in the kernel:
$ sudo ./libinput-measure-fuzz
Using SynPS/2 Synaptics TouchPad: /dev/input/event1
Checking udev property... not set
Checking axes... is zero
$ sudo udevadm info -e | grep -i -c fuzz
0
I'm convinced this means the hysteresis is done in touchpad firmware and I am very happy with it: I've been running for more than a year with wobble detection commented out and it just works: the touchpad reacts precisely to any little movement and there's no wobble ever.
I also tried playing a bit with the wobble detection, incresing the number of right-left-rights that need to happen for hysteresis to kick in.
static const char r_l_r = 0x15; /* {Right, Left, Right, Left, Right} */
t->hysteresis.x_motion_history |= (1 << 4);
^^ with this I could enable it by moving the finger vertically in a few seconds.
static const char r_l_r = 0x55; /* {Right, Left, Right, Left, Right, Left, Right} */
t->hysteresis.x_motion_history |= (1 << 6);
^^ this was harder, but I could still do it within a minute.
I'm sure I'd hit this sooner or later within my X uptime, and since there's no way to turn it off (sans attaching gdb to X), I'd be a very sad man afterwards. Therefore I think the wobble detection needs to be made somewhat smarter, perhaps taking both axes into account. As I don't happen to have any wobbling touchpad around, I'm not sure I can help much further. :-(
Alternatively, I'd be just as happy with adding a quirk or udev rule that tells libinput not to ever enable hysteresis. But I understand that you'd rather have me build my own libinput package than introduce a configuration parameter, and I can accept that — I don't really mind running a patched version of libinput on our laptops but I think this issue hits many other ThinkPads out there. It's probably less pronounced than it used to be in the days of the linked bugzilla thanks to 6936a155 and ea7498ef, but I perceive the inability to precisely make one-pixel movements/scrolls a bug.
libinput version you encountered the bug on
$ git describe --tags
1.13.0-57-gcac9d537
and all other versions of libinput since e8dffbd7 was merged.
Hardware information:
ThinkPad T25
dmi:bvnLENOVO:bvrN1QET79W(1.54):bd11/16/2018:svnLENOVO:pn20K70000GE:pvrThinkPad25:rvnLENOVO:rn20K70000GE:rvrNotDefined:cvnLENOVO:ct10:cvrNone:
P: /devices/platform/i8042/serio1/input/input2/event1
N: input/event1
L: 0
S: input/by-path/platform-i8042-serio-1-event-mouse
E: DEVPATH=/devices/platform/i8042/serio1/input/input2/event1
E: SUBSYSTEM=input
E: DEVNAME=/dev/input/event1
E: MAJOR=13
E: MINOR=65
E: USEC_INITIALIZED=18924531
E: ID_INPUT=1
E: ID_INPUT_TOUCHPAD=1
E: ID_INPUT_WIDTH_MM=98
E: ID_INPUT_HEIGHT_MM=53
E: ID_BUS=i8042
E: ID_SERIAL=noserial
E: ID_PATH=platform-i8042-serio-1
E: ID_PATH_TAG=platform-i8042-serio-1
E: ID_INPUT_TOUCHPAD_INTEGRATION=internal
E: LIBINPUT_DEVICE_GROUP=11/2/7:isa0060/serio1
E: DEVLINKS=/dev/input/by-path/platform-i8042-serio-1-event-mouse
We have the exact same problem on my wife's ThinkPad T440p but as mentioned in https://bugs.freedesktop.org/show_bug.cgi?id=98839#c71, the touchpad firmware that came with the laptop did wobble for a second until its hysteresis kicked in and we had to update the firmware. Since then, she's running libinput with commented out wobble-detection and it works brilliantly.
Other log output:
-
libinput record
output: libinput-record.txt -
libinput debug-events --verbose
output: libinput-debug-events.txt