multitouch events do not respect swap/invert axes properties

Bug #742567 reported by Timo Kluck
42
This bug affects 11 people
Affects Status Importance Assigned to Milestone
Open Input Framework
Invalid
Undecided
Unassigned
xserver-xorg-input-evdev (Ubuntu)
Won't Fix
Undecided
Unassigned

Bug Description

Binary package hint: xserver-xorg-input-evdev

I'm using the (unstable) evdev driver from the utouch ppa (1:2.6.0-1ubuntu11~utouch2). The bug title says it all: touch and multitouch events are not translated according to the swap/invert axes properties.
---
Architecture: amd64
CompizPlugins: [core,bailer,detection,composite,opengl,decor,mousepoll,vpswitch,regex,animation,snap,expo,move,compiztoolbox,place,grid,imgpng,gnomecompat,wall,ezoom,workarounds,staticswitcher,resize,fade,unitymtgrabhandles,scale,session,unityshell]
CompositorRunning: compiz
DRM.card0.LVDS.1:
 status: connected
 enabled: enabled
 dpms: On
 modes: 1280x800
 edid-base64: AP///////wBMo0FNAAAAAAASAQOAGhB4Cof1lFdPjCcnUFQAAAABAQEBAQEBAQEBAQEBAQEBEhsASVAgNjAQMBMABaMQAAAZAAAADwAAAAAAAAAAACOHAmQAAAAA/gBTQU1TVU5HCiAgICAgAAAA/gAxMjFBVDA5LUgwMQogAB4=
DRM.card0.VGA.1:
 status: disconnected
 enabled: disabled
 dpms: Off
 modes:
 edid-base64:
DistUpgraded: Log time: 2011-03-08 23:26:42.377455
DistroCodename: natty
DistroRelease: Ubuntu 11.04
DistroVariant: ubuntu
DkmsStatus:
 wacom, 1.0.6, 2.6.38-6-generic, x86_64: installed
 wacom, 1.0.6, 2.6.38-7-generic, x86_64: installed
 acpi_call, 0.1, 2.6.38-6-generic, x86_64: installed
 acpi_call, 0.1, 2.6.38-7-generic, x86_64: installed
EcryptfsInUse: Yes
GraphicsCard:
 Intel Corporation Core Processor Integrated Graphics Controller [8086:0046] (rev 02) (prog-if 00 [VGA controller])
   Subsystem: Hewlett-Packard Company Device [103c:1486]
 ATI Technologies Inc Manhattan [Mobility Radeon HD 5000 Series] [1002:68e0] (rev ff) (prog-if ff)
InstallationMedia: Ubuntu 10.04.1 LTS "Lucid Lynx" - Release amd64 (20100816.1)
MachineType: Hewlett-Packard HP TouchSmart tm2 Notebook PC
Package: xserver-xorg-input-evdev 1:2.6.0-1ubuntu11~utouch2
PackageArchitecture: amd64
ProcEnviron:
 LANGUAGE=nl_NL:en
 PATH=(custom, user)
 LANG=nl_NL.UTF-8
 SHELL=/bin/bash
ProcKernelCmdLine: BOOT_IMAGE=/boot/vmlinuz-2.6.38-7-generic root=UUID=20f96611-95a2-48ec-a115-4b01027ce3ae ro splash crashkernel=384M-2G:64M,2G-:128M quiet splash vt.handoff=7
ProcVersionSignature: Ubuntu 2.6.38-7.38-generic 2.6.38
Renderer: Unknown
Tags: natty running-unity ubuntu compiz-0.9
Uname: Linux 2.6.38-7-generic x86_64
UnreportableReason: Dit is geen authentiek Ubuntu-pakket.
UpgradeStatus: Upgraded to natty on 2011-03-25 (0 days ago)
UserGroups: adm admin cdrom dialout lpadmin plugdev sambashare
dmi.bios.date: 06/03/2010
dmi.bios.vendor: Hewlett-Packard
dmi.bios.version: F.05
dmi.board.asset.tag: Base Board Asset Tag
dmi.board.name: 1486
dmi.board.vendor: Hewlett-Packard
dmi.board.version: KBC Version 83.15
dmi.chassis.asset.tag: CNU0281PMS
dmi.chassis.type: 10
dmi.chassis.vendor: Hewlett-Packard
dmi.chassis.version: N/A
dmi.modalias: dmi:bvnHewlett-Packard:bvrF.05:bd06/03/2010:svnHewlett-Packard:pnHPTouchSmarttm2NotebookPC:pvr048A200000252A20001120000:rvnHewlett-Packard:rn1486:rvrKBCVersion83.15:cvnHewlett-Packard:ct10:cvrN/A:
dmi.product.name: HP TouchSmart tm2 Notebook PC
dmi.product.version: 048A200000252A20001120000
dmi.sys.vendor: Hewlett-Packard
version.compiz: compiz 1:0.9.4git20110322-0ubuntu5
version.libdrm2: libdrm2 2.4.23-1ubuntu5
version.libgl1-mesa-glx: libgl1-mesa-glx 7.10.1-0ubuntu3
version.xserver-xorg: xserver-xorg 1:7.6~3ubuntu11
version.xserver-xorg-video-ati: xserver-xorg-video-ati 1:6.14.0-0ubuntu4
version.xserver-xorg-video-intel: xserver-xorg-video-intel 2:2.14.0-4ubuntu4
version.xserver-xorg-video-nouveau: xserver-xorg-video-nouveau 1:0.0.16+git20110107+b795ca6e-0ubuntu6

Revision history for this message
Timo Kluck (tkluck) wrote : BootDmesg.txt

apport information

tags: added: apport-collected compiz-0.9 natty running-unity ubuntu
description: updated
Revision history for this message
Timo Kluck (tkluck) wrote : CurrentDmesg.txt

apport information

Revision history for this message
Timo Kluck (tkluck) wrote : Dependencies.txt

apport information

Revision history for this message
Timo Kluck (tkluck) wrote : GconfCompiz.txt

apport information

Revision history for this message
Timo Kluck (tkluck) wrote : Lspci.txt

apport information

Revision history for this message
Timo Kluck (tkluck) wrote : Lsusb.txt

apport information

Revision history for this message
Timo Kluck (tkluck) wrote : ProcCpuinfo.txt

apport information

Revision history for this message
Timo Kluck (tkluck) wrote : ProcInterrupts.txt

apport information

Revision history for this message
Timo Kluck (tkluck) wrote : ProcModules.txt

apport information

Revision history for this message
Timo Kluck (tkluck) wrote : UdevDb.txt

apport information

Revision history for this message
Timo Kluck (tkluck) wrote : UdevLog.txt

apport information

Revision history for this message
Timo Kluck (tkluck) wrote : UnitySupportTest.txt

apport information

Revision history for this message
Timo Kluck (tkluck) wrote : XorgLog.txt

apport information

Revision history for this message
Timo Kluck (tkluck) wrote : XorgLogOld.txt

apport information

Revision history for this message
Timo Kluck (tkluck) wrote : Xrandr.txt

apport information

Revision history for this message
Timo Kluck (tkluck) wrote : locale.txt

apport information

Revision history for this message
Timo Kluck (tkluck) wrote : monitors.xml.txt

apport information

Revision history for this message
Timo Kluck (tkluck) wrote : peripherals.txt

apport information

Revision history for this message
Timo Kluck (tkluck) wrote : setxkbmap.txt

apport information

Revision history for this message
Timo Kluck (tkluck) wrote : xdpyinfo.txt

apport information

Revision history for this message
Timo Kluck (tkluck) wrote : xkbcomp.txt

apport information

Changed in utouch:
status: New → Invalid
Revision history for this message
Chase Douglas (chasedouglas) wrote :

The evdev driver has the capability to swap and invert axes, but it is not how I would recommend doing this anymore. As you point out, those properties only affect pointer motion events. While we could extend the functionality to touch events, a better resolution would be to use the X server's "Coordinate Transformation Matrix" property.

This bug inspired me to write a wiki page all about coordinate transformation in X :). You can find it at:

https://wiki.ubuntu.com/X/InputCoordinateTransformation

This will properly translate event coordinates for both pointer and touch events, though touch valuators will always be in device coordinates.

Note that while the functionality is difficult and cumbersome to use today, the hope is we will be able to integrate it into some form of display settings UI in the future.

Since there is a better solution for the desired functionality, I'm going to mark this bug as "Won't Fix".

Thanks!

Changed in xserver-xorg-input-evdev (Ubuntu):
status: New → Won't Fix
Revision history for this message
Henrik Rydberg (rydberg) wrote :

Great wiki, Chase.

Revision history for this message
Timo Kluck (tkluck) wrote :

Chase: thanks for the wiki article, it is very helpful! I have found that on my devices, the affine coordinate translation is done in normalized floating point coordinates and not in pixel coordinates. And the normalization is different for different devices. For example, to rotate 180 degrees, I need the following matrix for Wacom Pen input:

xinput set-prop $ID "Coordinate Transformation Matrix" -1.0 0.0 1.0 0.0 -1.0 1.0 0.0 0.0 1.0

(which is very reasonable, and stable even under resolution change -- this would be my preferred behaviour). However, for Wacom Touch input, i need the following:

xinput set-prop $ID "Coordinate Transformation Matrix" -1.0 0.0 0.5 0.0 -1.0 0.5 0.0 0.0 1.0

Should I file a new bug about this?

Revision history for this message
Chase Douglas (chasedouglas) wrote :

Timo,

Thanks for pointing this out! Admittedly, I wrote the wiki article from memory and didn't test out the values. I see now in DeviceSetTransform() in the xserver that the transformation matrix is scaled internally such that the affine coordinate translation is in normalized floating piont coordinates as you note. I'll update the wiki with this new information.

Revision history for this message
Timo Kluck (tkluck) wrote :

Chase: do you have any guess as to why the touch input would be normalized differently (I'm guessing [-0.5, 0.5]) than the pen input ([0.0, 1.0]) ?

Revision history for this message
Timo Kluck (tkluck) wrote :

Wait, I mean [0.0, 0.5] for the touch input.

Revision history for this message
Chase Douglas (chasedouglas) wrote :

Timo,

Please provide the evemu properties file and a sample recording for the touch input device. I'd like to see why you need different normalization values for it.

Thanks!

Revision history for this message
Timo Kluck (tkluck) wrote :

Chase, sorry for not having had time to provide the files that you requested. But I can confirm that the issue with the coordinate matrix has been fixed (by you?) in a recent update (xserver-xorg-input-evdev=1:2.6.0-1ubuntu12 right now). Thanks!

Revision history for this message
David K Levine (david-dklevine) wrote :

Unlike swap axes, the coordinate transformation does not work properly at least not with all devices. First, the wiki is in error, the correct transformation for a rotate left is 0 -1 1 1 0 0 0 0 1 and not 0 -1 0 1 0 0 0 0 1. However with Ubuntu 11.04 and a Lenovo S-10t3 when the axes are reversed with this transformation touching the screen results in the correct location of the pointer, but dragging on the screen causes the pointer to jump wildly from the correct location to an alternative location. It's hard to see in what sense the problem has been fixed by dropping a procedure (swap axes) that worked and replacing it with one (coordinate transformations) that doesn't work.

Revision history for this message
Chase Douglas (chasedouglas) wrote :

Hi David,

Thanks for catching the mistake on the rotation matrix! I didn't have a machine I could test it out on, so I made an educated guess. I have fixed the wiki page.

Are you trying to combine axis swapping in evdev with an input transformation matrix? If so, that would give indeterminate results. If you are using a multitouch screen you need to be using only the input transformation matrix.

Revision history for this message
David K Levine (david-dklevine) wrote :
Download full text (4.2 KiB)

I have tried many combinations. Using only the input transformation matrix with swapping and inversion turned off when the coordinate transformation has the form

0 -1 1 x y 0 0 0 1

where x+y = 1 and x is bigger than about .2 the following unstable behavior exists:

when a horizontal or vertical drag is performed the cursor jumps wildly - it appears to jump between what it should be according to the coordinate transformation and what it would be if x=0 and y=1 (that is if the second line of the matrix was the identity). With a diagonal drag or a touch the cursor appears where it should be. So for example with the correct rotation 0 -1 1 1 0 0 0 0 1 the cursor appears under your finger to the touch or a diagonal drag, but with a vertical or horizontal drag it jumps wildly alternating between where it should be (under your finger) and somewhere else, which appears to be the untransformed input. As if for some reason the evdev driver only applies the transformation at alternate points during a vertical or horizontal drag.

It's pretty odd behavior.

Here is some configuration information:

Xorg.log basic configuration:
X.Org X Server 1.10.1
Release Date: 2011-04-15
[ 6518.203] X Protocol Version 11, Revision 0
[ 6518.203] Build Operating System: Linux 2.6.24-29-server i686 Ubuntu
[ 6518.203] Current Operating System: Linux lev1010 2.6.38-8-generic #42-Ubuntu SMP Mon Apr 11 03:31:50 UTC 2011 i686
[ 6518.203] Kernel command line: BOOT_IMAGE=/vmlinuz-2.6.38-8-generic root=UUID=b3f89a14-b5e9-4389-bde4-378fcc3c8b2a ro quiet splash vt.handoff=7
[ 6518.204] Build Date: 19 April 2011 03:33:17PM
[ 6518.204] xorg-server 2:1.10.1-1ubuntu1 (For technical support please see http://www.ubuntu.com/support)
[ 6518.204] Current version of pixman: 0.20.2

Xorg.log for Cando:
[ 6518.633] (II) config/udev: Adding input device Cando Corporation Cando 10.1 Multi Touch Panel with Controller (/dev/input/event10)
[ 6518.633] (**) Cando Corporation Cando 10.1 Multi Touch Panel with Controller: Applying InputClass "evdev touchscreen catchall"
[ 6518.633] (II) Using input driver 'evdev' for 'Cando Corporation Cando 10.1 Multi Touch Panel with Controller'
[ 6518.633] (II) Loading /usr/lib/xorg/modules/input/evdev_drv.so
[ 6518.633] (**) Cando Corporation Cando 10.1 Multi Touch Panel with Controller: always reports core events
[ 6518.633] (**) Cando Corporation Cando 10.1 Multi Touch Panel with Controller: Device: "/dev/input/event10"
[ 6518.634] (--) Cando Corporation Cando 10.1 Multi Touch Panel with Controller: Found absolute axes
[ 6518.635] (--) Cando Corporation Cando 10.1 Multi Touch Panel with Controller: Found x and y absolute axes
[ 6518.636] (--) Cando Corporation Cando 10.1 Multi Touch Panel with Controller: Found absolute touchscreen
[ 6518.636] (II) Cando Corporation Cando 10.1 Multi Touch Panel with Controller: Configuring as touchscreen
[ 6518.636] (**) Cando Corporation Cando 10.1 Multi Touch Panel with Controller: YAxisMapping: buttons 4 and 5
[ 6518.636] (**) Cando Corporation Cando 10.1 Multi Touch Panel with Controller: EmulateWheelButton: 4, EmulateWheelInertia: 10, EmulateWheelTimeout: 200
[ 6518.636] (**) Option "config_info" ...

Read more...

Revision history for this message
Chase Douglas (chasedouglas) wrote :

David,

Oh yes, now I know what's going on. This was a bug reported upstream that we've been discussing a fix for. The issue is the mixing of coordinate transformation and the new masked valuators. A simple patch should fix things up.

Can you file a new bug for this and assign it to me? This is really a separate issue from the original bug report. I will make a test package and attach it to the new bug.

Thanks!

Revision history for this message
Stefan Löffler (st.loeffler) wrote :

The bug reported by David affects me, too (using a AsusTek, Inc. MultiTouch(TTI) on an Asus EeePC T101MT)
I've reported it as separate bug (https://bugs.launchpad.net/ubuntu/+source/xserver-xorg-input-evdev/+bug/774938), but I don't seem to be able to assign it to you.

Revision history for this message
Favux (favux-is) wrote :

Hi Timo, Chase, and David,

I am not sure you are using the correct CTM's. Hopefully the ones I have posted here: http://ubuntuforums.org/showthread.php?t=1656089 are correct.

But I agree with you Chase and that the original bug should be patched so evdev can again swap and invert axes. I believe Gentoo has already implemented this fix.

Revision history for this message
Favux (favux-is) wrote :

Sorry, I should have mentioned they are in Appendix 1 at the bottom of the HOW TO.

Revision history for this message
Stefan Löffler (st.loeffler) wrote :

@Favux: I tested your matrices, but it seems to me that left (ccw) and right (cw) are exchanged. Anyway, the wild cursor jumps reported by David persist (and which Chase already acknowledged as an issue).

Revision history for this message
Favux (favux-is) wrote :

Thanks Stefan,

I'll check that out. They seemed to work OK for me. I noticed a jittery cursor when in the portrait orientations too, but I had chalked that up to placing my Wacom Bamboo Pen and Touch tablet's touch on the evdev driver. So that's what the CTM and new masked valuator bug is about? OK.

Revision history for this message
Chris MacGregor (chris-launchpad-net-cybermato) wrote :

The solution for the CTM problem (which is what causes the wacky cursor jumping) is this patch, which was accepted into upstream on 19 Nov 2012; it is not yet in precise-proposed, but I was able to rebuild xorg-server-1.13.0 (from 12.10) with this patch and the problem went away:

http://<email address hidden>/msg33742.html

There is another version of the patch floating around somewhere if you want to fix 12.04.

IMHO, there is no good reason to break evdev's swap and invert properties, though. For the simple rotation case, they seem like the obvious right thing to use. Why should they not work?

Revision history for this message
Chris MacGregor (chris-launchpad-net-cybermato) wrote :

Oops, sorry, I mean quantal-proposed. (Though of course it's not in precise-proposed, either.)

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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