Touchscreen is "mirrored": the mouse pointer moves in opposite direction as touch!

The touchscreen calibration that runs at startup doesn’t remember the calibration - and it doesn’t take effect, so my touchscreen is “mirrored”: the mouse pointer moves in opposite direction as touch !

I have previously used iMX6 and here the calibration utility works fine.

Regards,
J

Hi @JohnnyPaycheck!

Try running xinput_calibrator in the terminal (via SSH, serial or in the board itself). It will run the same calibration that is run on startup, but it will output something like this on the terminal:

Doing dynamic recalibration:
	Setting calibration data: 151, 4079, 3713, 181
	--> Making the calibration permanent <--
  copy the snippet below into '/etc/X11/xorg.conf.d/99-calibration.conf' (/usr/share/X11/xorg.conf.d/ in some distro's)
Section "InputClass"
	Identifier	"calibration"
	MatchProduct	"AD7879 Touchscreen"
	Option	"Calibration"	"151 4079 3713 181"
	Option	"SwapAxes"	"0"
EndSection

So create the file /usr/share/X11/xorg.conf.d/99-calibration.conf, copy the snippet to it and save. Your changes should be saved after reboot.

Best regards,

Gustavo.

Thanks Gustavo, a few notes:
I cannot run it from SSH terminal “no calibratable devices found”. But run directly it produces:

=======================================================================
Setting calibration data: 0, 4095, 0, 4095
Calibrating EVDEV driver for "AD7879 Touchscreen" id=7
	current calibration values (from XInput): min_x=0, max_x=4095 and min_y=0, max_y=4095

Doing dynamic recalibration:
	Setting calibration data: 3934, 125, 3800, 291
	--> Making the calibration permanent <--
  copy the snippet below into '/etc/X11/xorg.conf.d/99-calibration.conf'
Section "InputClass"
	Identifier	"calibration"
	MatchProduct	"AD7879 Touchscreen"
	Option	"Calibration"	"3934 125 3800 291"
	Option	"SwapAxes"	"0"
EndSection
=======================================================================

I notice the option “SwapAxes” “0” which might solve my problem if set to “1” ?

After test: no - now it moves in another wrong direction: I press to the right of center => cursor moves down from center !

Now it works - when I do as you suggested, and keep “SwapAxes” “0”

Thanks :slight_smile:

You’re welcome! Good to hear it’s working!

Best regards,

Gustavo.

One tiny thing: even though I have made the config file, it still runs the calibration utility at boot - even two times after one another!

I have removed it from .config/LXsession/LXDE/autostart - it only contains these three lines:
@lxpanel --profile LXDE
@pcmanfm --desktop --profile LXDE
@xscreensaver -no-splash

and I assume these are neccessary ?

I think the calibration utility is launched by /etc/X11/Xsession.d/30xinput_calibrate.sh.
Removing that file may solve your issue.

Thanks, but it didn’t change. I guess, since it times out and disappears after 1 min,
it is not a big deal - but it is so complicated to find out from where it is started - I also tried to rename /usr/bin/run-calibrate.sh with no effect…

Try creating an empty pointercal.xinput file at /etc:

touch /etc/pointercal.xinput

xinput_calibrator should look for this before running. If it’s present, the calibration shouldn’t run.

Alternatively, you could easily remove the xinput-calibrator package, since your touchscreen is already calibrated:

opkg remove --nodeps xinput-calibrator

Thanks again. This worked !