LinuxConsulting

- Nicu Pavel personal page

PaNiC Random Rant (or how we used to call it: .plan)


TSLib ported to Android for touchscreen calibration.


     Since Android doesn't provide a calibration tool, tslib can be used to calibrate the touchscreen . The values obtained from ts_calibrate in pointercal file can be used in android frameworks/services/java/com/android/server/InputDevice.java to have the correct screen coordinates.

ts_calibrate can be run from a serial console along with android with the proper environment variables set (these variables are documented in Android.mk too), the default values are:



export TSLIB_TSDEVICE=/dev/input/event1
export TSLIB_CONFFILE=/system/etc/ts.conf
export TSLIB_CALIBFILE=/etc/pointercal
export TSLIB_PLUGINDIR=/system/lib
export TSLIB_CONSOLEDEVICE=/dev/tty
export TSLIB_FBDEVICE=/dev/graphics/fb0


To compile tslib for your device make a link for bionic/libc/include/fcntl.h to bionic/libc/include/sys/fcntl.h import build/envsetup.sh and execute make or m.

To make tslib build everytime you build your android distribution copy the android-tslib folder to android external/ folder.

Download:
GIT:   git clone git://git.linuxconsulting.ro/android-tslib.git
HTTP: http://git.linuxconsulting.ro

Labels:

5 Comments:

At December 20, 2010 3:41 AM , Blogger phking said...

thank you ^^

 
At August 2, 2011 9:04 PM , Blogger CloudHackIX said...

Thank you SO much! I've been struggling for several days now trying to figure out why my touchscreen wasn't working under Android. Works like a charm now!

 
At October 22, 2011 1:03 AM , Blogger Sarav said...

Thanks for the post. Could you tell me how to use the pointercal values in inputdevice.java? I am not quite aware of what the values from pointercal file means. There is no good documentation on that.

 
At October 26, 2011 5:56 PM , Blogger panic said...

@Sarav see the patch below:

https://gitorious.org/picopc-android-eclair/frameworks-base/commit/326606175898417d709da3a5958bd0a2696534e5

 
At January 6, 2012 8:31 PM , Blogger Aaron said...

What android device were you using? A phone?

 

Post a Comment

Subscribe to Post Comments [Atom]

<< Home