Debian Codegraph @

doc/user/touchpad-jitter.rst

raw
1 .. _touchpad_jitter:
2
3 ==============================================================================
4 Touchpad jitter
5 ==============================================================================
6
7 Touchpad jitter describes random movement by a few pixels even when the
8 user's finger is unmoving.
9
10 libinput has a mechanism called a **hysteresis** to avoid that jitter. When
11 active, movement with in the **hysteresis margin** is discarded. If the
12 movement delta is larger than the margin, the movement is passed on as
13 pointer movement. This is a simplified summary, developers should
14 read the implementation of the hysteresis in ``src/evdev.c``.
15
16 libinput uses the kernel ``fuzz`` value to determine the size of the
17 hysteresis. Users should override this with a udev hwdb entry where the
18 device itself does not provide the correct value.
19
20 .. _touchpad_jitter_fuzz_override:
21
22 ------------------------------------------------------------------------------
23 Overriding the hysteresis margins
24 ------------------------------------------------------------------------------
25
26 libinput provides the debugging tool ``libinput measure fuzz`` to help edit or
27 test a fuzz value. This tool is interactive and provides a udev hwdb entry
28 that matches the device. To check if a fuzz is currently present, simply run
29 without arguments or with the touchpad's device node:
30
31
32 ::
33
34 $ sudo libinput measure fuzz
35 Using Synaptics TM2668-002: /dev/input/event17
36 Checking udev property... not set
37 Checking axes... x=16 y=16
38
39
40 In the above output, the axis fuzz is set to 16. To set a specific fuzz, run
41 with the ``--fuzz=<value>`` argument.
42
43
44 ::
45
46 $ sudo libinput measure fuzz --fuzz=8
47
48
49 The tool will attempt to construct a hwdb file that matches your touchpad
50 device. Follow the printed prompts.
51
52 In the ideal case, the tool will provide you with a file that can be
53 submitted to the systemd repo for inclusion.
54
55 However, hwdb entry creation is difficult to automate and it's likely
56 that the tools fails in doing so, especially if an existing entry is already
57 present.
58
59 Below is the outline of what a user needs to do to override a device's fuzz
60 value in case the ``libinput measure fuzz`` tool fails.
61
62 Check with ``udevadm info /sys/class/input/eventX`` (replace your device node
63 number) whether an existing hwdb override exists. If the ``EVDEV_ABS_``
64 properties are present, the hwdb override exists. Find the file that
65 contains that entry, most likely in ``/etc/udev/hwdb.d`` or
66 ``/usr/lib/udev/hwdb.d``.
67
68 The content of the property is a set of values in the format
69 ``EVDEV_ABS_00=min:max:resolution:fuzz``. You need to set the ``fuzz`` part,
70 leaving the remainder of the property as-is. Values may be empty, e.g. a
71 property that only sets resolution and fuzz reads as ``EVDEV_ABS_00=::32:8``.
72
73 If no properties exist, your hwdb.entry should look approximately like this:
74
75 ::
76
77 evdev:name:Synaptics TM2668-002:dmi:*:svnLENOVO*:pvrThinkPadT440s*:
78 EVDEV_ABS_00=:::8
79 EVDEV_ABS_01=:::8
80 EVDEV_ABS_35=:::8
81 EVDEV_ABS_36=:::8
82
83
84 Substitute the ``name`` field with the device name (see the output of
85 ``libinput measure fuzz`` and the DMI match content with your hardware. See
86 :ref:`hwdb_modifying` for details.
87
88 Once the hwdb entry has been modified, added, or created,
89 :ref:`reload the hwdb <hwdb_reloading>`. Once reloaded, :ref:`libinput-record`
90 "libinput record" should show the new fuzz value for the axes.
91
92 Restart the host and libinput should pick up the revised fuzz values.
93
94 .. _kernel_fuzz:
95
96 ------------------------------------------------------------------------------
97 Kernel fuzz
98 ------------------------------------------------------------------------------
99
100 A fuzz set on an absolute axis in the kernel causes the kernel to apply
101 hysteresis-like behavior to the axis. Unfortunately, this behavior leads to
102 inconsistent deltas. To avoid this, libinput sets the kernel fuzz on the
103 device to 0 to disable this kernel behavior but remembers what the fuzz was
104 on startup. The fuzz is stored in the ``LIBINPUT_FUZZ_XX`` udev property, on
105 startup libinput will check that property as well as the axis itself.