1
0

touchpad-jitter.rst 4.0 KB

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