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:   android-tslib

Labels:

9 Comments:

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

thank you ^^

 
At August 2, 2011 at 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 at 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 at 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 at 8:31 PM , Blogger Aaron said...

What android device were you using? A phone?

 
At February 24, 2012 at 6:44 PM , Blogger monimi said...

Hi, i have been trying to compile the tslib for android, but i get an error with dlclose, dlsym, dlopen, i'm stuck in here, i don't know what else to do, apparently the android.mk is fine, is the one that comes with the tslib, i modifyed the variables and the LOCAL_MODULE_TAGS, i don't know what to do to solve the problem.

 
At November 24, 2012 at 5:02 PM , Blogger Joe said...

Hi,

when I try to build Android with tslib I get this error:

build/core/base_rules.mk:166: *** external/bluetooth/bluez/input: MODULE.TARGET.SHARED_LIBRARIES.input already defined by external/android-tslib.

Can you please help me?

 
At November 24, 2012 at 5:03 PM , Blogger Joe said...

Hi,

when I try to compile Android with tslib I get this error:

build/core/base_rules.mk:166: *** external/bluetooth/bluez/input: MODULE.TARGET.SHARED_LIBRARIES.input already defined by external/android-tslib.

Can you please help me?

 
At February 27, 2013 at 3:42 PM , Blogger Sunil Kumar said...

Hi,

I'm not able to get tslib working with Anroid Honeycomb. I'm able to compile all without any issues, and also included the requied ts.conf file.
However when i try "ts_calibrate" i'm seeing
Failed to open settings file: No such file or directory
trying configured TSDEVICE '/dev/input/event0'
Failed to open settings file: No such file or directory

And after this nothing happens atall

 

Post a Comment

Subscribe to Post Comments [Atom]

<< Home