Dirk_H
Posts: 1
Joined: Thu Jan 26, 2017 8:43 pm

Re: touchscreen inversion stopped working PIXEL

Thu Jan 26, 2017 8:47 pm

Hi folks,

I also heavily struggling due to the change to libdev. Rotating the touch input worked for me, however how do I calibrate the display? Must this also be done with the transformation matrix? https://wiki.archlinux.org/index.php/Ca ... ouchscreen implies this.

If this is the way to do it, how to find the touch area offset and touch area width?
In which way have the values to be altered when the touch input needs to be rotated?

kurimampi
Posts: 1
Joined: Thu Feb 09, 2017 4:26 am

Re: touchscreen inversion stopped working PIXEL

Thu Feb 09, 2017 4:38 am

after some digging, I think the best answer is to create a 99-calibration.conf at /usr/share/X11/xorg.conf.d/99-calibration.conf

Code: Select all

Section "InputClass"
    Identifier  "calibration"
    MatchProduct    "ADS7846 Touchscreen"
    Option "TransformationMatrix" "0 1 0 -1 0 1 0 0 1"
EndSection
disclaimer: I started with latest raspbian lite, installed basic lxde and noticed xinput_calibration doesn't work anymore.. so it seems now it uses libinput... the `xinput --send-prop` works charm but is lost after reboot and somehow it doesn't work if I add it at LXDE/autostart as suggested...

to me, it was enough to get an approximated calibration, but you could change the transformation matrix a little to fix manually...

User avatar
Pinkie Pi(e)
Posts: 10
Joined: Mon Jun 03, 2013 8:08 am

Re: touchscreen inversion stopped working PIXEL

Tue Feb 14, 2017 6:14 am

I can confirm this problem and would appreciate any help to fix it.

The only way I could get my new Waveshare 3.5"(a) Display's Touchscreen to work & calibrate it correctly, was to re-install the 11.01.2017 Raspbian image and then not applying any updates.

I'm using the "LCD-show-161112.tar.gz" driver from Waveshare and xinput-calibrator for calibration, as described in this wiki: http://www.waveshare.com/wiki/3.5inch_RPi_LCD_(A)

Is there any way to make this work with a fully updated Raspbian, or do i have to wait for Waveshare to release a new driver?

User avatar
Pinkie Pi(e)
Posts: 10
Joined: Mon Jun 03, 2013 8:08 am

Re: touchscreen inversion stopped working PIXEL

Tue Feb 21, 2017 7:29 pm

Any way at all, or am I out of luck until a driver update?

cubii
Posts: 36
Joined: Fri Jun 01, 2012 6:54 pm

Re: touchscreen inversion stopped working PIXEL

Wed Feb 22, 2017 9:19 pm

Have now the same problem --> rasbian full from january updated today -> touch is not working correctly, its mirrored...on an Raspberry 1 with an fake? waveshare 3,5 display

Any solution?

User avatar
Pinkie Pi(e)
Posts: 10
Joined: Mon Jun 03, 2013 8:08 am

Re: touchscreen inversion stopped working PIXEL

Mon Feb 27, 2017 8:29 pm

cubii wrote:Have now the same problem --> rasbian full from january updated today -> touch is not working correctly, its mirrored...on an Raspberry 1 with an fake? waveshare 3,5 display

Any solution?
I'm still stuck too, sadly.

w4kil
Posts: 4
Joined: Tue Nov 08, 2016 7:09 pm

Re: touchscreen inversion stopped working PIXEL

Mon Feb 27, 2017 9:13 pm

My workaround:

1. Make sure that /etc/X11/xorg.conf.d is empty.
2. /usr/share/X11/xorg.conf.d should contain something like:
10-quirks.conf 40-libinput.conf 45-evdev.conf 70-synaptics.conf 99-calibration.conf 99-fbturbo.conf
Just be sure that evdev.conf has a higher number than libinput.conf
this forces evdev to load after libinput
3. My 99-calibration.conf :

Code: Select all

Section "InputClass"
     Identifier "calibration"
     MatchProduct "ADS7846 Touchscreen"
     Option "Calibration" "3955 273 208 3844"
     Option "SwapAxes" "1"
EndSection
Your numbers might vary.

User avatar
Pinkie Pi(e)
Posts: 10
Joined: Mon Jun 03, 2013 8:08 am

Re: touchscreen inversion stopped working PIXEL

Wed Mar 01, 2017 1:36 am

w4kil wrote:My workaround:

1. Make sure that /etc/X11/xorg.conf.d is empty.
2. /usr/share/X11/xorg.conf.d should contain something like:
10-quirks.conf 40-libinput.conf 45-evdev.conf 70-synaptics.conf 99-calibration.conf 99-fbturbo.conf
Just be sure that evdev.conf has a higher number than libinput.conf
this forces evdev to load after libinput
3. My 99-calibration.conf :

Code: Select all

Section "InputClass"
     Identifier "calibration"
     MatchProduct "ADS7846 Touchscreen"
     Option "Calibration" "3955 273 208 3844"
     Option "SwapAxes" "1"
EndSection
Your numbers might vary.
I would have loved to try your workaround but it seems like now, one of the last dist-upgrade or rpi-update updates stopped the screen from working completely.

Even reinstalling it by using the instructions and drivers from the waveshare wiki won't work now.
The screen just stays white.
I'm starting to grow rather frustrated with all those problems.

Some log entries that might be related:
syslog:

Code: Select all

Mar  1 01:14:05 RaspberryPi lightdm[557]: ** (lightdm:557): WARNING **: Error using VT_ACTIVATE 7 on /dev/console: Inappropriate ioctl for device
Mar  1 01:14:05 RaspberryPi lightdm[557]: ** (lightdm:557): WARNING **: Error using VT_WAITACTIVE 7 on /dev/console: Inappropriate ioctl for device
Mar  1 01:14:13 RaspberryPi lightdm[557]: ** (lightdm:557): WARNING **: Error using VT_GETSTATE on /dev/console: Inappropriate ioctl for device
Mar  1 01:14:20 RaspberryPi lightdm[557]: ** (lightdm:557): WARNING **: Error using VT_GETSTATE on /dev/console: Inappropriate ioctl for device
Mar  1 01:14:33 RaspberryPi lightdm[557]: ** (process:1206): WARNING **: Error getting user list from org.freedesktop.Accounts: GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: The name org.freedesktop.Accounts was not provided by any .service files
Mar  1 01:14:33 RaspberryPi rsyslogd-2007: action 'action 17' suspended, next retry is Wed Mar  1 01:15:03 2017 [try http://www.rsyslog.com/e/2007 ]


kern.log:

Code: Select all

Mar  1 00:45:10 RaspberryPi kernel: [   12.621610] spi0.1 supply vcc not found, using dummy regulator
Mar  1 00:45:10 RaspberryPi kernel: [   12.679327] ads7846 spi0.1: touchscreen, irq 177
Mar  1 00:45:10 RaspberryPi kernel: [   12.684365] input: ADS7846 Touchscreen as /devices/platform/soc/20204000.spi/spi_master/spi0/spi0.1/input/input0
Mar  1 00:45:10 RaspberryPi kernel: [   12.738164] fbtft: module is from the staging directory, the quality is unknown, you have been warned.
Mar  1 00:45:10 RaspberryPi kernel: [   12.819899] fb_ili9486: module is from the staging directory, the quality is unknown, you have been warned.
Mar  1 00:45:10 RaspberryPi kernel: [   12.821349] pinctrl-bcm2835 20200000.gpio: pin gpio17 already requested by spi0.1; cannot claim for spi0.0
Mar  1 00:45:10 RaspberryPi kernel: [   12.821371] pinctrl-bcm2835 20200000.gpio: pin-17 (spi0.0) status -22
Mar  1 00:45:10 RaspberryPi kernel: [   12.821426] pinctrl-bcm2835 20200000.gpio: could not request pin 17 (gpio17) from group gpio17  on device pinctrl-bcm2835
Mar  1 00:45:10 RaspberryPi kernel: [   12.821439] fb_ili9486 spi0.0: Error applying setting, reverse things back
Mar  1 00:45:10 RaspberryPi kernel: [   12.821476] fb_ili9486: probe of spi0.0 failed with error -22
lightdm.log:

Code: Select all

[+1065.53s] DEBUG: Activating VT 7
[+1065.53s] WARNING: Error using VT_ACTIVATE 7 on /dev/console: Inappropriate ioctl for device
[+1065.54s] WARNING: Error using VT_WAITACTIVE 7 on /dev/console: Inappropriate ioctl for device

w4kil
Posts: 4
Joined: Tue Nov 08, 2016 7:09 pm

Re: touchscreen inversion stopped working PIXEL

Wed Mar 01, 2017 2:27 am

Wish I could help you further. I was at the point of trying all kinds of values in the "TransformationMatrix" and
getting no where. After lots of searching I found the idea of putting "evdev" higher than libinput. Then the old
way of using the "calibration" worked a charm. BTW I'm working with an updated "2017-01-11-raspbian-jessie.img".

User avatar
Pinkie Pi(e)
Posts: 10
Joined: Mon Jun 03, 2013 8:08 am

Re: touchscreen inversion stopped working PIXEL

Fri Mar 03, 2017 2:30 am

w4kil wrote:Wish I could help you further. I was at the point of trying all kinds of values in the "TransformationMatrix" and
getting no where. After lots of searching I found the idea of putting "evdev" higher than libinput. Then the old
way of using the "calibration" worked a charm. BTW I'm working with an updated "2017-01-11-raspbian-jessie.img".
Thanks a lot for trying to help.
When you say updated, does that include the newest firmware by running rpi-update?
Or just apt-get update + apt-get dist-upgrade?

I just tried updating a backup based on 2017-01-11-raspbian-jessie.img.
Updating by running apt-get update + apt-get dist-upgrade does work fine (aside from touch not working properly, but thats what your workaround would be for).
However, updating the firmware through rpi-update did result in a blank, white screen for me again.
Reinstalling the driver over SSH doesn't seem to fix it.

w4kil
Posts: 4
Joined: Tue Nov 08, 2016 7:09 pm

Re: touchscreen inversion stopped working PIXEL

Fri Mar 03, 2017 2:51 am

O.K. I started over with the latest image(2017-02-16) with just apt update/upgrade. Here are my files:
cmdline.txt

Code: Select all

dwc_otg.lpm_enable=0 console=tty1 console=ttyAMA0,115200 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline rootwait fbcon=map:10 fbcon=font:ProFont6x11 logo.nologo
config.txt

Code: Select all

dtoverlay=waveshare35a
dtoverlay=ads7846,cs=1,penirq=17,penirq_pull=2,speed=1000000,keep_vref_on=1,swapxy=1,pmax=255,xohms=60,xmin=200,xmax=3900,ymin=200,ymax=3900
ads7846 is already in the overlay folder. You'll have to get waveshare35a from whereever(it's all over the internet).
Then just follow the rest of my above post.

Hope this helps.

cmenchion
Posts: 3
Joined: Mon Feb 27, 2017 2:27 pm

Re: touchscreen inversion stopped working PIXEL

Sun Mar 05, 2017 11:01 am

I'm having the same issue with updated 2017-01-11-raspbian-jessie and also with clean install of the feb update. I'm using eGalax touch panel. The lcd displays correctly and adding the 99-calibration.conf hasn't worked for me. My y axis is always inverted. Tried InvertY and SwapAxis with no luck. I downgraded and didn't update the Jan release and its works flawless. Any suggestions is greatly appreciated I'm fairly new so troubleshooting is hard due to my lack of knowledge.

For ref i'm using an Innolux 1024x600 7" screen with a touch panel from their 800x480 screen that i salvaged from the E-Log systems we use for our log books as a commercial driver. They work perfect just had to buy a vga board and the usb touch driver. hope this helps anyone puling their hair out!!

Thanks for reading

cubii
Posts: 36
Joined: Fri Jun 01, 2012 6:54 pm

Re: touchscreen inversion stopped working PIXEL

Wed Mar 08, 2017 9:18 am

Hi,
recently (beginning of march) i started a new try and used a fresh Image (raspbian (not-lite? im not sure)) from Januar, updatet it completly and my Touchscreen (Waveshare 3,5 clone?)just worked, without calibration....

Dont now what was the difference, but perhaps they changed some updates and now it s not broken anymore?
Perhaps you can just try again?

Good luck

jjumper
Posts: 1
Joined: Thu Apr 06, 2017 9:16 pm

Re: touchscreen inversion stopped working PIXEL

Thu Apr 06, 2017 9:26 pm

i had a similar problem with my egalax touchdisplay.
read a lot of tutorials but none worked.
The Section-options did not work.
I could solve my problems with changing from libinput to evdev.
Just do an

Code: Select all

apt-get install xserver-xorg-input-evdev
then you need to change the config file /usr/share/X11/xorg.conf.d/40-libinput.conf
in the last section change the driver to evdev. This is what i got:

Code: Select all

Section "InputClass"
        Identifier "libinput touchscreen catchall"
        MatchIsTouchscreen "on"
        MatchDevicePath "/dev/input/event*"
        Driver "evdev"
EndSection
After restarting x i still had my problems with orientation. But now the normal options like invertY work.

I think, this might be your problem.

remrem
Posts: 1
Joined: Fri Apr 07, 2017 2:26 pm

Re: touchscreen inversion stopped working PIXEL

Fri Apr 07, 2017 2:59 pm

Hello,
jjumper wrote:i had a similar problem with my egalax touchdisplay.
read a lot of tutorials but none worked.
The Section-options did not work.
I could solve my problems with changing from libinput to evdev.
Just do an

Code: Select all

apt-get install xserver-xorg-input-evdev
then you need to change the config file /usr/share/X11/xorg.conf.d/40-libinput.conf
in the last section change the driver to evdev. This is what i got:

Code: Select all

Section "InputClass"
        Identifier "libinput touchscreen catchall"
        MatchIsTouchscreen "on"
        MatchDevicePath "/dev/input/event*"
        Driver "evdev"
EndSection
After restarting x i still had my problems with orientation. But now the normal options like invertY work.

I think, this might be your problem.
Thanks for sharing ! :)
I have the similar eGalax touchscreen here. After theses modifications I have also always reverted axis and bad calibration.


For the next steps I put these options in /usr/share/X11/xorg.conf.d/99-calibration.conf (values comes from the app xinput_calibrator):

Code: Select all

Section "InputClass"
  Identifier "calibration"
  MatchProduct "eGalax Inc. USB TouchController"
  Option "Calibration" "1711 266 1675 292"
  Option "SwapAxes" "1"
  Option "InvertX" "0"
  Option "InvertY" "0"
EndSection
All is OK now, thanks !

User avatar
LetHopeItsSnowing
Posts: 357
Joined: Sat May 26, 2012 6:40 am
Location: UK
Contact: Website

Re: touchscreen inversion stopped working PIXEL

Sun May 14, 2017 8:43 pm

I pulled together some end to end instructions for rotating the touchscreen 90 degrees which might prove useful.

http://www.stuffaboutcode.com/2017/05/r ... trait.html
"am I getting slower, or is stuff more complicated; either way I now have to write it down - stuffaboutcode.com"

BenHowell
Posts: 1
Joined: Sun Jul 02, 2017 7:34 pm

Re: touchscreen inversion stopped working PIXEL

Sun Jul 02, 2017 7:41 pm

Hi There

Sorry to post in such an old thread but I am at my wit's end with this issue and this information so far is the closest I've come to a solution. (That is, this seems to be the only settings that seem to make any effect on my touch input at all after trying xinput_calibrator etc etc)

I have a Raspberry Pi 3 running the standard Raspbian OS. I have the following touch display: https://www.sainsmart.com/sainsmart-hdm ... ry-pi.html

I have display_rotate set to 1 in my config file as I am using the display in a portrait setting. However the touch axis is inverted.
With the display in a portrait orientation, moving my finger up and down works correctly and the mouse tracks the point fine. Moving side to side however is inverted. When my finger goes left, the pointer goes right.

How might I write a transformation matrix which flips only one axis? I have given it a few attempts myself but nothing seems to produce the right result. The maths involved here makes no sense to me, and I fear it never will. I've hunted and hunted for an example somewhere but to no avail. There are example matrixes for rotating 90, 180 and 270 degrees, but nothing on how to flip an axis.

Any help would be greatly appreciated!

Kind Regards
Ben H

sawjam
Posts: 1
Joined: Fri Sep 01, 2017 11:55 pm

Re: touchscreen inversion stopped working PIXEL

Sat Sep 02, 2017 12:13 am

Hi

May or may not help, but I had an issue with a generic touch screen 7" eGalax Inc. with usb connection for touch screen, with inverted axis issues on new install of Stretch.

Tried many things, but eventual found a straight forward fix which was.

Code: Select all

apt-get install xserver-xorg-input-evdev
Then go to /usr/share/X11/xorg.conf.d and list the files

Code: Select all

cd  /usr/share/X11/xorg.conf.d
ls 
The ##-evdev.conf must load after ##-libinput.conf for me the files were 10-evdev.conf and 40-libinput.conf, which caused the confg libinput to overide the evdev config.

Code: Select all

sudo mv 10-evdev.conf 45-evdev.conf
change the initial number to higher than the libinput number, this then loads the evdev config after the libinput config.

Code: Select all

reboot
This resolved my inverted axis issue, then run the calibration, graphically or from comand line.

Hope it helps.

Jaxel
Posts: 1
Joined: Sun Aug 26, 2018 5:07 am

Re: touchscreen inversion stopped working PIXEL

Sun Aug 26, 2018 5:08 am

I can't get this to work on autostart.

Code: Select all

xinput --set-prop 'FT5406 memory based driver' 'Coordinate Transformation Matrix' 0 1 0 -1 0 1 0 0 1
It works fine when I type it in... but adding it to the end of "/etc/xdg/lxsession/LXDE-pi/autostart" doesn't restore it on boot.

jason21psu
Posts: 1
Joined: Wed Dec 05, 2018 1:27 am

Re: touchscreen inversion stopped working PIXEL

Wed Dec 05, 2018 1:46 am

Jaxel wrote:
Sun Aug 26, 2018 5:08 am
I can't get this to work on autostart.

Code: Select all

xinput --set-prop 'FT5406 memory based driver' 'Coordinate Transformation Matrix' 0 1 0 -1 0 1 0 0 1
It works fine when I type it in... but adding it to the end of "/etc/xdg/lxsession/LXDE-pi/autostart" doesn't restore it on boot.
I have the same issue. Although I tried adding the xinput line to ~/.config/lxsession/LXDE-pi/autostart

I'm like 90% sure I'm editing the correct file because I screwed something up the first time and my Pi just booted to a black screen. It was still "working" because I could VNC to the Pi but to a black screen.

Like @Jaxel I can type the command into terminal and it works fine, but in the autostart file, it does nothing

fruitoftheloom
Posts: 21077
Joined: Tue Mar 25, 2014 12:40 pm
Location: Delightful Dorset

Re: touchscreen inversion stopped working PIXEL

Wed Dec 05, 2018 8:53 am

jason21psu wrote:
Wed Dec 05, 2018 1:46 am
Jaxel wrote:
Sun Aug 26, 2018 5:08 am
I can't get this to work on autostart.

Code: Select all

xinput --set-prop 'FT5406 memory based driver' 'Coordinate Transformation Matrix' 0 1 0 -1 0 1 0 0 1
It works fine when I type it in... but adding it to the end of "/etc/xdg/lxsession/LXDE-pi/autostart" doesn't restore it on boot.
I have the same issue. Although I tried adding the xinput line to ~/.config/lxsession/LXDE-pi/autostart

I'm like 90% sure I'm editing the correct file because I screwed something up the first time and my Pi just booted to a black screen. It was still "working" because I could VNC to the Pi but to a black screen.

Like @Jaxel I can type the command into terminal and it works fine, but in the autostart file, it does nothing

The OP was using Raspbian Jessie with PIXEL Desktop, both are obsoleted as of August 2017.....
Retired disgracefully.....
This at present is my daily "computer" https://www.asus.com/us/Chrome-Devices/Chromebit-CS10/

Gamekiller77
Posts: 1
Joined: Fri Jul 05, 2019 12:39 am

Re: touchscreen inversion stopped working PIXEL

Fri Jul 05, 2019 12:45 am

So I was messing with this and trying hard to get this to work but I found the place to put in the `xinput`.

Create this file if you do not have it but you want to put your `xinput` line in to `.xsessionrc` file in your home directory.

Code: Select all

nano .xsessionrc
Then add `xinput --set-prop 'FT5406 memory based driver' 'Coordinate Transformation Matrix' 0 1 0 -1 0 1 0 0 1` to the file save it and reboot and the flip will keep.

Return to “Troubleshooting”