I've been playing around with this touchscreen which uses eGalax drivers.
OS of the board it's connected to is Ubuntu LTS 16.04.01
For some reason, I can't quite get it calibrated just right, but that's not really the point of this question.
When I run xinput_calibrator for the system to attempt to magically calibrate it for me by hitting all the little dots, it really just generates 4 comma separated data points, which ultimately get plugged into the xinput properties for that device (namely, "Evdev Axis Calibration").
I would like to understand how those 4 numbers are calculated.
I can't find a decent resource online explaining exactly what this program does to come up with those numbers, but this information might be useful in troubleshooting now and in the future.
As a reference, here is one of my calibration sessions:
root@MyDevice:~# xinput_calibrator -v DEBUG: XInputExtension version is 2.3 DEBUG: Skipping virtual master devices and devices without axis valuators. DEBUG: Skipping device 'Virtual core XTEST pointer' id=4, does not report Absolute events. Warning: multiple calibratable devices found, calibrating last one (eGalax Inc. USB TouchController) use --device to select another one. DEBUG: Selected device: eGalax Inc. USB TouchController DEBUG: Not usbtouchscreen calibrator: Not a usbtouchscreen device DEBUG: Read axes swap value of 0. DEBUG: Read InvertX=0, InvertY=0. Calibrating EVDEV driver for "eGalax Inc. USB TouchController" id=12 current calibration values (from XInput): min_x=2226, max_x=294 and min_y=402, max_y=2138 DEBUG: Found that 'eGalax Inc. USB TouchController' is a sysfs name. DEBUG: Adding click 0 (X=0, Y=63) DEBUG: Adding click 1 (X=696, Y=61) DEBUG: Adding click 2 (X=0, Y=479) DEBUG: Adding click 3 (X=685, Y=479) Doing dynamic recalibration: Setting calibration data: 2504, 281, 375, 2386 DEBUG: Successfully applied axis calibration. --> Making the calibration permanent <-- DEBUG: Found that 'eGalax Inc. USB TouchController' is a sysfs name. 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 "eGalax Inc. USB TouchController" Option "Calibration" "2504 281 375 2386" Option "SwapAxes" "0" EndSection
So you can see, the calibrator read my previous calibration data as "min_x=2226, max_x=294 and min_y=402, max_y=2138", and then generated the data points "2504, 281, 375, 2386" based on the calibration session that just happened.
How were the data points "2504, 281, 375, 2386" calculated?