evtouch works incorrectly when the screen is left or right rotated

Bug #222164 reported by gborzi
16
This bug affects 1 person
Affects Status Importance Assigned to Milestone
xf86-input-evtouch (Ubuntu)
Fix Released
High
Oliver Grawert
Intrepid
Won't Fix
High
Oliver Grawert

Bug Description

I installed Hardy Heron 8.04 on my HP tx1350el and got the touch screen to work using the xserver-xorg-input-evtouch 0.8.7-3ubuntu1 version. After calibration I got it to work, and it works quite well as long as the screen is in its normal position (i.e. xrandr -o normal) or in the inverted position (i.e. xrandr -o inverted), but when it is left or right rotated (i.e. xrandr -o left or xrandr -o right) the position of the cursor and the pen are different. I have noticed that touching the rotated upper left corner the cursor appears very close to the touching zone, i.e. it's almost correct, but in other zones the cursor appears in totally incorrect position. More precisely, if I touch the rotated upper right corner the cursor moves in a position close to the middle upper part of the rotated screen, if I touch the rotated screen in the middle of the left border, the cursor moves to the lower left corner. In other words, in the rotated screen pen touches get their vertical coordinates amplified and horizontal coordinates reduced. Something similar happens if I change the resolution. I made the calibration at 1280x800, so that other resolution have smaller sizes and the pen touches coordinated are both reduced.

Revision history for this message
gborzi (gborzi) wrote :

I managed to fix this problem, which is confirmed by other users in some of the last posts of this thread
http://ubuntuforums.org/showthread.php?t=442483
Basically, I edited the evtouch.c source file in such a way that screen_width and screen_height are swapped if there is a left or right rotation. Unfortunately, this doesn't fix the problem for resolution changes.

Revision history for this message
Michał Karnicki (karni) wrote :

Confirming the bug. Thanks for your effort gborzi.

Bryce Harrington (bryce)
Changed in xf86-input-evtouch:
assignee: nobody → bryceharrington
importance: Undecided → High
status: New → Triaged
Bryce Harrington (bryce)
Changed in xf86-input-evtouch:
assignee: bryceharrington → nobody
Revision history for this message
Oliver Grawert (ogra) wrote :

how is that different to use the
Option "Rotate" "cw"
or
Option "Rotate" "ccw"
settings in xorg.conf (or with hal in intrepid) their purpose is exactly to rotate the calibration in such cases, does the patch above give any advantage over using these driver options ?

Revision history for this message
gborzi (gborzi) wrote :

I tried the Rotate option with both values "cw" and "ccw", but they didn't worked. Frankly, I'm not sure to have understood what this option should do. Also, there is the problem with the resolution change.

Revision history for this message
Oliver Grawert (ogra) wrote :

the resolution shouldnt change at all if you only rotate it, it should just switch from 1280x800 to 800x1280, thats what the rotate CW (clockwise) and CCW (counter clockwise) options are supposed to catch.

Revision history for this message
gborzi (gborzi) wrote :

Hello Olivier,
I know that the resolution doesn't change with a rotation, it's just a switch. I noticed that the incorrect behaviour *also* happens when I change the resolution, i.e. from 1280x800 to 1024x768.
As I wrote before, the Rotate option doesn't work, and what I mean by "I'm not sure to have understood" is that it looks strange (at least for me) to configure the touchscreen to make it only work when it is rotated. With the patch it works for any rotation.

Bryce Harrington (bryce)
Changed in xf86-input-evtouch:
assignee: nobody → ogra
Revision history for this message
Nicolas Piguet (npiguet) wrote :

I can confirm that this happens to me too. When I change the screen orientation to left or right with xrandr, it seems like the pointer position is calculated using the wrong coordinates on the wrong axis.

Will it be possible to have a fix for this in 8.10?

gborzi, could you post a link to the post where you have the patch for the evtouch driver? The thread you linked to is 100 pages long, and I have no idea where to start looking...

Revision history for this message
Nicolas Piguet (npiguet) wrote :

oh, sorry gborzi. I didn't notice the patch was attached to the bug report.

Anyway, will it be possible to have this fix included in hardy? Editing xorg.conf is not so fun, especially when it can be avoided.

Revision history for this message
gborzi (gborzi) wrote :

Hello Nicolas,
in that thread I also posted a deb package (compiled for amd64) for xserver-xorg-input-evtouch built with the patch I suggested. The post is this one http://ubuntuforums.org/showpost.php?p=4945143&postcount=998
It can be useful if you've installed 64-bit ubuntu 8.04.

Revision history for this message
Nicolas Piguet (npiguet) wrote :

Actually, I would need it to work on 8.10 32 bits. I have a Fujitsu U810, and intrepid has apparently fixed a lot of things that were broken in 8.04, including touchscreen support and XRandR compatibility with Compiz. Unfortunately, Rotation still cannot really be used because it is only useful in tablet mode, where the only input method is the touchscreen, and this touchscreen bug screws it up.

Is there a tutorial somewhere that explains how to build your own package for ubuntu? I guess I'll just use my own package until this fix is released for 8.10

Revision history for this message
gborzi (gborzi) wrote :

Hello Nicolas,
I've not written a tutorial for rebuilding the package with the suggested patch because nobody asked for it, until today. So, here is a brief howto:
1) make a build directory, move there and get the source for the original package:
mkdir mybuilddir (or whatever name you like)
cd mybuilddir
apt-get source xf86-input-evtouch
2) install the required build libraries
sudo apt-get build-dep xf86-input-evtouch
3) move to the patches directory and add the attached patch
cd xf86-input-evtouch-0.8.7/debian/patches
mv <where you downloaded the patch attached to this message>/09_lrrotation_fix.patch .
echo 09_lrrotation_fix.patch >> series
4) modify the debian/changelog file to have a different version number for the package
vi ../changelog
and add something like this
----
xf86-input-evtouch (0.8.7-3ubuntu2) hardy; urgency=low

  * Adds a patch to fix left and right screen rotation

 -- Giuseppe Borzi <email address hidden> Fri, 09 May 2008 14:32:28 +0200

----
5) go to the xf86-input-evtouch-0.8.7 directory and start the building process
cd ../..
dpkg-buildpackage -rfakeroot (perhaps you'll need to install fakeroot, I don't remember if it's installed by build-essential)

In a short time the package should be compiled, don't worry if it complains about the inability to sign the package.
Please let me know of any problem you encounter following this howto. It surely works on 8.04, hope it'll work on 8.10.

Revision history for this message
Nicolas Piguet (npiguet) wrote :

Thanks, I was able to build the package myself and confirm that it works. I read the whole Packaging guide and your short tutorial to learn how to do it with debuild and quilt.

I have noticed another problem though. My touch panel is slightly wider than my display panel, while being exactly the same height. this means that the calibration of the X axis reports the leftmost and rightmost areas of the touch panel as negative pixel positions because my stylus touches the touch panel, but is not actually over the LCD screen. This works great in normal mode.

When I turn the screen to the left/right with XRandR the calibration of the X axis is applied to the Y axis and vice-versa, which means that I can never really reach the edges of my screen in one direction, and reach it too quickly in the other. I'll have a look at that evtouch.c to see how I can fix that additional problem.

Unless somebody else has another way to solve the problem, of course.

Revision history for this message
Eric Drechsel (ericdrex) wrote :

Nicolas: perhaps the calibration values aren't getting transformed? I will build and test the patch, and try to understand what's going on with the calibration values (I will need this I think because I have fairly large corrections in my toughbook T2 config). Thanks for jumping on this issue gborzi, this driver doesn't get enough attention. I'd like to see a single upstream source for it. Right now there is conan and Debian has their own funky git repository, with much drift. Maybe conan could be convinced to put his work on github or something.

Revision history for this message
Eric Drechsel (ericdrex) wrote :

Kenan just made a new release of evtouch (0.8.8) including gborzi's patch see http://www.conan.de/touchscreen/CHANGELOG.evtouch

Revision history for this message
Oliver Grawert (ogra) wrote :

a package including teh fix (xf86-input-evtouch_0.8.7-4build1.1) was just uploaded to intrepid-proposed, please test and give feedback so it can be moved to intrepid-updates asap

Changed in xf86-input-evtouch:
status: Triaged → In Progress
Oliver Grawert (ogra)
Changed in xf86-input-evtouch:
assignee: nobody → ogra
importance: Undecided → High
milestone: none → intrepid-updates
status: New → In Progress
Revision history for this message
Martin Pitt (pitti) wrote :

Oli, I rejected your upload. Please use an ubuntu version number (introduces changes) and run update-maintainer, so that the package conforms to the Maintainer policy and can be copied to jaunty as well (no separate jaunty upload necessary).

Was this sent to upstream?

Revision history for this message
Ernesto Manriquez (alejandronova) wrote :

Using evtouch 0.8.8 on the Ibex, binaries downloaded from www.conan.de/touchscreen/evtouch.html. It solves (wonderfully) the bug, but I don't know how to make the driver recognize my "ink" output. In other words, I can't drag anything with the pen like I can with 0.8.7 provided by Ubuntu.

I consider the upgrade to 0.8.8 a priority for the Ibex, because 0.8.8 solves another annoying issue I had with my tx1000: low resolution scanning. With 0.8.7, the pen input for programs like Xournal is... jerky. With 0.8.8 is as smooth as Vista.

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package xf86-input-evtouch - 0.8.8-0ubuntu1

---------------
xf86-input-evtouch (0.8.8-0ubuntu1) jaunty; urgency=low

  * New upstream release, packaged by Thomas Jaeger (<email address hidden>)
    Thanks a lot for fixing the header issues !! (LP: #312098)
    - fix rotation issues (LP: #222164)
  * 20_fix_calibrate_submission_directions.patch, point lshal submission to a
    LP bug instead of pointing people to a subscription only
    mailing list (LP: #307503)

 -- Oliver Grawert <email address hidden> Wed, 14 Jan 2009 14:04:58 -0500

Changed in xf86-input-evtouch:
status: In Progress → Fix Released
Revision history for this message
Ernesto Manriquez (alejandronova) wrote :

Marvellous. Now everyone is waiting for the Intrepid backport.

Thanks, Thomas. This is going on route!

Revision history for this message
Ben Andersen (ben72) wrote :

A backport for Intrepid would be very useful!

Revision history for this message
schizo1 (floriangolemo) wrote :

Confirmed!
I need that backport too - tried it already myself using Prevu v.0.5.0 from Repos but failed due to a error during compilation:
"...
make[2]: Entering directory `/var/cache/prevu/src/23898/xf86-input-evtouch-0.8.8'
/bin/bash ./libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -DXINPUT -Wall -g -O2 -I/usr/include/xorg -I/usr/include/pixman-1 -Wall -g -O2 -MT evtouch_drv_la-evtouch.lo -MD -MP -MF .deps/evtouch_drv_la-evtouch.Tpo -c -o evtouch_drv_la-evtouch.lo `test -f 'evtouch.c' || echo './'`evtouch.c
libtool: compile: gcc -DHAVE_CONFIG_H -I. -DXINPUT -Wall -g -O2 -I/usr/include/xorg -I/usr/include/pixman-1 -Wall -g -O2 -MT evtouch_drv_la-evtouch.lo -MD -MP -MF .deps/evtouch_drv_la-evtouch.Tpo -c evtouch.c -fPIC -DPIC -o .libs/evtouch_drv_la-evtouch.o
evtouch.c: In function 'EVTouchProcessRel':
evtouch.c:354: warning: unused variable 'dummy'
evtouch.c: In function 'DeviceInit':
evtouch.c:656: warning: passing argument 3 of 'InitValuatorClassDeviceStruct' makes pointer from integer without a cast
evtouch.c:656: error: too few arguments to function 'InitValuatorClassDeviceStruct'
evtouch.c: In function 'ConvertProc':
evtouch.c:935: warning: ignoring return value of 'write', declared with attribute warn_unused_result
evtouch.c:936: warning: ignoring return value of 'write', declared with attribute warn_unused_result
make[2]: *** [evtouch_drv_la-evtouch.lo] Error 1
make[2]: Leaving directory `/var/cache/prevu/src/23898/xf86-input-evtouch-0.8.8'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/var/cache/prevu/src/23898/xf86-input-evtouch-0.8.8'
make: *** [build-stamp] Error 2
dpkg-buildpackage: failure: debian/rules build gave error exit status 2
..."

So please provide help.

Revision history for this message
Loïc Minier (lool) wrote :

Wontfix in intrepid at this point...

Changed in xf86-input-evtouch (Ubuntu Intrepid):
status: In Progress → Won't Fix
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.