1. Environment Variables
To run tslib correctly, you need to configure the following tslib environment variables:
Tslib_tsdevice // The Name Of The touch screen device.
Default (no inputapi):/dev/touchscreen/ucb1x00
Default (inputapi):/dev/input/event0
Tslib_calibfile // The calibration data file, which is generated by the ts_calibrate calibration program.
Default: $ {sysconfdir}/pointercal
Tslib_conffile // configure the file name.
Default: $ {sysconfdir}/ts. conf
Tslib_plugindir // plug-in Directory
Default: $ {datadir}/plugins
Tslib_consoledevice // console device file name
Default:/dev/tty
Tslib_fbdevice // device name
Default:/dev/fb0
The actual configuration of the preceding environment variables in actual development can be determined based on the actual situation.
2. Configuration File
In addition to environment variables, the tslib configuration file ts. conf is also a very important part in ts. in Conf, the plug-in to be loaded, the plug-in loading sequence, and some constraint parameters of the plug-in are configured. These configuration parameters have a very important impact on the touch effect of the touch screen.
The following is the reference configuration of TS. conf in tslib 1.4: (tslib 13.3 can use its default configuration file to complete general functions. I did not change it in practice)
# Uncomment if you wish to use the Linux input layer event Interface
# Module_raw Input
# Uncomment if you're using a sharp zaurus SL-5500/SL-5000d
# Module_raw Collie
# Uncomment if you're using a sharp zaurus SL-C700/c750/c760/c860
# Module_raw Corgi
# Uncomment if you're using a device with a ucb1200/1300/1400 ts Interface
# Module_raw ucb1x00
# Uncomment if you're using an HP ipaq h3600 or similar
# Module_raw h3600
# Uncomment if you're using a Hitachi webpad
# Module_raw mk712
# Uncomment if you're using an IBM Arctic II
# Module_raw arctic2
Module pthres pmin = 1
Module variance Delta = 30
Module dejitter Delta = 100
Module linear
Among them, pthres is the touch screen sensitivity threshold plug-in provided by tslib; variance is the touch screen filtering algorithm plug-in provided by tslib; dejitter is the touch screen Noise Removal Algorithm plug-in provided by tslib; linear is the touch screen Coordinate Transformation plug-in provided by tslib.
In qtopia, touch screen debugging involves the following three parts: Touch Screen driver, tslib, and qtslibtpanelhandlerprivate encapsulation.
The Touch Screen driver is directly in contact with the hardware and provides the original device coordinate data for the tslib on the upper layer. The sampling interval and screen sensitivity can be configured. The sampling interval determines the number of samples collected per unit time. If other parameters remain unchanged, the smaller the sampling interval means the more samples per unit time, this means that the more realistic the sampling, the less likely the sampling information is to be lost, such as the loss of strokes when writing the input method. However, due to the noise, the smaller the sampling interval, the worse the displayed image.
Tslib is the Adaptation Layer Between the touch screen driver and the application layer. It obtains the original device coordinate data from the driver, through a series of operations such as noise reduction, deshake, and coordinate transformation, to remove noise and convert the original device coordinates to the corresponding screen coordinates.
In tslib, two main interfaces ts_read () and ts_read_raw () are provided for the application layer. ts_read () is an excuse for normal use, and ts_read_raw () is an interface for calibration.
Under normal circumstances, tslib processes the device coordinates sampled by the driver as follows:
Raw device --> variance --> dejitter --> linear --> Application
Module module Module
In the case of calibration, tslib processes the data sampled by the driver as follows:
Raw device --> calibrate
Qtslibtpanelhandlerprivate provides the application layer encapsulation for tslib, which is the interface between tslib and the application layer.
During touch screen debugging, the parameters involved mainly include sampling interval (driving), sensitivity (driving), denoising algorithm and constraint (tslib), deshake algorithm and constraint (tslib) and ts threshold value (tslib ).
Due to the impact of various related periods, related parameters may need to be adjusted on different hardware platforms. The relationship between the preceding parameters is as follows: the larger the sampling interval, the smaller the sampling points, and the more distorted the sampling. However, because of the small amount of information, loss of information such as stroke loss may occur, however, the image performance will be better. The de-noise algorithm should interact closely with the sampling interval. The larger the sampling interval, the smaller the de-noise constraint, and the smaller the sampling interval, the greater the noise reduction constraint. The deshake algorithm is a relatively independent part. The more complicated the deshake algorithm is, the more computation workload it brings, and the heavier the system load. However, a good deshake algorithm can better remove jitter, it will get better results during graphic painting. The sensitivity and TS threshold values are sensitivity indicators of the touch screen, which generally do not need to be changed. Refer to the reference value.
**************************************
Here to talk about tslib-1.4, and 1.3 Have a little different, mainly is the configuration file difference (this copy of the master, put this just want us to see more understand)
In general, the tsllib-1.4 is a complete ts. conf configuration file as follows:
Module_raw Input
Module pthres
Module variance Delta = 30
Module dejitter Delta = 100
Module linear
This error occurs.
Couldnt load module Input
No raw modules loaded
Tsconfig: Success
The first line tells tslib to read data from the Linux input device. The input module is used, that is, the input. So file in the plugin directory,
Therefore, you must configure tslib_plugindir correctly so that tslib can find the module File.
Other parameters control the continuous download, variation width, trajectory change, and linear calibration of the touch point.
Also, copy the required library files to/tslib/plugins.
The second line causes "no raw modules loaded." for two reasons:
Note: first, module_raw is not specified in your Ts. conf file. All module_raw values of the built-in ts. conf file are commented out,
# Uncomment if you wish to use the Linux input layer event Interface
# Module_raw Input
# Uncomment if you're using a sharp zaurus SL-5500/SL-5000d
# Module_raw Collie
# Uncomment if you're using a sharp zaurus SL-C700/c750/c760/c860
# Module_raw Corgi
# Uncomment if you're using a device with a ucb1200/1300/1400 ts Interface
# Module_raw ucb1x00
# Uncomment if you're using an HP ipaq h3600 or similar
# Module_raw h3600
# Uncomment if you're using a Hitachi webpad
# Module_raw mk712
# Uncomment if you're using an IBM Arctic II
# Module_raw arctic2
You should open at least one module_raw option, and someone selects input and removes its comment.
Obtain module_raw input.
Another reason is that you have not correctly configured tslib_plugindir. tslib does not find the module File required for plugin from the directory you specified,
Check your path and file.