Touchscreen Calibration


I’m developing an application in toradex colibri imx7 board. In that, I’m facing an issue on touchscreen. In that, the orientation was wrongly pointed and I need to do the calibration for it. From my observation, the touch was tilted to 270 degree and flipped with Y-direction. I tried the calibration setup from the below link.

As per the document, I can do the one process at a time either I can tilt to some degrees (90, 180, and 270) or I can do change of direction by (x, y and xy). I can’t understand how to do both in the configuration setup.

I also tried the calibration by using “xinput_calibrator” command. That is also not helping to solve the problem. I captured the statement while executing the command as below.

root@colibri-imx7-emmc:/sys/class/pwm/pwmchip1# xinput_calibrator
Calibrating EVDEV driver for “AD7879 Touchscreen” id=7
** current calibration values (from XInput): min_x=1586, max_x=1591 and min_y=2794, max_y=2726**
INFO: width=640, height=480

Doing dynamic recalibration:
** Swapping X and Y axis…**
** Setting calibration data: 1588, 1588, 2749, 2749**
** → 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” “1588 1588 2749 2749”**
** Option “SwapAxes” “1”**

Kindly help me to get the right position for calibration setup.

Hi @ervaskes,

Kindly share more details on software and hardware version which you are testing. From logs it seems like you are using old BSP. Here we will encourage you to test with our latest BSP which is BSP 5.4.0.

Additionally to understand further issue kindly share display datasheet and how touch panel signal are connected.

Best Regards
Ritesh Kumar

Hi @ritesh.tx ,
I also tried with the latest BSP 5 with version of Yocto 5.5 dunfell. There also I experience the same.

I followed the below link for calibration process. I need to update the both y-direction change and the 270 degree angle rotate to achieve the correct position for my touch display.

I tried “weston-touch-calibrator” from that latest BSP.

With regards
Kesavan T

Hi @ervaskes,

Kindly share datasheet and information how display touch signals are connected with Colibri. We quickly tested rotation with our 7 inch resistive display with below command and it works fine.

echo 'ENV{LIBINPUT_CALIBRATION_MATRIX}="-1 0 1 0 -1 1"' > /etc/udev/rules.d/libinput.rules

Best Regards
Ritesh Kumar

Are you using torizon? I think there is a special container for calibration if so.
If not, what are the contents of your weston.ini file? I know we had to make some modifications to weston.ini to write out the configuration values correctly. This question was nice for that Touchscreen calibration not working in BSP 5.
Also nice is How to rotate weston in torizon core - #2 by jeremias.tx.

Hi @ritesh.tx ,

It was pin mismatch with the board and the display device. It was solved by proper pin mapping.

Thanks for your support.

1 Like