A13 + LCD7-TS + Debian + Xorg difficulties

Started by spctr, November 29, 2012, 09:28:31 PM

Previous topic - Next topic

spctr

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?

VDHinferm

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.

oldpenguin

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

lorenzo

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

lorenzo

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

leo

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

lorenzo

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

David Goadby

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

lorenzo

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

David Goadby

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

lukas

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

olimex


lukas

#12
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.

Stephane80

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


lukas

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