Olimex Support Forum

OLinuXino Android / Linux boards and System On Modules => A13 => Topic started by: spctr on November 29, 2012, 09:28:31 pm

Title: A13 + LCD7-TS + Debian + Xorg difficulties
Post by: spctr on November 29, 2012, 09:28:31 pm
Hi, I have got some problems while trying to use touchscreen under Xorg. Xorg seems to stumble into autoprobe of the device, and can't figure out which driver to use, snippet from Xorg.0.log below.

--- snip ---
[  3307.534] (II) config/udev: Adding input device sun4i-ts (/dev/input/event0)
[  3307.534] (II) No input driver specified, ignoring this device.
[  3307.534] (II) This device may have been added with another device file.
--- snip ---

The device /dev/input/event0 does output data when touchscreen is touched, so the kernel driver is working. Verified this with hexdump. So the question goes: has someone got it working under Xorg, and if, how?
Title: Re: A13 + LCD7-TS + Debian + Xorg difficulties
Post by: VDHinferm on December 01, 2012, 02:12:42 pm
Hi.
I'm using Slackware and loading module manually, mi device for ts is /dev/input/event3, and if I read this device it responds to touchpad actions, it can be viewed with cat /dev/input/event3  | hexdump so it seems touchpad device works. I'm trying to configure xorg.conf with no results, but the solution it's probably here.
Time ago I get ts working with xorg in a mini2440 using input-tslib, obviously compiling previously tslib. I'm trying to compile tslib in Olinuxino, but it doesnt works. Recently I discover some patches for tslib on Olinuxino DSK directories, but I have not tested yet.
Title: Re: A13 + LCD7-TS + Debian + Xorg difficulties
Post by: oldpenguin on December 03, 2012, 02:32:26 pm
Hi all
I'm also trying to setup the touchscreen on a A13 Olinuxino. I'm using debian wheezy
When I load the driver manually with insmod /lib/modules/3.0.42+/kernel/drivers/input/touchscreen/sun4i-ts.ko a new input device is created as /dev/input/event3. I confirm that doing cat /dev/input/event3 | hexdump shows some data when I use the touchscreen.
The problem is I don't know how to proceed. It seems I need a package xserver-xorg-input-tslib but it is not available in wheezy. Any ideas or other directions ?
By the way my Xorg.0.log is full of "(EE) FBDEV(0): FBIOPUTCMAP: Invalid argument". How can I get rid of this ?
Regards
Title: Re: A13 + LCD7-TS + Debian + Xorg difficulties
Post by: lorenzo on December 04, 2012, 02:22:27 pm
Hi all,

I have similar problem with touchscreen. I configure the 20-evdev.conf Xorg conf file as follow:

Section "InputClass"
        Identifier "sun4i touchscreen"
        MatchProduct "sun4i-ts"
        Option "Device" "/dev/input/event2"
        Driver "evdev"
        Option "MinX" "0"
        Option "MaxX" "4095"
        Option "MinY" "0"
        Option "MaxY" "4095"
        Option "SendCoreEvents" "yes"
        Option "Type" "touchscreen"
EndSection

but I can't get touchscreen work. I also enable some sun4i_ts module debug info, and I see that the driver is working correctly.
I also tried with X11 tslib configuration and ts_calibration, but I have problems: it seems that libraries don't map the touchscreen coordinates into LCD space.

I hope that someone could help us.
Thank you.

BR
Lorenzo
Title: Re: A13 + LCD7-TS + Debian + Xorg difficulties
Post by: lorenzo on December 06, 2012, 08:30:17 pm
Hi all,

I solved the problem with tslib: I made ts_calibrate and ts_test work correctly. I will now try to setup Xorg for sun4i_ts.

To fix tslib you have to recompile it. Download it and add inside plugins/input-raw.c these lines:

ABS_MT_TOUCH_MAJOR definition (near other definitions)


#ifndef ABS_MT_POSITION_X
# define ABS_MT_POSITION_X       0x35    /* Center X ellipse position */
# define ABS_MT_POSITION_Y       0x36    /* Center Y ellipse position */
# define ABS_MT_TOUCH_MAJOR      0x30    /* Press */
#endif


Then add the event inside the switch-case, just before ABS_PRESSURE, as below:


case EV_ABS:
   ...
   case ABS_MT_TOUCH_MAJOR:
   case ABS_PRESSURE:


And that's it... Oops I forget: comment these two lines:


   //fprintf(stderr, "tslib: Selected device is not a touchscreen (must support ABS_X and ABS_Y events)\n");
   //return -1;     


Or you still have errors...

Lorenzo
Title: Re: A13 + LCD7-TS + Debian + Xorg difficulties
Post by: leo on December 12, 2012, 11:42:26 am
Hi Lorenzo,

have you found a sollution for the touchscreen under Xorg?
After patching the tslib sources the ts_test works for me too. (thanks for that)
The Xorg log looks good but the touchscreen still isnt working.


[ 83391.047] (II) config/udev: Adding input device sun4i-ts (/dev/input/event1)
[ 83391.047] (**) sun4i-ts: Applying InputClass "sun4i touchscreen"
[ 83391.048] (II) LoadModule: "evdev"
[ 83391.048] (II) Loading /usr/lib/xorg/modules/input/evdev_drv.so
[ 83391.049] (II) Module evdev: vendor="X.Org Foundation"
[ 83391.049] compiled for 1.12.1, module version = 2.7.0
[ 83391.049] Module class: X.Org XInput Driver
[ 83391.049] ABI class: X.Org XInput driver, version 16.0
[ 83391.049] (II) Using input driver 'evdev' for 'sun4i-ts'
[ 83391.049] (**) Option "SendCoreEvents" "yes"
[ 83391.049] (**) sun4i-ts: always reports core events
[ 83391.049] (**) evdev: sun4i-ts: Device: "/dev/input/event1"
[ 83391.050] (--) evdev: sun4i-ts: Vendor 0x1 Product 0x1
[ 83391.050] (--) evdev: sun4i-ts: Found absolute axes
[ 83391.050] (II) evdev: sun4i-ts: Forcing absolute x/y axes to exist.
[ 83391.050] (II) evdev: sun4i-ts: Configuring as mouse
[ 83391.050] (**) Option "config_info" "udev:/sys/devices/platform/sun4i-ts/input/input1/event1"
[ 83391.050] (II) XINPUT: Adding extended input device "sun4i-ts" (type: MOUSE, id 6)
[ 83391.050] (II) evdev: sun4i-ts: initialized for absolute axes.
[ 83391.051] (**) sun4i-ts: (accel) keeping acceleration scheme 1
[ 83391.051] (**) sun4i-ts: (accel) acceleration profile 0
[ 83391.051] (**) sun4i-ts: (accel) acceleration factor: 2.000
[ 83391.051] (**) sun4i-ts: (accel) acceleration threshold: 4


Kind Regards

Leo
Title: Re: A13 + LCD7-TS + Debian + Xorg difficulties
Post by: lorenzo on December 13, 2012, 09:49:12 am
Hi Leo,

no I can't get X11 and touchscreen work correctly. Now I've compiled Qt and make it work with tslib touch.
I hope I will find more time to spend investigating X11 and touchscreen configuration.

BR
Lorenzo
Title: Re: A13 + LCD7-TS + Debian + Xorg difficulties
Post by: David Goadby on December 13, 2012, 01:58:54 pm
Hi Lorenzo,

This is important thread as the A13 + LCD is almost useless in pure Linux systems.

Although I love the A13, and the LCD package is great value I need to get X11 + touchscreen working ASAP else I am going to have to try alternative platforms.  I have 50+ units to ship in Q2-2013 so my clock is ticking.

Ideally we need a downloadable image or purchasable SD card of a fully sorted X11/Touchscreen A13 system. Maybe Olimex support should help us get this sorted as I'm sure that more sales will result of a complete package.

David
Title: Re: A13 + LCD7-TS + Debian + Xorg difficulties
Post by: lorenzo on December 14, 2012, 06:32:17 pm
Hi David,

today I've tried some new Xorg configuration, but I still have X11 cursor stucked.

Here is my .conf file:


Section "ServerLayout"
        Identifier      "Main Layout"
        Screen          "Mali Screen"
        InputDevice     "Sun4iTouchscreen"
EndSection

#Section "Device"
#       Identifier "Mali FBDEV"
#       Driver  "mali"
#       Option  "fbdev"            "/dev/fb0"
#       Option  "DRI2"             "true"
#       Option  "DRI2"             "true"
#       Option  "DRI2_PAGE_FLIP"   "true"
#       Option  "DRI2_WAIT_VSYNC"  "false"
#EndSection

Section "Screen"
        Identifier      "Mali Screen"
#       Device          "Mali FBDEV"
        DefaultDepth    24
EndSection

#Section "DRI"
#       Mode 0666
#EndSection

Section "InputDevice"
        Identifier      "Sun4iTouchscreen"
        Option          "Device" "/dev/input/event1"
        Driver          "tslib"
        Option          "ScreenNumber" "0"
        Option          "Rotate" "NONE"
        Option          "Width" "800"
        Option          "Height" "480"
        Option          "SendCoreEvents" "yes"
EndSection


Maybe you can try to change some settings and see what happens on your system.

BR
Lorenzo
Title: Re: A13 + LCD7-TS + Debian + Xorg difficulties
Post by: David Goadby on December 16, 2012, 02:47:35 pm
Hi Lorenzo,

Thanks for the extra information. I will be able to try some more "permutations" tomorrow so will elt you know what I discover. One way or another this problem must be solved!

David
Title: Re: A13 + LCD7-TS + Debian + Xorg difficulties
Post by: lukas on December 16, 2012, 08:13:10 pm
I'm stuck too :(
Kernel module "sun4i-ts" looks like it works fine, because when I cat /dev/input/event3 and then touch the screen I can see data from that event3. So I think problem is with Xorg driver - evdev, which can't talk with event. Or maybe there's need to be make some tweaks with "sun4i-ts" so it could send data just like "usbtouchscreen" module.
A13 + LCD7TS is great value for the money, but we need touchscreen working.
Olimex support, pls. help us!

Best regards,
Lukas
Title: Re: A13 + LCD7-TS + Debian + Xorg difficulties
Post by: olimex on December 19, 2012, 05:11:50 pm
I just blogged how to add Touchscreen support in Linux running X http://olimex.wordpress.com/2012/12/19/a13-lcd7ts-support-in-linux/
Title: Re: A13 + LCD7-TS + Debian + Xorg difficulties
Post by: lukas on January 11, 2013, 07:08:07 pm
I have TouchScreen working with your help, thanks. But when I add this code to /usr/share/x11/xorg.conf.d/10-ts.conf

Section "InputDevice"
Identifier "Sun4iTouchscreen"
Option "Device" "/dev/input/event3"
Driver "tslib"
Option "ScreenNumber" "0″
Option "Rotate" "NONE"
Option "Width" "800″
Option "Height" "480″
Option "SendCoreEvents" "yes"
EndSection


my keyboard stops working after X starts. I can move cursor with touchscreen, but keyboard is not working. Have you experienced same issue with keyboard (evdev) after enabling tslib?
I will try with xserver-xorg-input-evtouch instead xserver-xorg-input-tslib. Maybe I will have more luck, because this driver was working great for me with IrDA and SAW touchscreens.
Title: Re: A13 + LCD7-TS + Debian + Xorg difficulties
Post by: Stephane80 on January 12, 2013, 05:17:38 pm
hello i try to get TS working on "A13 Debian Image with X"
i'm doing
Quote1. 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

from http://olimex.wordpress.com/2012/12/19/a13-lcd7ts-support-in-linux/

but when I do
"dmesg | grep sun4i-ts"
it return nothing
Quote
olinuxino@debian:~$ dmesg | grep sun4i-ts
olinuxino@debian:~$

I have try many thing
I think I don't show error
I intalled
Quotesudo apt-get install build-essential git automake autoconf libtool ntpdate pkg-config
sudo apt-get install xorg-dev xserver-xorg-dev x11proto-core-dev

but when I do
"dmesg | grep sun4i-ts"
it return nothing
can you help me please ?
thanks

Title: Re: A13 + LCD7-TS + Debian + Xorg difficulties
Post by: lukas on January 12, 2013, 05:26:17 pm
Dear Aqua-Passion,

First of all, you must load sun4i-ts kernel module:
modprobe sun4i-ts
Then will will see messages with dmesg | grep sun4i-ts
You can put sun4i-ts into /etc/modules file, so it will be loaded every reboot.

Best regards,
Lukas
Title: Re: A13 + LCD7-TS + Debian + Xorg difficulties
Post by: Stephane80 on January 12, 2013, 06:01:10 pm
Yes !
Thank you very much  :D
Title: Re: A13 + LCD7-TS + Debian + Xorg difficulties
Post by: lukas on January 12, 2013, 06:13:55 pm
Quote from: Aqua-Passion on January 12, 2013, 06:01:10 pm
Yes !
Thank you very much  :D


Does you keyboard work with touchscreen?
I have problems with that :(
https://www.olimex.com/forum/index.php?topic=444.msg2551#msg2551 (https://www.olimex.com/forum/index.php?topic=444.msg2551#msg2551)

Best regards,
Lukas
Title: Re: A13 + LCD7-TS + Debian + Xorg difficulties
Post by: Stephane80 on January 12, 2013, 07:15:27 pm
No, sorry, I have another problem :-(
fist time i have
QuoteNo raw modules loaded.

with "ts_test"
I have uncommented the first line in ts.conf
but when I do "sudo ts_test" or "sudo ts_calibrate"
that do nothing :-(
Quoteolinuxino@debian:~$ sudo ts_calibrate
olinuxino@debian:~$


Title: Re: A13 + LCD7-TS + Debian + Xorg difficulties
Post by: Stephane80 on January 12, 2013, 09:08:26 pm
Ok get ts_calibrate and ts-test working
Title: Re: A13 + LCD7-TS + Debian + Xorg difficulties
Post by: Stephane80 on January 12, 2013, 11:05:12 pm
for
"patch -p1 < ../1-xf86tslib-sigfault.patch" and "patch -p1 < ../xf86-input-tslib-port-ABI-12-r48.patch"
i get
QuoteReversed (or previously applied) patch detected!  Assume -R? [n]

and
QuoteApply anyway? [n]


what should I do?
Title: Re: A13 + LCD7-TS + Debian + Xorg difficulties
Post by: lukas on January 13, 2013, 12:31:47 pm
Patch manually or use already patched file from this link:
https://dl.dropbox.com/u/40057/patches/tslib.c (https://dl.dropbox.com/u/40057/patches/tslib.c)
from this post http://www.skaag.net/2012/12/20/lessons-learned-about-olinuxino-a13/ (http://www.skaag.net/2012/12/20/lessons-learned-about-olinuxino-a13/)
Title: Re: A13 + LCD7-TS + Debian + Xorg difficulties
Post by: Stephane80 on January 13, 2013, 02:25:05 pm
ok thank you
and for
"./configure -prefix=/usr"
in http://olimex.wordpress.com/2012/12/19/a13-lcd7ts-support-in-linux/#comment-4089
it's "./configure -prefix=/your/x11/lib/dir/"

on linaro I have "/usr/share/X11/"

I have to put "./configure -prefix=/usr" or "./configure -prefix=/usr/share" or "./configure -prefix=/usr/share/X11" ?
I can not make it work :-(

And when I type "su" and after "ts_calibrate" , calibrate work good
but if I type "ts_calibrate" or "sudo ts_calibrate" in user linaro it don't work
this is normal or there is a problem?
Thank you for your help
Title: Re: A13 + LCD7-TS + Debian + Xorg difficulties
Post by: giorgio323 on January 22, 2013, 12:36:28 am
Hallo,

I am at point where the variables are exported. So far all is fine. After that I run ts_calibrate. I see the cross point moving fastly in the screen and after a secons the program ends. The messages are:
xres = 800, yres = 480
tslib: Selected device is not a touchscreen (must support BTN_TOUCH events)
took 4 samples ...
...
..
...

Could help me to understand and fix the problem?

Thank you in advance
Giorgio
Title: Re: A13 + LCD7-TS + Debian + Xorg difficulties
Post by: p.kartavyy on February 13, 2013, 03:02:35 pm
Hello

I am trying to make working A13 + LCD7-TS. I use linaro image from wiki https://www.olimex.com/wiki/Prebuilt_SD_card_images_running_debian
Debian images won't work for me. I tried R15 and R12 but they don't boot, unfortunately.

I use manual from http://olimex.wordpress.com/2012/12/19/a13-lcd7ts-support-in-linux/. Big thanks for it.

ts_test and ts_calibrate works perfectly. But i have some problem with x11.
First i have the problem for tslib -  "No input driver specified, ignoring this device". Then I changed rules in /usr/share/X11/xorg.conf.d/ and this error disapeared.

Now there is "ts_config failed" error in Xorg.log. And I can't find any log information for tslib.
I also tried packages libts-0.0-0, xserver-xorg-input-tslib. They have no errors in Xorg.log but touch doesn't work in X11 anyway.

Thanks in advance for any help.


#/var/log/Xorg.o.log
  7197.911] (II) config/udev: Adding input device sun4i-ts (/dev/input/event3)
[  7197.911] (**) sun4i-ts: Applying InputClass "sun4i touchscreen"
[  7197.911] (II) LoadModule: "tslib"
[  7197.913] (II) Loading /usr/lib/xorg/modules/input/tslib_drv.so
[  7197.914] (II) Module tslib: vendor="X.Org Foundation"
[  7197.914]    compiled for 1.11.3, module version = 0.0.1
[  7197.914]    Module class: X.Org XInput Driver
[  7197.914]    ABI class: X.Org XInput driver, version 16.0
[  7197.914] (II) Using input driver 'tslib' for 'sun4i-ts'
[  7197.914] (II) Loading /usr/lib/xorg/modules/input/tslib_drv.so
[  7197.915] (**) Option "SendCoreEvents" "yes"
[  7197.915] (**) sun4i-ts: always reports core events
[  7197.915] (**) sun4i-ts: always reports core events
[  7197.915] (**) Option "ScreenNumber" "0"
[  7197.915] (**) Option "Width" "800"
[  7197.915] (**) Option "Height" "480"
[  7197.915] (**) Option "Rotate" "NONE"
[  7197.918] ts_config failed                                  <------ error is here
[  7197.918] (II) UnloadModule: "tslib"
  7197.918] (II) Unloading tslib
[  7197.918] (EE) PreInit returned 2 for ""
[  7197.918] xf86TslibUninit
[  7197.918] xf86TslibControlProc
[  7197.918]
Backtrace:
[  7197.918] Segmentation fault at address (nil)            <------ error is here
[  7197.919]
Caught signal 11 (Segmentation fault). Server aborting
[  7197.919]
Please consult the The X.Org Foundation support
         at http://wiki.x.org
for help.
[  7197.919] Please also check the log file at "/var/log/Xorg.0.log" for additional information.
[  7197.919]
[  7197.925]  ddxSigGiveUp: Closing log
[  7197.925] Server terminated with error (1). Closing log file.


#/root/.bashrc
# exports for tslib - touch screen lib
export TSLIB_TSEVENTTYPE=raw
export TSLIB_CONSOLEDEVICE=none
export TSLIB_FBDEVICE=/dev/fb0
export TSLIB_TSDEVICE=/dev/input/event3
export TSLIB_CALIBFILE=/etc/pointercal
export TSLIB_CONFFILE=/etc/ts.conf
export TSLIB_PLUGINDIR=/usr/local/lib/ts



#/usr/share/X11/xorg.conf.d/12-ts.conf

Section "InputClass"
Identifier "sun4i touchscreen"
Option "Device" "/dev/input/event3"
MatchProduct "sun4i-ts"
Driver "tslib"
Option "ScreenNumber" "0"
Option "Rotate" "NONE"
Option "Width" "800"
Option "Height" "480"
Option "SendCoreEvents" "yes"
EndSection




cat /etc/ts.conf
# 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

Title: Re: A13 + LCD7-TS + Debian + Xorg difficulties
Post by: p.kartavyy on February 14, 2013, 11:38:39 am
I used strace -ewrite -f -p "$( start lightdm | grep -o -e "[0-9]\{4\}" ) " to get error messages from tslib.
The problem was that tslib is configured by default with config file at /usr/local/etc/ts.conf. And tslib when loaded by Xserver ignores env variables.

So ts.conf should be placed at /usr/local/etc/ts.conf and env variables should be like following.

#/root/.bashrc
# exports for tslib - touch screen lib
export TSLIB_TSEVENTTYPE=raw
export TSLIB_CONSOLEDEVICE=none
export TSLIB_FBDEVICE=/dev/fb0
export TSLIB_TSDEVICE=/dev/input/event3
export TSLIB_CALIBFILE=/etc/pointercal
export TSLIB_CONFFILE=/usr/local/etc/ts.conf                   <--- here is a bug fix
export TSLIB_PLUGINDIR=/usr/local/lib/ts


Now X starts normally but it is terminated when I touches the screen.
Title: Re: A13 + LCD7-TS + Debian + Xorg difficulties
Post by: p.kartavyy on February 14, 2013, 01:00:39 pm
The problem why X cannot start was in xf86XInputSetScreen call.
As I understand my version of x-server doesn't support this call( Version: 2:1.11.4-0ubuntu10 ). Thus I commented line in tslib.c and it booted. It looks like a hack, may be more old version of x-server will work without this hack.

/** FixMe: xf86XInputSetScreen(local, priv->screen_num,                                                                             
                                        samp.x,                                                                                                             
                                        samp.y); */   


The last problem is that when I touch the screen cursor moves to the right-bottom corner. It doesn't depends of a place which i touch.
Title: Re: A13 + LCD7-TS + Debian + Xorg difficulties
Post by: p.kartavyy on February 14, 2013, 03:25:15 pm
Cool finally it works!

As a resume:
1.Check that your environment variables agreed with defines for which tslib is build.
It's can be easily done like "grep -r pointercall ." in tslib build directory.
In linaro image variant which works for me is the following.

#/root/.bashrc
# exports for tslib - touch screen lib
export TSLIB_TSEVENTTYPE=raw
export TSLIB_CONSOLEDEVICE=none
export TSLIB_FBDEVICE=/dev/fb0
export TSLIB_TSDEVICE=/dev/input/event3    <-- this depends on how device is recognized.
export TSLIB_CALIBFILE=/usr/local/etc/pointercal
export TSLIB_CONFFILE=/usr/local/etc/ts.conf                   
export TSLIB_PLUGINDIR=/usr/local/lib/ts


2. If x-server fails when you touch the screen than comment the following lines in xf86-input-tslib/src/tslib.c

/** FixMe: xf86XInputSetScreen(local, priv->screen_num,                                                                             
                                        samp.x,                                                                                                             
                                        samp.y); */


3. If you have problems compile tslib in debug. Output information can be found at /var/log/Xorg.*.log

Enjoy!
Title: Re: A13 + LCD7-TS + Debian + Xorg difficulties
Post by: lukas on February 23, 2013, 03:29:20 pm
My LCD7-TS works but I have 2 problems with tslib:

Are you experiencing same issues?
Title: Re: A13 + LCD7-TS + Debian + Xorg difficulties
Post by: mihu on March 18, 2013, 12:24:54 am
Quote from: lukas on February 23, 2013, 03:29:20 pm

after Xserver starts my USB keyboard stops working


I had the same problem. It works after I added this section at the *end* of 10-evdev.conf and removed any other reference to touchscreens. Change eventX as required.

Section "InputClass"
Identifier "Sun4iTouchscreen"
MatchDevicePath "/dev/input/eventX"
Driver "tslib"
Option "Device" "/dev/input/eventX"
Option "ScreenNumber" "0"
Option "Rotate" "NONE"
Option "Width" "1024"
Option "Height" "600"
Option "SendCoreEvents" "yes"
Option "Type" "touchscreen"
EndSection
Title: Re: A13 + LCD7-TS + Debian + Xorg difficulties
Post by: Duovarious on March 29, 2013, 07:48:31 am
I currently have no way to connect my board to the internet, so I'm not sure how to even get past step one of the proposed solution, since I can't git.
Is there an alternative method that only depends on stuff I can bring over on the sd card? Or do I need to buy the ethernet adapter just to get the touchscreen working?
Will there ever be an image for this board that supports the touchscreen out of the box?
Is there any way for me to just duplicate the data from an sd card of someone who has already gotten this all set up?
Title: Re: A13 + LCD7-TS + Debian + Xorg difficulties
Post by: ozko on April 05, 2013, 01:01:29 pm
Hello everybody!
Im trying to run the lcd7ts on debian R17
with the wordpress guide http://olimex.wordpress.com/2012/12/19/a13-lcd7ts-support-in-linux/
Im also pretty new to linux overall and at step 3 $ patch -p1 < ../tslib.patch I get
patch: **** Only garbage was found in the patch input.
Are the patches outdated or I need another debian image?
Please help and thanks in advance!

edit: and I dont know if its because it didnt patch, but I tried autoreconf -vi
the response was autoreconf: command not found
Title: Re: A13 + LCD7-TS + Debian + Xorg difficulties
Post by: vaishali on April 09, 2013, 11:30:35 am
hi ozko, 

same problem with me too,
but the difference is only that i have R15 in my 16gb sd card.
if there is any progress in lcd ts connection, then please let me know...
Title: Re: A13 + LCD7-TS + Debian + Xorg difficulties
Post by: vaishali on April 17, 2013, 04:36:46 pm
hello ,

i am using official 2gb debian with xfce4 in sd card to enable touch screen.
but whenever i tried to download patches from github it requires certificate. so using below command i installed patches in /usr/src

#wget --no-check-certificate https://github.com/OLIMEX/OLINUXINO/tree/master/SOFTWARE/A13/TOUCHSCREEN/1-xf86tslib-sigfault.patch

#wget --no-check-certificate https://github.com/OLIMEX/OLINUXINO/tree/master/SOFTWARE/A13/TOUCHSCREEN/tslib.patch

#wget --no-check-certificate https://github.com/OLIMEX/OLINUXINO/tree/master/SOFTWARE/A13/TOUCHSCREEN/xf86-input-tslib-port-ABI-12-r48.patch

#env GIT_SSL_NO_VERIFY=true git clone https://github.com/kergoth/tslib

#cd tslib

#patch -p1 < ../tslib.patch

at this time i am getting the below error

patch: **** Only garbage was found in the patch input.

please help me with this.

Title: Re: A13 + LCD7-TS + Debian + Xorg difficulties
Post by: vaishali on April 22, 2013, 07:55:14 pm
hello olimex,

I am using the official debian with x in 16gb sd card.
I have followed the steps from wordpress to start my 7" lcd ts.
I am able to do ts_calibrate and ts_test.
But not able to enable touch in my xfce4.
I have followed the instruction to ENABLE TOUCHSCREEN FOR X.
now how should i start my touch in x.
after rebooting and doing startxfce4 my keyboard and mouse stops working and i am not able to do touch in the lcd.
please help what should i do.
I have followed all the instructions directly on my a13 wifi board , i have not done cross compiling to load touch module.
please help.
Title: Re: A13 + LCD7-TS + Debian + Xorg difficulties
Post by: vaishali on April 25, 2013, 09:57:17 am
Hello all,


Finally after long struggle my touch screen has started working.
I am using official debian image with xfce4 (2gb image).
Currently my touch screen works in xfce4 only after i load sun4i-ts everytime before starting xfce4.
after rebooting if i do startx without running command modprobe sun4i-ts , my touch screen stops working.
And my mouse is also not working.
Can you tell me how can i enable my touch module automatically after reboot.
I want my mouse and touch screen both working in this image.
I have exported the variable of ts module in .bashrc file to make it start automatically after reboot but it didn't work.
I have also exported the the variable in /etc/environment file but it didn't start after reboot automatically.
In which file i should make changes to make my touch screen work automatically after reboot. 
Title: Re: A13 + LCD7-TS + Debian + Xorg difficulties
Post by: JohnS on April 25, 2013, 03:53:05 pm
How about /etc/modules

John
Title: Re: A13 + LCD7-TS + Debian + Xorg difficulties
Post by: vaishali on April 26, 2013, 04:54:10 pm
hi john ,

thanx for your help but i have already tried to use this file but didn't succeeded.
The reason was i was putting the wrong name of ts module.
After putting correct name in /etc/module file it is working fine.
Now my touch screen works after reboot.
Thanx guys. Thank you for your help.
Title: Re: A13 + LCD7-TS + Debian + Xorg difficulties
Post by: vaishali on April 26, 2013, 06:12:31 pm
Hello all,

here i have mentioned the detailed steps to start the touch screen with a13 wifi board with the help of dimitar and Skaag Argonius. thanks to both of you.

(1) First of all download the official debian image with xfce4 (2gb image) from the wiki or the following link.

https://docs.google.com/file/d/0B-bAEPML8fwlQjBOa1JUZlE2TGM/edit?usp=sharing

(2)Then extract this image from the downloaded rar file.

(3)You will get .img file.

(4)then copy this file to your microsd card using dd command.

(5)Now insert this card into your a13 wifi board and please do not connect keyboard , mouse or any other usb devices into the a13 wifi board.

(6)And also do not connect any serial devices to UART1 port at the time of connecting power supply.

(7)then using ssh port connect with your board from your computer. Use below command in the terminal of your computer to connect from your computer through ssh to your a13 wifi board.

ssh l root 192.168.1.xxx (whichever is your ip).

(8)so you will be asked for your password.
password is password for this image.
so now you are connected to your board and you will find the below text in your terminal.

root@debian:/#

(9) Now follow the below instructions to add ts module in your wifi board.

root@debian:/# apt-get update
this will take some time.

root@debian:/# apt-get install build-essential git automake autoconf libtool ntpdate pkg-config

for correct timing , cause you will need this later.

root@debian:/# ntpdate pool.ntp.org
to check the timing.

root@debian:/# cd /usr/src

root@debian:/usr/src# git clone https://github.com/kergoth/tslib

root@debian:/usr/src# cd tslib

root@debian:/usr/src/tslib# cd plugins/
 
root@debian:/usr/src/tslib/plugins/# ls

to list the files inside , so you can see there is a file called input-raw.c.


arctic2.la      dejitter.c    input-raw.c     Makefile.in   tatung-raw.lo
arctic2-raw.c      dejitter.la    input-raw.lo     mk712.la   touchkit.la
arctic2-raw.lo      dejitter.lo    linear.c     mk712-raw.c   touchkit-raw.c
collie.la      dmc.la    linear-h2200.c   mk712-raw.lo   touchkit-raw.lo
collie-raw.c      dmc-raw.c    linear_h2200.la  plugins.h   ucb1x00.la
collie-raw.lo      dmc-raw.lo    linear-h2200.lo  pthres.c   ucb1x00-raw.c
corgi.la      h3600.la    linear.la     pthres.la   ucb1x00-raw.lo
corgi-raw.c      h3600-raw.c    linear.lo     pthres.lo   variance.c
corgi-raw.lo      h3600-raw.lo  Makefile     tatung.la   variance.la
cy8mrln-palmpre.c  input.la    Makefile.am     tatung-raw.c   variance.lo

root@debian:/usr/src/tslib/plugins/# rm -f input-raw.c

this file is old so removed from above command.

root@debian:/usr/src/tslib/plugins# ls
check that this file is removed properly.

root@debian:/usr/src/tslib/plugins# wget https://dl.dropbox.com/u/40057/patches/input-raw.c
download the already patched file from above link.

root@debian:/usr/src/tslib/plugins# ls

to check that the new file named input-raw.c has been downloaded.
this will save you from patching module files and the related problems.

root@debian:/usr/src/tslib/plugins# cd ..

root@debian:/usr/src/tslib# autoreconf -vi
to compile the ts module.

root@debian:/usr/src/tslib# ./configure --prefix=/usr/local

root@debian:/usr/src/tslib# make

root@debian:/usr/src/tslib# make install

root@debian:/usr/src/tslib# ldconfig

root@debian:/usr/src/tslib# modprobe sun4i-ts
to load the ts module.

root@debian:/usr/src/tslib# dmesg | grep sun4i-ts
this will give you the name of your input touch screen device by following text.

[   13.210000] sun4i-ts.c: sun4i_ts_init: start ...
[   13.220000] sun4i-ts: tp_screen_size is 5 inch.
[   13.230000] sun4i-ts: tp_regidity_level is 5.
[   13.230000] sun4i-ts: tp_press_threshold_enable is 0.
[   13.240000] sun4i-ts: rtp_sensitive_level is 15.
[   13.250000] sun4i-ts: rtp_exchange_x_y_flag is 0.
[   13.260000] sun4i-ts.c: sun4i_ts_probe: start...
[   13.280000] input: sun4i-ts as /devices/platform/sun4i-ts/input/input1
[   13.300000] sun4i-ts.c: sun4i_ts_probe: end


from the above you can see the name of your touch screen input is input1. It may be input2 or 3 or 4 for you.

(9) now go the following directory to export required variable.

root@debian:/etc# nano environment

to open the environment file and to copy and past the below text into this file.

export TSLIB_TSEVENTTYPE=raw
export TSLIB_CONSOLEDEVICE=none
export TSLIB_FBDEVICE=/dev/fb0
export TSLIB_TSDEVICE=/dev/input/event1
export TSLIB_CALIBFILE=/etc/pointercal
export TSLIB_CONFFILE=/etc/ts.conf
export TSLIB_PLUGINDIR=/usr/local/lib/ts


change event number according to your input number like if you have input1 then it should be event1 and so on.

then press control+x so it will tell you to save so press y and enter key.

root@debian:/etc# ts_calibrate

from this command you can calibrate your screen.
so start calibrating it by touching your touch screen.

root@debian:/etc# ts_test
by this command you can test your touch screen by drawing and dragging on your touch screen.

now go to the following directory to load xf86-xorg-tslib module for your x .

root@debian:/usr/src# apt-get install xorg-dev xserver-xorg-dev x11proto-core-dev
it will take some time.

root@debian:/usr/src# wget http://ftp.de.debian.org/debian/pool/main/x/xf86-input-tslib/xf86-input-tslib_0.0.6.orig.tar.gz

root@debian:/usr/src# tar zxfv xf86-input-tslib_0.0.6.orig.tar.gz

root@debian:/usr/src# cd xf86-input-tslib-0.0.6/

root@debian:/usr/src/xf86-input-tslib-0.0.6# cd src/

root@debian:/usr/src/xf86-input-tslib-0.0.6/src# ls

to check the files inside the folder.

root@debian:/usr/src/xf86-input-tslib-0.0.6/src# rm -f tslib.c
remove this old file.

root@debian:/usr/src/xf86-input-tslib-0.0.6/src# wget https://dl.dropbox.com/u/40057/patches/tslib.c
to load new file.

root@debian:/usr/src/xf86-input-tslib-0.0.6/src# cd ..

root@debian:/usr/src/xf86-input-tslib-0.0.6# ./configure --prefix=/usr

root@debian:/usr/src/xf86-input-tslib-0.0.6# make

root@debian:/usr/src/xf86-input-tslib-0.0.6# make install

now go to the followinf directory to add the below text.

root@debian:/usr/share/X11/xorg.conf.d# nano 20-touchscreen.conf

this is a new file you can change the name if you want.
and copy the below text.

Section "InputClass"
        Identifier "Sun4iTouchscreen"
        MatchDevicePath "/dev/input/event1"
        Driver "tslib"
        Option "Device" "/dev/input/event1"
        Option "ScreenNumber" "0"
        Option "Rotate" "NONE"
        Option "Width" "800"
        Option "Height" "480"
        Option "SendCoreEvents" "yes"
        Option "Type" "touchscreen"
EndSection


save this file as said above.


root@debian:/usr/share/X11/xorg.conf.d# startx

to check that your touch screen is working with x.

now follow the below instructions to load your ts module even after reboot else you will have to load it every time by modprobe sun4i-ts commnad before starting x.

go to following directory.

root@debian:/etc# nano modules

# /etc/modules: kernel modules to load at boot time.
#
# This file contains the names of kernel modules that should be loaded
# at boot time, one per line. Lines beginning with "#" are ignored.
# Parameters can be specified after the module name.
fbcon
sun4i_ts



add sun4i_ts into above file cause it is not there before adding.
save this file and reboot without connecting anything to usb port of your a13wifi board.

now connect your keyboard and mouse and whatever you want cause now your touch screen is also working even after reboot.

Title: Re: A13 + LCD7-TS + Debian + Xorg difficulties
Post by: manchot50 on May 12, 2013, 03:57:35 pm
hello vaishali, very great and perfect help !  work fine on my 3.4.43+ kernel on olinuxino 13 wifi.

No, i search the config for the gpm.conf for console mode ts.

with TS and iPazzPort fly mouse, i can have a good control to my arm computer.

Title: Re: A13 + LCD7-TS + Debian + Xorg difficulties
Post by: webconn on June 30, 2013, 09:43:55 pm
Hello all,

I had some problems with getting the touchscreen to work, because, I think, libraries had been updated. So, I solved this problem by updating patches (just created a pull request on Github, hope that changes will be approved) and using "InputClass" in xorg.conf instead of "InputDevice". Also, I wrote a step-by-step manual, how to configure your Debian to work with touchscreen, and you can read it here: http://www.dimrobotics.com/2013/06/olinuxino-a13-touchscreen-support-in.html (http://www.dimrobotics.com/2013/06/olinuxino-a13-touchscreen-support-in.html).

Good luck! I hope that this information should be useful for someone.

UPD: If you change some conditions in InputClass section (I used "MatchProduct "sun4i-ts"" instead of "MatchDevicePath "/dev/input/event1""), you will get your touchscreen works well with mice, keyboards etc. in every boot conditions (not matter when you plugged other devices in)
Title: Re: A13 + LCD7-TS + Debian + Xorg difficulties
Post by: yo9hnf on August 21, 2013, 05:12:54 pm
THANK YOU vaishali for your tutorial !!!
It's working very nice on A13MICRO.

I had to install libtool, autoconf, build-essential and ntp for everything to run well.

Thank you!
Title: Re: A13 + LCD7-TS + Debian + Xorg difficulties
Post by: yo9hnf on August 22, 2013, 12:28:57 pm
I have a small problem....my X doesn't start after boot.
How can i enable automatically to startx ?
i tried to edit inittab but i had no luck.
Title: Re: A13 + LCD7-TS + Debian + Xorg difficulties
Post by: David Goadby on August 22, 2013, 01:56:04 pm
If you don't want a display manager then the usual way on Debian is described here: http://www.debianadmin.com/how-to-auto-login-and-startx-without-a-display-manager-in-debian.html

If you want an auto-login then this method works for me: http://www.backtrack-linux.org/forums/showthread.php?t=836

Have fun with it!

David
Title: Re: A13 + LCD7-TS + Debian + Xorg difficulties
Post by: herveld on August 27, 2013, 03:31:58 pm
Hello,

Using linaro and following webconn method, I was able to use touchscreen in landscape mode.

However if I try to rotate screen in portrait mode, using Option "Rotate" "CW" in xorg.conf and 20-touchscreen.conf, Xorg crashes everytime the screen is touched.

Any idea how to make the touchscreen work in portrait mode ?

Regards,
herveld