Touch rotation on Ubuntu 18.04 and 20.04

Peter Hutterer peter.hutterer at who-t.net
Thu Oct 22 07:10:52 UTC 2020


On Thu, Oct 22, 2020 at 02:39:19PM +0900, Hugh Chang wrote:
> Dear Peter Hutterer,
> 
> >>     Driver "evdev" for Ubuntu 16.04, "libinput" for Ubuntu 18.04/20.04
> >
> > just skip this line and let the default snippets take care of it. Given that
> > this is a server option anyway, you don't need to assign a driver.
> 
> I removed the "Driver" line and verified that it works well on Ubuntu 16.04,
> 18.04, and 20.04. Thank you very much for the great tip.
> 
> > run xinput watch-props "whatever device name" to check if it is being reset.
> > could be that something in your desktop environment is interfering, but
> > given it works on 20.04 whatever it is is likely fixed since.
> 
> I added
>     /home/touch/watch-matrix.sh &
>     /home/touch/set-matrix.sh &
> to ~/.profile.
> 
>     touch at touchDT:~$ cat watch-matrix.sh
>     #!/bin/bash
>     /usr/bin/gnome-terminal -e "/usr/bin/xinput watch-props 10"

ftr, you should really use the device name instead of the id since the id is
not guaranteed to be static.

> 
>     touch at touchDT:~$ cat set-matrix.sh
>     #!/bin/bash
>     sleep 30
>     /usr/bin/xinput set-prop 10 "Coordinate Transformation Matrix" 0 -0.5 0.5 1
> 0 0 0 0 1
> 
> The output was
> 
> Device 'Kortek Kortek Touch':
>     Device Enabled (161):    1
>     Coordinate Transformation Matrix (163):    0.000000, -0.500000, 0.500000,
> 1.000000, 0.000000, 0.000000, 0.000000, 0.000000, 1.000000
>     libinput Calibration Matrix (298):    1.000000, 0.000000, 0.000000,
> 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 1.000000
>     libinput Calibration Matrix Default (299):    1.000000, 0.000000, 0.000000,
> 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 1.000000
>     libinput Send Events Modes Available (281):    1, 0
>     libinput Send Events Mode Enabled (282):    0, 0
>     libinput Send Events Mode Enabled Default (283):    0, 0
>     Device Node (284):    "/dev/input/event3"
>     Device Product ID (285):    10597, 20515
> Property 'Coordinate Transformation Matrix' changed.
>     Coordinate Transformation Matrix (163):    1.000000, 0.000000, 0.000000,
> 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 1.000000
> Property 'Coordinate Transformation Matrix' changed.
>     Coordinate Transformation Matrix (163):    1.000000, 0.000000, 0.000000,
> 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 1.000000
> Property 'Coordinate Transformation Matrix' changed.
>     Coordinate Transformation Matrix (163):    1.000000, 0.000000, 0.000000,
> 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 1.000000
> Property 'Coordinate Transformation Matrix' changed.
>     Coordinate Transformation Matrix (163):    1.000000, 0.000000, 0.000000,
> 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 1.000000
> Property 'Coordinate Transformation Matrix' changed.
>     Coordinate Transformation Matrix (163):    1.000000, 0.000000, 0.000000,
> 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 1.000000
> Property 'Coordinate Transformation Matrix' changed.
>     Coordinate Transformation Matrix (163):    1.000000, 0.000000, 0.000000,
> 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 1.000000
> Property 'Coordinate Transformation Matrix' changed.
>     Coordinate Transformation Matrix (163):    1.000000, 0.000000, 0.000000,
> 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 1.000000
> Property 'Coordinate Transformation Matrix' changed.
>     Coordinate Transformation Matrix (163):    0.000000, -0.500000, 0.500000,
> 1.000000, 0.000000, 0.000000, 0.000000, 0.000000, 1.000000
> 
> So I could see that my matrix value is undesirably overwritten 7 times to the
> identy matrix on Ubuntu 18.04.
> Now I want to identify what package I should update on Ubuntu 18.04 to solve
> this problem.

my bet is mutter (or gnome-settings-daemon on older versions) since it's the
only one I know of that would do screen mapping. but I don't know what
versions 18.04 ships and even then I wouldn't know the details, especially
not for ubuntu.

Cheers,
   Peter

> It is because my customer won't change the OS version and I need to recommend
> things to solve it.
> Would you recommend which are the possible candidate packages to update,
> please?
> I'll appreciate any clue and I'm willing to try as much as I can.
> My current installation is the clean ubuntu-18.04.5-desktop-amd64.iso.
> 
> > GNOME's mutter has an automatic touch screen mapping using heuristics. This
> > may be the reason it fails on 18.04 if the heuristics get confused.
> 
> Thank you very much for this great information.
> I'll investigate the source code of GNOME's mutter to find why EETI
> (eGalaxTouch) works well and the other does not on Ubuntu 20.04 (not 18.04).
> 
> Best regards,
> Hugh Chang
> 
> 


More information about the xorg mailing list