1.. _touchpad_jitter: 2 3============================================================================== 4Touchpad jitter 5============================================================================== 6 7Touchpad jitter describes random movement by a few pixels even when the 8user's finger is unmoving. 9 10libinput has a mechanism called a **hysteresis** to avoid that jitter. When 11active, movement with in the **hysteresis margin** is discarded. If the 12movement delta is larger than the margin, the movement is passed on as 13pointer movement. This is a simplified summary, developers should 14read the implementation of the hysteresis in ``src/evdev.c``. 15 16libinput uses the kernel ``fuzz`` value to determine the size of the 17hysteresis. Users should override this with a udev hwdb entry where the 18device itself does not provide the correct value. 19 20.. _touchpad_jitter_fuzz_override: 21 22------------------------------------------------------------------------------ 23Overriding the hysteresis margins 24------------------------------------------------------------------------------ 25 26libinput provides the debugging tool ``libinput measure fuzz`` to help edit or 27test a fuzz value. This tool is interactive and provides a udev hwdb entry 28that matches the device. To check if a fuzz is currently present, simply run 29without 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 40In the above output, the axis fuzz is set to 16. To set a specific fuzz, run 41with the ``--fuzz=<value>`` argument. 42 43 44:: 45 46 $ sudo libinput measure fuzz --fuzz=8 47 48 49The tool will attempt to construct a hwdb file that matches your touchpad 50device. Follow the printed prompts. 51 52In the ideal case, the tool will provide you with a file that can be 53submitted to the systemd repo for inclusion. 54 55However, hwdb entry creation is difficult to automate and it's likely 56that the tools fails in doing so, especially if an existing entry is already 57present. 58 59Below is the outline of what a user needs to do to override a device's fuzz 60value in case the ``libinput measure fuzz`` tool fails. 61 62Check with ``udevadm info /sys/class/input/eventX`` (replace your device node 63number) whether an existing hwdb override exists. If the ``EVDEV_ABS_`` 64properties are present, the hwdb override exists. Find the file that 65contains that entry, most likely in ``/etc/udev/hwdb.d`` or 66``/usr/lib/udev/hwdb.d``. 67 68The 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, 70leaving the remainder of the property as-is. Values may be empty, e.g. a 71property that only sets resolution and fuzz reads as ``EVDEV_ABS_00=::32:8``. 72 73If 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 84Substitute 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 88Once 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 92Restart the host and libinput should pick up the revised fuzz values. 93 94.. _kernel_fuzz: 95 96------------------------------------------------------------------------------ 97Kernel fuzz 98------------------------------------------------------------------------------ 99 100A fuzz set on an absolute axis in the kernel causes the kernel to apply 101hysteresis-like behavior to the axis. Unfortunately, this behavior leads to 102inconsistent deltas. To avoid this, libinput sets the kernel fuzz on the 103device to 0 to disable this kernel behavior but remembers what the fuzz was 104on startup. The fuzz is stored in the ``LIBINPUT_FUZZ_XX`` udev property, on 105startup libinput will check that property as well as the axis itself. 106