touchscreen: ts_test results vary after reboots

Summary: After a successful ts_calibration and ts_test, ts_test shows varying results after reboots.

I am connecting a beaglebone black to a 16 bpp, 4 wire touchscreen/LCD. The lcd is working beautifully, but I am having an issue with the touchscreen. I am connecting AIN0-3 directly to the up, down, left, and right pins of the touchscreen via breadboard and breakoutboard.

I can boot up a 3.8 RCN kernel with a custom device tree overlay (and also a modified 3.2 kernel), I can run ts_calibrate and ts_test and get perfect results.

The problem occurs on reboots, sometimes the results of ts_test are near perfect, sometimes they are off by a small but significant amount, sometimes it is way off. On a reboot when ts_test is off, if I run ts_calibrate then the results of ts_test are right on the mark.

I haven’t been able to make heads or tails of this, whether to focus an hardware or software.

Looking at the touch signals with a scope there is a small amount of noise that seems to increase in frequency as more is displayed on the LCD. However the calibration never seems to change once the board is booted so I do not believe that the noise is at the root of my issue.

/etc/ts.conf contains

module_raw input
module pthres pmin=1
module variance delta=30
module dejitter delta=100
module linear

I’m exporting the following before running any ts_* utils:

export TSLIB_CONFFILE=/etc/ts.conf
export TSLIB_CALIBFILE=/etc/pointercal
export TSLIB_TSDEVICE=/dev/input/event1
export TSLIB_FBDEVICE=/dev/fb0
#export TSLIB_PLUGINDIR=/usr/lib/ts
export TSLIB_PLUGINDIR=/usr/lib/arm-linux-gnueabihf/ts0

I have a debian rootfs and I’ve installed tslibs via apt-get, but I’ve also cross compiled tslibs-1.0 and tslibs-1.1 from:

With the same results.

Any ideas/suggestions would be greatly appreciated.


can you explain me how did you manage to make the tslib work ? because I’ve done the samething :

sudo apt-get install libts-bin

/etc/ts.conf contains

module_raw input
module pthres pmin=1
module variance delta=30
module dejitter delta=100
module linear

I had the same problem with a debian rootfs, when using:
sudo ts_calibrate

I worked around it by setting a root password, then su to root, set the environmental variables, and then running ts_calibrate as root.
I haven’t gotten around to finding a proper solution, but this should be one way to get around the problem.

Thx for the quick answer, it was perfect.