How to use xinput_calibrator on an Eragon410 with EIC-LCD-1080P LCD?

I have an Eragon410 board from eInfochips driving a EIC-LCD-1080P LCD display.
I flashed Linaro Linux onto the board from the images provided by eInfochips,
giving me version 16.06, aka Debian GNU/Linux 8 linaro-alip, “jessie”.

I am having touch-screen calibration difficulties after rotating the GUI display
on my LCD using xrandr. I put the command “xrandr -o right” (with supporting
syntax) in a .desktop file in etc/xdg/autostart/ and the GUI always comes up
successfully rotated on the LCD after bootup, since a horizontal view is needed
for the end application.

This system uses the Goodix Capacitive TouchScreen with the evdev driver.
evdev_drv.so is in /usr/lib/xorg/modules/input/.
10-evdev.conf is in /usr/share/X11/xorg.conf.d/, along with 99-calibration.conf.
I am able to edit the numbers in the following line (defaults shown):
Option “Calibration” “3 271 0 1237”
and get the mouse pointer to respond according to the touchscreen, but need to
calibrate exactly. When the screen is not rotated, in vertical view, the above
defaults give correct calibrated touchscreen results.

The system has xinput_calibrator, which is not returning correct results for me
when I put them into 99-calibration.conf and restart.
xinput_calibrator --list
returns:
Device “Goodix Capacitive TouchScreen” id=7
I do
xinput_calibrator --device 7 --misclick 200
I get through the program after about six tries, touching the red targets in
each corner successively. Most of the time it says “Misclick detected;
restarting”.
I get this output

linaro@linaro-alip:~$ xinput_calibrator --device 7 --misclick 200
Calibrating EVDEV driver for “Goodix Capacitive TouchScreen” id=7
current calibration values (from XInput): min_x=214, max_x=218 and min_y=1128, max_y=1141

Doing dynamic recalibration:
Swapping X and Y axis…
Setting calibration data: 215, 215, 1140, 1140
→ 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 “Goodix Capacitive TouchScreen”
Option “Calibration” “215 215 1120 1140”
Option “SwapAxes” “1”
EndSection
linaro@linaro-alip:~$

When I put the Calibration and SwapAxes numbers into 99-calibration.conf,
touching anywhere on the screen keeps the mouse pointer hard on the left edge of
my horizontal display.

If I manually change the Calibration numbers to “3 271 1200 5”, for example, I
get the mouse pointer more or less in line horizontally, and higher and lower
vertically when I touch higher and lower on my horizontal display, although the
vertical results are far off.

How can I get this system to return correct calibration results?

Best regards,

With help from my vendor’s tech support, we tried some things, without success.
I found that the defaults in 99-calibration.conf are 3 721 in the following
line, not 3 271:
Option “Calibration” “3 721 0 1237”
With those defaults, and the screen unrotated, the touchscreen is correctly
calibrated, and returns to being correctly calibrated if it wasn’t.

We reflashed the entire Linaro Linux OS on the board.

We added, the line “Option “SwapAxes” “True”” in
/usr/share/X11/xorg.conf.d/10-evdev.conf:

Section “InputClass”
Identifier “evdev touchscreen catchall”
MatchIsTouchscreen “on”
MatchDevicePath “/dev/input/event*”
Driver “evdev”
Option “SwapAxes” “True”
EndSection

-Rebooted the board

-Rotated the display in landscape using xrandr and run xinput_calibrator,
touch the four corners and generate 99-calibration.conf: Doing this via the
UART root access:
su linaro
export DISPLAY=:0
xrandr -o right
xinput_calibrator --device 7 --misclick 200

The mouse pointer always goes to one edge or corner of the display – one time
it would go as far from one edge of the display as one centimeter or so – each
time I tried this. I repeated the entire reflashing of the board with Linaro
Linux four times, retrying the above, also without modifying 10-evdev.conf, as
the vendor suggested, always with the same result. I also tried settings that
the vendor sent, that gave similar results.
I verified that 10-evdev.conf and 99-calibration.conf only use spaces, not tabs.

Doing xinput_calibrator with the screen unrotated works, and I get similar
results to the defaults.

I’m not sure if the vendor has actually done calibration with the screen
rotated. They say they are preparing a detailed video. In the meantime, can
anyone confirm that this works or not, and if so, what could be the missing
factor that stops it working for me if the vendor can do it?

I’m glad you are already talking to your vendor since they are the ones who should help you with this (especially so for something as old as 16.06).

However I think you might be thinking about this the wrong way. In my mind calibration is calibration and since capacitive screens don’t need re-calibrating over time (shouldn’t really even need re-calibrating between different device instances) then just calibrate in landscape mode and be done!

Based on this view of the world the touchscreen does not need to be re-calibrated because you changed the output rotation… it simply means that the sensor needs to be rotated too. I suspect that the X server or kernel hasn’t figured out that the touchscreen is bonded to the monitor so is not rotating automatically.

Perhaps look at other ways to rotate the touchscreen. This topic looked to contain some promising ideas: Rotate Touch Input with touchscreen and/or touchpad - Ask Ubuntu

Note this is all theoretic… I’ve not tried any of this… but your question is almost certainly a generic X11 question and nothing 96Boards related so I’d recommend casting a very wide net in your search topics!

Thanks for the underlying idea and finding the askubuntu topic. I’m looking into
it.

We found that a key step is to first delete the old 99-calibration.conf before
using xinput_calibrator.