0001 .. include:: <isonum.txt>
0002
0003 =========================
0004 N-Trig touchscreen Driver
0005 =========================
0006
0007 :Copyright: |copy| 2008-2010 Rafi Rubin <rafi@seas.upenn.edu>
0008 :Copyright: |copy| 2009-2010 Stephane Chatty
0009
0010 This driver provides support for N-Trig pen and multi-touch sensors. Single
0011 and multi-touch events are translated to the appropriate protocols for
0012 the hid and input systems. Pen events are sufficiently hid compliant and
0013 are left to the hid core. The driver also provides additional filtering
0014 and utility functions accessible with sysfs and module parameters.
0015
0016 This driver has been reported to work properly with multiple N-Trig devices
0017 attached.
0018
0019
0020 Parameters
0021 ----------
0022
0023 Note: values set at load time are global and will apply to all applicable
0024 devices. Adjusting parameters with sysfs will override the load time values,
0025 but only for that one device.
0026
0027 The following parameters are used to configure filters to reduce noise:
0028
0029 +-----------------------+-----------------------------------------------------+
0030 |activate_slack |number of fingers to ignore before processing events |
0031 +-----------------------+-----------------------------------------------------+
0032 |activation_height, |size threshold to activate immediately |
0033 |activation_width | |
0034 +-----------------------+-----------------------------------------------------+
0035 |min_height, |size threshold below which fingers are ignored |
0036 |min_width |both to decide activation and during activity |
0037 +-----------------------+-----------------------------------------------------+
0038 |deactivate_slack |the number of "no contact" frames to ignore before |
0039 | |propagating the end of activity events |
0040 +-----------------------+-----------------------------------------------------+
0041
0042 When the last finger is removed from the device, it sends a number of empty
0043 frames. By holding off on deactivation for a few frames we can tolerate false
0044 erroneous disconnects, where the sensor may mistakenly not detect a finger that
0045 is still present. Thus deactivate_slack addresses problems where a users might
0046 see breaks in lines during drawing, or drop an object during a long drag.
0047
0048
0049 Additional sysfs items
0050 ----------------------
0051
0052 These nodes just provide easy access to the ranges reported by the device.
0053
0054 +-----------------------+-----------------------------------------------------+
0055 |sensor_logical_height, | the range for positions reported during activity |
0056 |sensor_logical_width | |
0057 +-----------------------+-----------------------------------------------------+
0058 |sensor_physical_height,| internal ranges not used for normal events but |
0059 |sensor_physical_width | useful for tuning |
0060 +-----------------------+-----------------------------------------------------+
0061
0062 All N-Trig devices with product id of 1 report events in the ranges of
0063
0064 * X: 0-9600
0065 * Y: 0-7200
0066
0067 However not all of these devices have the same physical dimensions. Most
0068 seem to be 12" sensors (Dell Latitude XT and XT2 and the HP TX2), and
0069 at least one model (Dell Studio 17) has a 17" sensor. The ratio of physical
0070 to logical sizes is used to adjust the size based filter parameters.
0071
0072
0073 Filtering
0074 ---------
0075
0076 With the release of the early multi-touch firmwares it became increasingly
0077 obvious that these sensors were prone to erroneous events. Users reported
0078 seeing both inappropriately dropped contact and ghosts, contacts reported
0079 where no finger was actually touching the screen.
0080
0081 Deactivation slack helps prevent dropped contact for single touch use, but does
0082 not address the problem of dropping one of more contacts while other contacts
0083 are still active. Drops in the multi-touch context require additional
0084 processing and should be handled in tandem with tacking.
0085
0086 As observed ghost contacts are similar to actual use of the sensor, but they
0087 seem to have different profiles. Ghost activity typically shows up as small
0088 short lived touches. As such, I assume that the longer the continuous stream
0089 of events the more likely those events are from a real contact, and that the
0090 larger the size of each contact the more likely it is real. Balancing the
0091 goals of preventing ghosts and accepting real events quickly (to minimize
0092 user observable latency), the filter accumulates confidence for incoming
0093 events until it hits thresholds and begins propagating. In the interest in
0094 minimizing stored state as well as the cost of operations to make a decision,
0095 I've kept that decision simple.
0096
0097 Time is measured in terms of the number of fingers reported, not frames since
0098 the probability of multiple simultaneous ghosts is expected to drop off
0099 dramatically with increasing numbers. Rather than accumulate weight as a
0100 function of size, I just use it as a binary threshold. A sufficiently large
0101 contact immediately overrides the waiting period and leads to activation.
0102
0103 Setting the activation size thresholds to large values will result in deciding
0104 primarily on activation slack. If you see longer lived ghosts, turning up the
0105 activation slack while reducing the size thresholds may suffice to eliminate
0106 the ghosts while keeping the screen quite responsive to firm taps.
0107
0108 Contacts continue to be filtered with min_height and min_width even after
0109 the initial activation filter is satisfied. The intent is to provide
0110 a mechanism for filtering out ghosts in the form of an extra finger while
0111 you actually are using the screen. In practice this sort of ghost has
0112 been far less problematic or relatively rare and I've left the defaults
0113 set to 0 for both parameters, effectively turning off that filter.
0114
0115 I don't know what the optimal values are for these filters. If the defaults
0116 don't work for you, please play with the parameters. If you do find other
0117 values more comfortable, I would appreciate feedback.
0118
0119 The calibration of these devices does drift over time. If ghosts or contact
0120 dropping worsen and interfere with the normal usage of your device, try
0121 recalibrating it.
0122
0123
0124 Calibration
0125 -----------
0126
0127 The N-Trig windows tools provide calibration and testing routines. Also an
0128 unofficial unsupported set of user space tools including a calibrator is
0129 available at:
0130 http://code.launchpad.net/~rafi-seas/+junk/ntrig_calib
0131
0132
0133 Tracking
0134 --------
0135
0136 As of yet, all tested N-Trig firmwares do not track fingers. When multiple
0137 contacts are active they seem to be sorted primarily by Y position.