touchscreen inversion stopped working PIXEL
I updated my RPi-based kiosk project to use the latest Jessie/Pixel distro. I am using a rotated (vertical) RPi touchscreen and the rotation looks correct but the touch functionality is no longer inverted as it was before the upgrade. In other words the display is correctly rotated visually and the mouse works properly but the touch is not "inverted".
This was handled in the previous version of Jesse in a shell script executed on startup with these lines:
xinput --set-prop 'FT5406 memory based driver' 'Evdev Axis Inversion' 0 1
xinput --set-prop 'FT5406 memory based driver' 'Evdev Axes Swap' 1
I tried to run the line in terminal (tty0) and it says:
property 'Evdev Axis Inversion' doesn't exist, you need to specify its type and format
I also notice that the same error pops up in a console window when I boot up, when the shell script is executed.
Can anyone help me?
Also the Pixel interface seems sluggish, I have to hold the mouse down for a few extra beats to get it to trigger - like when I try to open a terminal window from the top menu bar or shutdown with the mouse
This was handled in the previous version of Jesse in a shell script executed on startup with these lines:
xinput --set-prop 'FT5406 memory based driver' 'Evdev Axis Inversion' 0 1
xinput --set-prop 'FT5406 memory based driver' 'Evdev Axes Swap' 1
I tried to run the line in terminal (tty0) and it says:
property 'Evdev Axis Inversion' doesn't exist, you need to specify its type and format
I also notice that the same error pops up in a console window when I boot up, when the shell script is executed.
Can anyone help me?
Also the Pixel interface seems sluggish, I have to hold the mouse down for a few extra beats to get it to trigger - like when I try to open a terminal window from the top menu bar or shutdown with the mouse
Re: touchscreen inversion stopped working PIXEL
I have the same problem...
-
- Raspberry Pi Engineer & Forum Moderator
- Posts: 6733
- Joined: Wed Aug 17, 2011 7:41 pm
- Location: Cambridge
Re: touchscreen inversion stopped working PIXEL
How are you rotating the display? (i.e. have you added a line to config.txt?)
Re: touchscreen inversion stopped working PIXEL
Yes,
in config.txt I have: display_rotate=3 (rotate display)
and after boot I run script with:
xinput set-prop 'FT5406 memory based driver' 'Evdev Axes Swap' 1
xinput --set-prop 'FT5406 memory based driver' 'Evdev Axis Inversion' 1 0
(rotate touchscreen).
Until yesterday everything worked, OK, after system upgrade rotate touchscreen stopped working.
Rotate display is OK, rotate touchscreen not.
in config.txt I have: display_rotate=3 (rotate display)
and after boot I run script with:
xinput set-prop 'FT5406 memory based driver' 'Evdev Axes Swap' 1
xinput --set-prop 'FT5406 memory based driver' 'Evdev Axis Inversion' 1 0
(rotate touchscreen).
Until yesterday everything worked, OK, after system upgrade rotate touchscreen stopped working.
Rotate display is OK, rotate touchscreen not.
-
- Raspberry Pi Engineer & Forum Moderator
- Posts: 6733
- Joined: Wed Aug 17, 2011 7:41 pm
- Location: Cambridge
Re: touchscreen inversion stopped working PIXEL
I don't have an LCD display with me - can test tomorrow.
What does
report?
What does
Code: Select all
xinput list
xinput list-props 'FT5406 memory based driver'
Re: touchscreen inversion stopped working PIXEL
xinput list write:
⎜ ↳ Virtual core pointer id=2 [master pointer (3)]
⎜ ↳ Virtual core XTEST pointer id=4 [slave pointer (2)]
⎜ ↳ FT5406 memory based driver id=7 [slave pointer (2)]
⎜ ↳ USB Mouse id=8 [slave pointer (2)]
⎣ Virtual core keyboard id=3 [master keyboard (2)]
↳ Virtual core XTEST keyboard id=5 [slave keyboard (3)]
↳ CHICONY USB Keyboard id=6 [slave keyboard (3)]
xinput list-props 'FT5406 memory based driver' write:
Device Enabled (114): 1
Coordinate Transformation Matrix (115): 1.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 1.000000
libinput Calibration Matrix (252): 1.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 1.000000
libinput Calibration Matrix Default (253): 1.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 1.000000
libinput Send Events Modes Available (234): 1, 0
libinput Send Events Mode Enabled (235): 0, 0
libinput Send Events Mode Enabled Default (236): 0, 0
Device Node (237): "/dev/input/event1"
Device Product ID (238): 0, 0
libinput Horizontal Scroll Enabled (239): 0
⎜ ↳ Virtual core pointer id=2 [master pointer (3)]
⎜ ↳ Virtual core XTEST pointer id=4 [slave pointer (2)]
⎜ ↳ FT5406 memory based driver id=7 [slave pointer (2)]
⎜ ↳ USB Mouse id=8 [slave pointer (2)]
⎣ Virtual core keyboard id=3 [master keyboard (2)]
↳ Virtual core XTEST keyboard id=5 [slave keyboard (3)]
↳ CHICONY USB Keyboard id=6 [slave keyboard (3)]
xinput list-props 'FT5406 memory based driver' write:
Device Enabled (114): 1
Coordinate Transformation Matrix (115): 1.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 1.000000
libinput Calibration Matrix (252): 1.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 1.000000
libinput Calibration Matrix Default (253): 1.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 1.000000
libinput Send Events Modes Available (234): 1, 0
libinput Send Events Mode Enabled (235): 0, 0
libinput Send Events Mode Enabled Default (236): 0, 0
Device Node (237): "/dev/input/event1"
Device Product ID (238): 0, 0
libinput Horizontal Scroll Enabled (239): 0
Re: touchscreen inversion stopped working PIXEL
But xinput set-prop 'FT5406 memory based driver' 'Evdev Axes Swap' 1 write:
property 'Evdev Axes Swap' doesn't exist, you need to specify its type and format
property 'Evdev Axes Swap' doesn't exist, you need to specify its type and format
Re: touchscreen inversion stopped working PIXEL
On the kernel version 4.4.38 is everything okay but on the version 4.4.43 it writes this one error.
Re: touchscreen inversion stopped working PIXEL
Just to be clear: the display is visually rotated by putting
into /boot/config.txt
The xinput commands I (we) put in: /etc/xdg/lxsession/LXDE-pi/autostart
are to remap the touchscreen input.
-madbutter
Code: Select all
display_rotate=1
The xinput commands I (we) put in: /etc/xdg/lxsession/LXDE-pi/autostart
Code: Select all
xinput --set-prop 'FT5406 memory based driver' 'Evdev Axis Inversion' 0 1
xinput --set-prop 'FT5406 memory based driver' 'Evdev Axes Swap' 1
-madbutter
-
- Raspberry Pi Engineer & Forum Moderator
- Posts: 6733
- Joined: Wed Aug 17, 2011 7:41 pm
- Location: Cambridge
Re: touchscreen inversion stopped working PIXEL
I've tested with latest apt-get kernel (Linux domnfs 4.4.38-v7+ #938 SMP Thu Dec 15 15:22:21 GMT 2016 armv7l GNU/Linux) which worked.DidaJI wrote:On the kernel version 4.4.38 is everything okay but on the version 4.4.43 it writes this one error.
I've tested after rpi-update (Linux domnfs 4.4.43-v7+ #948 SMP Sun Jan 15 22:20:07 GMT 2017 armv7l GNU/Linux) and that is also working.
Are you saying this doesn't work for you?
i.e. does reverting to 4.4.38 kernel work and updating to 4.4.43 kernel fails?
-
- Raspberry Pi Engineer & Forum Moderator
- Posts: 6733
- Joined: Wed Aug 17, 2011 7:41 pm
- Location: Cambridge
Re: touchscreen inversion stopped working PIXEL
Okay I have reproduced. Seems it is an apt-get upgrade of one the X packages has switched form using evdev to libinput.
While this can be reverted, this is how Debian Stretch works so it is probably best to adjust to the new world.
I think you want to use the tranformation matrix to swap the coordinates around. I think this is what you want:
See: https://wiki.ubuntu.com/X/InputCoordinateTransformation
While this can be reverted, this is how Debian Stretch works so it is probably best to adjust to the new world.
I think you want to use the tranformation matrix to swap the coordinates around. I think this is what you want:
Code: Select all
xinput --set-prop 'FT5406 memory based driver' 'Coordinate Transformation Matrix' 0 1 0 -1 0 1 0 0 1
Re: touchscreen inversion stopped working PIXEL
Didn't seem to work for me. I tried it in a terminal and it just sits there with a > until I Ctrl-C out (and there is no change to the touch orientation). If I hit return it just puts a > on a new line. I then put it in the shell script that contained the old command (and commented out the old Evdev commands) and re-started and that did not work either. In the terminal I can run
xinput list
and see
'FT5406 memory based driver'
in the list and I can
xinput list-props 'FT5406 memory based driver' | grep "Coordinate Transformation Matrix"
and see the identity matrix I just can't seem to set it with --set-prop
xinput list
and see
'FT5406 memory based driver'
in the list and I can
xinput list-props 'FT5406 memory based driver' | grep "Coordinate Transformation Matrix"
and see the identity matrix I just can't seem to set it with --set-prop
Re: touchscreen inversion stopped working PIXEL
That means that you haven't typed the command correctly. There is a missing quote mark or something. The command line is still waiting for you to type in the matching end quote.madbutter wrote:Didn't seem to work for me. I tried it in a terminal and it just sits there with a > until I Ctrl-C out
Here's an example of what happens when you miss a quote mark.
Code: Select all
pi@raspi6 ~ $ echo 'hello
> what?
> Oh, I missed the endquote
> here it is'
hello
what?
Oh, I missed the endquote
here it is
pi@raspi6 ~ $
Re: touchscreen inversion stopped working PIXEL
This one command:
"xinput --set-prop 'FT5406 memory based driver' 'Coordinate Transformation Matrix' 0 1 0 -1 0 1 0 0 1" switch x-axis and y-axis for me.
Axis already so move right, but I need still switch direction left<>right and up<>down.
"xinput --set-prop 'FT5406 memory based driver' 'Coordinate Transformation Matrix' 0 1 0 -1 0 1 0 0 1" switch x-axis and y-axis for me.
Axis already so move right, but I need still switch direction left<>right and up<>down.
-
- Raspberry Pi Engineer & Forum Moderator
- Posts: 6733
- Joined: Wed Aug 17, 2011 7:41 pm
- Location: Cambridge
Re: touchscreen inversion stopped working PIXEL
That command is a right rotate. If you want a left rotate then try:DidaJI wrote:This one command:
"xinput --set-prop 'FT5406 memory based driver' 'Coordinate Transformation Matrix' 0 1 0 -1 0 1 0 0 1" switch x-axis and y-axis for me.
Axis already so move right, but I need still switch direction left<>right and up<>down.
Code: Select all
xinput --set-prop 'FT5406 memory based driver' 'Coordinate Transformation Matrix' 0 -1 1 1 0 0 0 0 1
Re: touchscreen inversion stopped working PIXEL
Bingo, thank you very much Dom! Now everything works fine...
-
- Posts: 38
- Joined: Wed Jan 02, 2013 1:38 pm
Re: touchscreen inversion stopped working PIXEL
Worked for me for slightly altered as I have ADS7846. My 2 cents:
1. If you are via SSH, does not work. Run it like that instead
2. If the above command reports "ADS7846" instead of "FT5406" run this command
depending on the way you need it rotated.
The above change is gone though after restart. Is there a way to make it permanent or do I need to run it as a script on boot?
Thanks!
1. If you are via SSH,
Code: Select all
xinput list
Code: Select all
DISPLAY=:0.0 xinput list
Code: Select all
DISPLAY=:0.0 xinput --set-prop 'ADS7846 Touchscreen' 'Coordinate Transformation Matrix' 0 -1 1 1 0 0 0 0 1
or
DISPLAY=:0.0 xinput --set-prop 'ADS7846 Touchscreen' 'Coordinate Transformation Matrix' 0 1 0 -1 0 1 0 0 1
The above change is gone though after restart. Is there a way to make it permanent or do I need to run it as a script on boot?
Thanks!
-
- Raspberry Pi Engineer & Forum Moderator
- Posts: 6733
- Joined: Wed Aug 17, 2011 7:41 pm
- Location: Cambridge
Re: touchscreen inversion stopped working PIXEL
@madbutter reported adding to /etc/xdg/lxsession/LXDE-pi/autostartgulliverrr wrote:The above change is gone though after restart. Is there a way to make it permanent or do I need to run it as a script on boot?
Re: touchscreen inversion stopped working PIXEL
Just wanted to confirm that this is working for me, once I got the typos out, and that it is started automatically when I boot the Pi.
To sum up the whole procedure to have R-Pi touchscreen startup in in portrait mode:
1. In /boot/config.txt type in and save:
display_rotate=1
2. In /etc/xdg/lxsession/LXDE-pi/autostart type in and save:
xinput --set-prop 'FT5406 memory based driver' 'Coordinate Transformation Matrix' 0 1 0 -1 0 1 0 0 1
Thanks for your help, Dom
To sum up the whole procedure to have R-Pi touchscreen startup in in portrait mode:
1. In /boot/config.txt type in and save:
display_rotate=1
2. In /etc/xdg/lxsession/LXDE-pi/autostart type in and save:
xinput --set-prop 'FT5406 memory based driver' 'Coordinate Transformation Matrix' 0 1 0 -1 0 1 0 0 1
Thanks for your help, Dom
Re: touchscreen inversion stopped working PIXEL
Can somebody explain to me why the transformation matrix for transforming 2D coordinates is 3x3?
-
- Raspberry Pi Engineer & Forum Moderator
- Posts: 6733
- Joined: Wed Aug 17, 2011 7:41 pm
- Location: Cambridge
Re: touchscreen inversion stopped working PIXEL
You can't achieve a translation with a 2x2 matrix. You may want (0,0) to end up at (1280,720) when display is rotated 180 degrees.dasmanul wrote:Can somebody explain to me why the transformation matrix for transforming 2D coordinates is 3x3?
Re: touchscreen inversion stopped working PIXEL
Thanks. I still don't quite get it though. The linked page gives the matrix for 180° rotation as
How would that turn (0,0) into (1280,720)?
Code: Select all
⎡ -1 0 1 ⎤
⎜ 0 -1 1 ⎥
⎣ 0 0 1 ⎦
-
- Raspberry Pi Engineer & Forum Moderator
- Posts: 6733
- Joined: Wed Aug 17, 2011 7:41 pm
- Location: Cambridge
Re: touchscreen inversion stopped working PIXEL
The multiplication would be:
with x and y normalised to [0,1]
So (0,0) would give (1, 1, 1) which when un-normalised gives (1280, 720)
Code: Select all
⎡ -1 0 1 ⎤⎡x⎤
⎜ 0 -1 1 ⎥⎜y⎥
⎣ 0 0 1 ⎦⎣1⎦
So (0,0) would give (1, 1, 1) which when un-normalised gives (1280, 720)
Re: touchscreen inversion stopped working PIXEL
Finally it is working!
This line did the job:
xinput --set-prop 'FT5406 memory based driver' 'Coordinate Transformation Matrix' 0 1 0 -1 0 1 0 0 1
But:
after a reboot it's gone.
I placed it in /etc/xdg/lxsession/LXDE-pi/autostart
Any one any thoughts?
This line did the job:
xinput --set-prop 'FT5406 memory based driver' 'Coordinate Transformation Matrix' 0 1 0 -1 0 1 0 0 1
But:
after a reboot it's gone.
I placed it in /etc/xdg/lxsession/LXDE-pi/autostart
Any one any thoughts?
Re: touchscreen inversion stopped working PIXEL
@dom: Thanks, got it now!