Touchscreen troubles
Petr Štetiar
ynezz at true.cz
Sun Dec 13 14:13:50 PST 2009
Petr Štetiar <ynezz at true.cz> [2009-12-11 22:41:18]:
> Hi,
>
> 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]
>
> </crappy-ascii-art>
>
> If I touch bottom-right corner I get from kernel driver x=1685, y=2220 and
> from xidump x=1785, y=2383 and it seems like almost correct values, but cursor
> is moving only in top-left part, near middle of the screen. I tried without
> calibration values also, swapping axes, but I can't get it working. For me, it
> seems, that the kernel reported and evdev reported values are correct, but
> it's then wrongly interpreted somewhere in Xorg code, and pointer doesn't move
> correctly.
Ok, I've added verbose debug code into xserver and here is what I've observed
so far(sorry, it's not linewrapped, but it should be more readable):
---- [start of log] ------------------------------------------------------------------------------
Touchscreen "calibrated" with:
------------------------------
Evdev Axis Calibration (225): 66, 2933, 45, 3257
Touch in top-right corner:
--------------------------
kernel:
~~~~~~~
[100077.271713] tc5uh x: 3639 y: 198 touch: 1)
xserver:
~~~~~~~~
(II) evdev: touchscreen: num_valuators: 2 x: 4095 y: 181
(II) [!] XINPUT: called with x: 4095 y: 181 num: 2.
(II) [!] XINPUT: pointer is absolute.
(II) [!] XINPUT: have XFreeXDGA.
(II) [!] XINPUT: if (num_valuators >= 1 && first_valuator <= 1) {
(II) [!] XINPUT: if (first_valuator == 0) dx is now: 4095
(II) [!] XINPUT: if (is_absolute) { dx is now: 2 last.valuators[0]=4093
(II) [!] XINPUT: if (first_valuator == 1 || num_valuators >= 2) dy is now: 181
(II) [!] XINPUT: if (is_absolute) { dy is now: -7 last.valuators[1]=188
(II) [!] XINPUT: before if (DGAStealMotionEvent(device, index=0, dx=2, dy=-7)) { return; }
(II) [!] DGA: DGAStealMotionEvent called with index=0, dx=2, dy=-7));
(II) [!] DGA: no direct mode.
(II) [!] XINPUT: GetPointerEvents() x: 4095 y 181 num: 2.
[!] DIX: GetPointerEvents() called with num_valuators: 2 x: 4095 y: 181
[!] DIX: GetPointerEvents() continues...
[!] DIX: GetPointerEvents() calling moveAbsolute with num_valuators: 2 x: 4095 y: 181 screen: 1680x1050
[1] [!] DIX: GetPointerEvents() before getValuatorEvents num_valuators: 2 x: 4093 y: 181 root_x: 1679 root_y: 46
Touch in bottom-right corner:
-----------------------------
kernel:
~~~~~~~
[99979.098016] tc5uh x: 1686 y: 2233 touch: 0)
xserver:
~~~~~~~~
(II) evdev: touchscreen: num_valuators: 2 x: 2311 y: 2794
(II) [!] XINPUT: called with x: 2311 y: 2794 num: 2.
(II) [!] XINPUT: pointer is absolute.
(II) [!] XINPUT: if (num_valuators >= 1 && first_valuator <= 1) {
(II) [!] XINPUT: if (first_valuator == 0) dx is now: 2311
(II) [!] XINPUT: if (is_absolute) { dx is now: -1782 last.valuators[0]=4093
(II) [!] XINPUT: if (first_valuator == 1 || num_valuators >= 2) dy is now: 2794
(II) [!] XINPUT: if (is_absolute) { dy is now: 2613 last.valuators[1]=181
(II) [!] XINPUT: before if (DGAStealMotionEvent(device, index=0, dx=-1782, dy=2613)) { return; }
(II) [!] DGA: DGAStealMotionEvent called with index=0, dx=-1782, dy=2613));
(II) [!] DGA: no direct mode.
(II) [!] XINPUT: GetPointerEvents() x: 2311 y 2794 num: 2.
[!] DIX: GetPointerEvents() called with num_valuators: 2 x: 2311 y: 2794
[!] DIX: GetPointerEvents() continues...
[!] DIX: GetPointerEvents() calling moveAbsolute with num_valuators: 2 x: 2311 y: 2794 screen: 1680x1050
[2] [!] DIX: GetPointerEvents() before getValuatorEvents num_valuators: 2 x: 2311 y: 2794 root_x: 948 root_y: 716
---- [end of log] ------------------------------------------------------------------------------
Comments:
~~~~~~~~~
1. Correct behavior: root_x is 100% correct, root_y is off by 46 points, but this can be tweaked by calibration value
2. Wrong behavior: root_x should be same as in [1] about 1679 points, and root_y should be aroung 1050 points but is
half of the value only, 716 points
Does this shed some more light into my issue?
-- ynezz
More information about the xorg
mailing list