Touchscreen troubles

Peter Hutterer peter.hutterer at who-t.net
Sun Dec 13 16:07:04 PST 2009


On Fri, Dec 11, 2009 at 10:41:18PM +0100, Petr Štetiar wrote:
> I'm trying to get working 22" resistive 5-wire touchscreen with USB
> controller, it's ET&T TC5UH[1]. I'm using Ubuntu 9.04 with Xorg server 1.6.0,
> evdev version 2.3.2 compiled manualy. I've set calibration[1] gathered using
> values from kernel printk. It kind of works, but only on half of the screen,
> top-lef part:
> 
> <crappy-ascii-art>
> 
>        [x=284; y=279]      [x=1846; y=230]          [x=3633; y=189]
> 		 +-----------------+-------------------+
> 		 |                                .  / |
> 		 |                           .  /      |
> 		 |  working part         . /           |
> 		 |                   . /               |
> [x=209; y=1914]+               . + [x=1352; y=1697]  + [x=2697; y=1212]
> 		 |           . /                       |
> 		 |       . /          not working      |
> 		 |   . /              part             |
> 		 | /                                   |
> 		 +-----------------+-------------------+
>        [x=165; y=3652]      [x=875; y=3023]        [x=1693; y=2136]

the evdev calibration won't help much with this, it addresses a different
issue that doesn't apply for your device. the calibration principle in evdev
is aimed at devices that report points within a rectangular area that's not
the same as the one reported by the kernel.
e.g. if the kernel reports 0/0 to 100/100 but the actual device reports
25/25 to 75/75 - that's what the calibration can fix.

in your case, coordinates aren't strictly rectangular. top right has x of
3633, whereas bottom right has an x of 1693, approximately half of it. the Y
coordinate is similar though not quite as extreme.
This explains the cutoff, from evdev's POV the x coordinate 2697 (right-hand
edge on your diagram) is a bit over half-way into the area (assuming 3633 as
max). evdev would map coordinates in the bottom right half to some 'random'
coordinates into the top left half.

evdev doesn't have any facilities yet to cope with the scaling needed for
this device. You'd have to start implementing your own mapping system and
plug it into evdev. sorry.

Cheers,
  Peter



More information about the xorg mailing list