A13-OLinuXino Touchscreen support under Debian Linux

Started by olimex, July 08, 2013, 09:47:14 AM

Previous topic - Next topic

olimex


Lurch

Do you know what Debian system he was using?  I tried with the [A13_debian_WIFI_GCC_GPIO_IN_OUT_X_I2C_100KHz_scratch_UVC_python_opencv_4G_sixth_release.rar
] download, but step 1. had errors, since one file was missing everywhere:
<E: Failed to fetch http://ftp.uk.debian.org/debian/pool/main/libd/libdmx/libdmx1_1.1.2-1_armhf.deb: 404  Not Found>
Building the tslib also had errors:
<configure.ac: error: possibly undefined macro: for AC_DISABLE_STATIC, AC_ENABLE_SHARED, AC_LIBTOOL_DLOPEN, AC_PROG_LIBTOOL>
These are probably easily fixable for linux hackers, maybe not for less skilled users.

olimex

in his blog at bottom he write: P.S. This solution is tested at Olinuxino A13 with Debian GNU/Linux 7.0 (wheezy). Last commit of tslib was 158ee49, version of xf86-input-tslib was 0.0.6.

granite_crusher

Hi,
I came to the same issue as Lurch,
however I googled up....
this is not problem of board, just some libs missing: libtool if pointing more exactly.
So if somebody gets this problem, try to do this:
apt-get libtool

(well I still didn't finished to compile, but I actually just passed that autoreconfig step)

cheers

Lurch


granite_crusher

nice site, Lurch,
I finished successfully yesterday, installed E17 (enlightenment), touch-screen works!
but now I started to realize that probably even enlightenment uses to much ram, and will have to go this qt embedded way...

cheers

granite_crusher

I just noticed, that linux gives different input/eventNUMBER (checked with "dmesg | grep sun4i-ts") if there is USB mouse or keyboard attached. i.e. if no usb inputs are plugged during boot then event will be 1, if keyboard to otg is attached TS event is 3, if mouse to usb is attached TS event is 4, but if these peripherals are connected after boot up of linux - TS input event stays 1.
So if I want TS to work I have to have other usb inputs to be plugged/unplugged during boot as at the moment of configuring/installing TS, else event number in configuration and TS event number recognised during boot mismatch and TS does not work. Is there any ready solution (some script or etc) to solve this problem?

jkfi

You probably found a solution already, but in case someone else wanders in with the same issue, here's what I did to make X use the correct event device automatically. This ugly hack was tested on the A13 Wifi board with Olimex's official Debian image that I have modified a bit (apt-get upgrade + kernel from sunxi git among other things).

Put the below script to file /usr/local/sbin/ts-event-workaround, make it owned by root and writeable and executable by root only:

#!/bin/bash

# if f is a symlink and if it points to eventX (where X is a single digit),
# then modify X touchscreen config:

f=/dev/input/by-path/platform-sun4i-ts-event
cfg=/usr/share/X11/xorg.conf.d/20-ts.conf

if [ -L $f ]; then
  event=$(readlink $f | tr -dc 'a-z0-9')
  if [ $(echo $event|sed s/event[0-9]/thisissomuchfun/g) == "thisissomuchfun" ]; then
    sed -i s/event[0-9]/$event $cfg
  fi
fi


To make this run at system startup, add the following two lines to /etc/rc.local:

# let X know touch panel device name:
/usr/local/sbin/ts-event-workaround


This will not be effective if you're like me and you use a display manager such as lightdm because lightdm starts before rc.local runs. (I only use it because I was unable to get proper shutdown/reboot permissions for non-root users on xfce4 without it even though it really should be possible, see e.g. https://wiki.debian.org/Xfce)

The way I solved this with lightdm is a horrendous, unthinkable but oh so quick thing: I added the line

/usr/local/sbin/ts-event-workaround

to /etc/init.d/lightdm before the line

log_daemon_msg "Starting Light Display Manager" "lightdm"

To me the main reason for this being horrendous is that it will be scrubbed away when lightdm is upgraded. But I'm hoping I'll eventually figure out how to live without lightdm (it eats RAM for no good reason).

Note: since I don't need touch to work on console, this does not do anything to set env variable TSLIB_TSDEVICE that needs to point to the correct touch screen /dev/input/eventX for ts_calibrate and ts_test to work in console. But doing that should be rather trivial (e.g. to ~/.bashrc using a similar script).