ntrig.txt 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. N-Trig touchscreen Driver
  2. -------------------------
  3. Copyright (c) 2008-2010 Rafi Rubin <rafi@seas.upenn.edu>
  4. Copyright (c) 2009-2010 Stephane Chatty
  5. This driver provides support for N-Trig pen and multi-touch sensors. Single
  6. and multi-touch events are translated to the appropriate protocols for
  7. the hid and input systems. Pen events are sufficiently hid compliant and
  8. are left to the hid core. The driver also provides additional filtering
  9. and utility functions accessible with sysfs and module parameters.
  10. This driver has been reported to work properly with multiple N-Trig devices
  11. attached.
  12. Parameters
  13. ----------
  14. Note: values set at load time are global and will apply to all applicable
  15. devices. Adjusting parameters with sysfs will override the load time values,
  16. but only for that one device.
  17. The following parameters are used to configure filters to reduce noise:
  18. activate_slack number of fingers to ignore before processing events
  19. activation_height size threshold to activate immediately
  20. activation_width
  21. min_height size threshold bellow which fingers are ignored
  22. min_width both to decide activation and during activity
  23. deactivate_slack the number of "no contact" frames to ignore before
  24. propagating the end of activity events
  25. When the last finger is removed from the device, it sends a number of empty
  26. frames. By holding off on deactivation for a few frames we can tolerate false
  27. erroneous disconnects, where the sensor may mistakenly not detect a finger that
  28. is still present. Thus deactivate_slack addresses problems where a users might
  29. see breaks in lines during drawing, or drop an object during a long drag.
  30. Additional sysfs items
  31. ----------------------
  32. These nodes just provide easy access to the ranges reported by the device.
  33. sensor_logical_height the range for positions reported during activity
  34. sensor_logical_width
  35. sensor_physical_height internal ranges not used for normal events but
  36. sensor_physical_width useful for tuning
  37. All N-Trig devices with product id of 1 report events in the ranges of
  38. X: 0-9600
  39. Y: 0-7200
  40. However not all of these devices have the same physical dimensions. Most
  41. seem to be 12" sensors (Dell Latitude XT and XT2 and the HP TX2), and
  42. at least one model (Dell Studio 17) has a 17" sensor. The ratio of physical
  43. to logical sizes is used to adjust the size based filter parameters.
  44. Filtering
  45. ---------
  46. With the release of the early multi-touch firmwares it became increasingly
  47. obvious that these sensors were prone to erroneous events. Users reported
  48. seeing both inappropriately dropped contact and ghosts, contacts reported
  49. where no finger was actually touching the screen.
  50. Deactivation slack helps prevent dropped contact for single touch use, but does
  51. not address the problem of dropping one of more contacts while other contacts
  52. are still active. Drops in the multi-touch context require additional
  53. processing and should be handled in tandem with tacking.
  54. As observed ghost contacts are similar to actual use of the sensor, but they
  55. seem to have different profiles. Ghost activity typically shows up as small
  56. short lived touches. As such, I assume that the longer the continuous stream
  57. of events the more likely those events are from a real contact, and that the
  58. larger the size of each contact the more likely it is real. Balancing the
  59. goals of preventing ghosts and accepting real events quickly (to minimize
  60. user observable latency), the filter accumulates confidence for incoming
  61. events until it hits thresholds and begins propagating. In the interest in
  62. minimizing stored state as well as the cost of operations to make a decision,
  63. I've kept that decision simple.
  64. Time is measured in terms of the number of fingers reported, not frames since
  65. the probability of multiple simultaneous ghosts is expected to drop off
  66. dramatically with increasing numbers. Rather than accumulate weight as a
  67. function of size, I just use it as a binary threshold. A sufficiently large
  68. contact immediately overrides the waiting period and leads to activation.
  69. Setting the activation size thresholds to large values will result in deciding
  70. primarily on activation slack. If you see longer lived ghosts, turning up the
  71. activation slack while reducing the size thresholds may suffice to eliminate
  72. the ghosts while keeping the screen quite responsive to firm taps.
  73. Contacts continue to be filtered with min_height and min_width even after
  74. the initial activation filter is satisfied. The intent is to provide
  75. a mechanism for filtering out ghosts in the form of an extra finger while
  76. you actually are using the screen. In practice this sort of ghost has
  77. been far less problematic or relatively rare and I've left the defaults
  78. set to 0 for both parameters, effectively turning off that filter.
  79. I don't know what the optimal values are for these filters. If the defaults
  80. don't work for you, please play with the parameters. If you do find other
  81. values more comfortable, I would appreciate feedback.
  82. The calibration of these devices does drift over time. If ghosts or contact
  83. dropping worsen and interfere with the normal usage of your device, try
  84. recalibrating it.
  85. Calibration
  86. -----------
  87. The N-Trig windows tools provide calibration and testing routines. Also an
  88. unofficial unsupported set of user space tools including a calibrator is
  89. available at:
  90. http://code.launchpad.net/~rafi-seas/+junk/ntrig_calib
  91. Tracking
  92. --------
  93. As of yet, all tested N-Trig firmwares do not track fingers. When multiple
  94. contacts are active they seem to be sorted primarily by Y position.