A13-LCD7TS support in Linux


Image

A13-LCD7TS 7″ LCD with Touchscreen works perfect under Android, but the normal Debian image we have didn’t support it.

You can see some discussion on our forum about it: https://www.olimex.com/forum/index.php?topic=444.0 part of the problem is that touchscreen driver is not registered as such in the linux kernel. This could be fixed relatively easy by adding the info written on the forum, so now you can use the touchscreen by your apps, but you still can’t do this under X, why?

Because Debian is missing xf86-input-tslib library in it’s repositories and to have working touchscreen on XFCE4 you have to download and compile this library yourself.

Dimitar Gamishev (a.k.a. HEHOPMAJIEH form #olimex irc channel) yesterday teach me how to do this step by step so now I can share. First you have to download the Touchscreen patched which Dimitar did from https://github.com/OLIMEX/OLINUXINO/tree/master/SOFTWARE/A13/TOUCHSCREEN

1. ENABLE TOUCHSCREEN

then you follow these steps:

step 1.

$ git clone https://github.com/kergoth/tslib

step 2.

$ cd tslib

step 3.

$ patch -p1 < ../tslib.patch

(if asks for the filename it is plugins/input-raw.c)

step  4.

$ autoreconf -vi

step 5.

$ ./configure

step 6.

$ make

step 7.

$ make install

so far fo good, now touchscreen event is exported and to see which number it is do

$ dmesg | grep sun4i-ts

[ 18.190000] sun4i-ts.c: sun4i_ts_init: start …
[ 18.200000] sun4i-ts: tp_screen_size is 7 inch.
[ 18.210000] sun4i-ts: tp_regidity_level is 5.
[ 18.220000] sun4i-ts: tp_press_threshold_enable is 0.
[ 18.230000] sun4i-ts: rtp_sensitive_level is 15.
[ 18.230000] sun4i-ts: rtp_exchange_x_y_flag is 0.
[ 18.240000] sun4i-ts.c: sun4i_ts_probe: start…
[ 18.260000] input: sun4i-ts as /devices/platform/sun4i-ts/input/input4
[ 18.280000] sun4i-ts.c: sun4i_ts_probe: end
[ 18.260000] input: sun4i-ts as /devices/platform/sun4i-ts/input/input4

so in this case the event is 4

then you have to do some EXPORTs where you replace X with “4” in this case:

$ export TSLIB_TSEVENTTYPE=raw
$ export TSLIB_CONSOLEDEVICE=none
$ export TSLIB_FBDEVICE=/dev/fb0
$ export TSLIB_TSDEVICE=/dev/input/eventX
$ export TSLIB_CALIBFILE=/etc/pointercal
$ export TSLIB_CONFFILE=/path/to/ts.conf
$ export TSLIB_PLUGINDIR=/path/to/lib/ts

note you should write your correct path which depend on what OS you are running and what –prefix you used to compile them

if you did everything correctly you can check with

$ ts_test

or

$ ts_calibrate

if everything is OK

2. ENABLE TOUCHSCREEN FOR X

$ wget http://ftp.de.debian.org/debian/pool/main/x/xf86-input-tslib/xf86-input-tslib_0.0.6.orig.tar.gz

$ tar zxfv xf86-input-tslib_0.0.6.orig.tar.gz

$ cd xf86-input-tslib-0.0.6/

$ patch -p1 < ../1-xf86tslib-sigfault.patch

$ patch -p1 < ../xf86-input-tslib-port-ABI-12-r48.patch

$ ./configure –prefix=/your/x11/lib/dir/

$ make

$ make install

add this in the X- configuration:

Section “InputDevice”
Identifier “Sun4iTouchscreen”
Option “Device” “/dev/input/eventX”
Driver “tslib”
Option “ScreenNumber” “0”
Option “Rotate” “NONE”
Option “Width” “800”
Option “Height” “480”
Option “SendCoreEvents” “yes”

EndSection

and like in point 1 /dev/input/eventX replace X with “4”

then pray and start X 😉 if you did everything correctly X should start with Touchscreen support like show on these videos:

http://www.youtube.com/watch?v=DjTYji93xNY

http://www.youtube.com/watch?v=-4COA3ZBacY

17 Comments (+add yours?)

  1. Skaag Argonius
    Dec 19, 2012 @ 21:01:24

    If you are using the debian image, you will probably have to install a bunch of packages before you are able to compile this. The important packages: apt-get install xorg-dev xserver-xorg-dev x11proto-core-dev

    Reply

  2. David Goadby
    Dec 20, 2012 @ 16:50:02

    Best news this side of Xmas! Off to try it now and will report back either way…
    If it works I will create a working SD image so others can jump-start their projects. Watch this space.

    Reply

    • Skaag Argonius
      Dec 20, 2012 @ 21:49:43

      Hi David, it gives me a segfault on my debian image. But I have a feeling this has to do with my 3.0.42+ kernel. I’m going to try to re-build the 3.0.52 kernel and then try again with that.

      Other than that, notice that where it says Section “InputDevice” on this page, I believe it should be “InputClass” instead.

      Good luck and I’ll be waiting for your progress. I plan to include such instructions on my own blog here: http://www.skaag.net/2012/12/20/lessons-learned-about-olinuxino-a13/

      Reply

    • Skaag Argonius
      Dec 22, 2012 @ 23:30:53

      OK so I got it all working. It works really well, and I’ve documented more of the process on my blog post (but i’m not yet done with that, I’ll probably finish it all this evening). If you need help with it, let me know while it’s still all fresh in my memory 🙂

      Reply

  3. PALYGAP
    Dec 21, 2012 @ 08:58:32

    Do you known if the A13-LCD7TS 7″ LCD is working with QT 4.5 on the debian image?

    Reply

  4. Gabriel Cabral
    Dec 25, 2012 @ 22:17:08

    hi, i have a 7″ tablet with an a10, i’ve followed all of the steps here to get it working with lubuntu 12.04 and got the touchscreen working with ts_calibrate and ts_test, also got the touchscreen (sun4-ts) detected in xorg, but i can’t make it work. I don’t know how i can debug to know what is failing, everything seems to be ok.
    Thanks for the tutorial!

    Reply

  5. Aqua-Passion
    Jan 13, 2013 @ 01:21:31

    hello
    for
    “patch -p1 < ../1-xf86tslib-sigfault.patch" and "patch -p1 < ../xf86-input-tslib-port-ABI-12-r48.patch"
    i get
    "Reversed (or previously applied) patch detected! Assume -R? [n]"
    and
    " Apply anyway? [n]"

    what should I do?

    Reply

  6. alp
    Mar 12, 2013 @ 21:32:48

    The same as to Aqua-Passion also happened to me. Why is this happening?

    Reply

  7. ozko
    Apr 08, 2013 @ 11:10:18

    When I do step 3.

    $ patch -p1 < ../tslib.patch

    I get
    **** Only garbage was found in the patch input.

    how can I fix that :/

    Reply

  8. vaishali
    Apr 09, 2013 @ 11:49:11

    which image are you guys using to enable lcd-ts.
    i want to start my lcd ts with a13 wifi board , so i have basic 2gb debian with xfce4 in my sd card.
    but to do the above changes i need to have wifi connection ,
    but i am not able to connect wifi connection.
    i tried many things but no progress.
    please suggest me what should i do.

    Reply

  9. David Goadby
    Apr 09, 2013 @ 14:32:43

    I have been trying to get this to work reliably since January and still don’t have a working version.

    Like a lot of users I am ok with Linux on fully loaded PC’s but embedded kernels on lightweight platforms are a lot more tricky.

    I am sure there is a demand for a touch screen enabled version of Debian on the A13 else why would we buy it? Cannot someone in Olimex sort this out once and for all and give us a fully-sorted A13-touchscreen downloadable Debian image?

    Right now I would happily pay for such a download so I can get on the rest of my development schedule.

    Reply

    • damian
      Apr 26, 2013 @ 16:45:23

      Hello,
      I have been trying to install touch screen. Ts_test and ts_calibrate worked ok, but I can’t make it work into X system. I tried different distribution of linux (debian, ubuntu and linaro) including official Olimex image. The results are null. Can somebody help me with a touch screen full-functional linux image file ?

      Reply

  10. Moataz
    Oct 02, 2013 @ 04:34:38

    Hello Everybody,
    i have done all the steps in this Tutorial too (on A10s). The TS works fine with ts_calibrate and ts_test bud when i run startx the touchscreen doesnt work and i get

    hostname: Name or service not known
    xauth: (stdin):1: bad display name “A10s:1” in “add” command

    X.Org X Server 1.12.4
    Release Date: 2012-08-27
    X Protocol Version 11, Revision 0
    Build Operating System: Linux 3.2.0-4-mx5 armv7l Debian
    Current Operating System: Linux A10s 3.0.76+ #5 PREEMPT Thu Jun 13 10:32:41 EEST 2013 armv7l
    Kernel command line: console=ttyS0,115200 root=/dev/mmcblk0p2 rootwait loglevel=8 panic=10
    Build Date: 17 April 2013 11:31:56AM
    xorg-server 2:1.12.4-6 (Julien Cristau )
    Current version of pixman: 0.26.0
    Before reporting problems, check http://wiki.x.org
    to make sure that you have the latest version.
    Markers: (–) probed, (**) from config file, (==) default setting,
    (++) from command line, (!!) notice, (II) informational,
    (WW) warning, (EE) error, (NI) not implemented, (??) unknown.
    (==) Log file: “/var/log/Xorg.1.log”, Time: Wed Oct 2 01:30:09 2013
    (==) Using system config directory “/usr/share/X11/xorg.conf.d”
    ^Cxinit: connection to X server lost

    waiting for X server to shut down Server terminated successfully (0). Closing log file.

    xinit: unexpected signal 2
    xauth: (argv):1: bad display name “A10s:1” in “remove” command

    I would be thankful for your help

    Reply

  11. S. Divya
    Jun 26, 2014 @ 14:28:17

    when I run ts_calibrate, it shows “Touch cross hair to calibrate” . But when I touch it nothing happens. Can you please help?

    Reply

Leave a comment