It took hours, that something as essential as touch screen calibration is not incorporated yet in sensible way, but maybe I haven’t tried hard to find. So far I haven’t found authoritative and reliable way how to do that here. Luckily, I have found this: [Talk:Calibrating Touchscreen - ArchWiki]
copy and paste bash script from link above, create this as “calib” script (using vi [grrrr])
add this as first line on script:
export DISPLAY=:0.0
make it executable
chmod 777 calib
run it
./calib
calibration will popup on screen, follow instructions
calibration script will end up with output which should go into /etc/X11/xorg.conf.d/99-calibration.conf [BEWARE! script recommends different file names, IDK if will work then]
Maintainers, please, please, please, implement this into basic setup. Hours wasted on such essential feature.
Now touch works from corner to corner, no flips on axes, at least here on my 3.5" some AliEx display.
Will people with touchscreens that required calibration please test whether this is a universal solution?
Will @sailort please create a feature request in the issue tracker?
My daughter asked why we used root. I explained that it is a synth, not a secure server in a bank and we just want just a single user who can do everything. But yes- it makes me wince too!
Now I’m scared that some hacker will hack into my “just now played its first sound” kitchen table zynthian box as guest and will run screen calibration while I’m fiddling with it.
Ok, seriously. This ain’t a Linux class, or is it? I don’t know which version of zynthian software is circulating around, what is the security concept, if in some version thing aren’t laid differently, etc… This just works
It’s fine. It’s one of those things like when you get taught to drive HGV’s you’re absolutely drilled in to about usage of wing mirrors, so that when you see someone not doing it in a car you feel a bit uncomfortable.
It expects the xorg output from xinput_calibrator with separate “MinX”, “MaxX”, … variables
I’m only a beginner when it comes to bash, so there are probably some issues with quoting
Point 1 is usually true in the Zynthian use case, point 2. is for me truly unknown, and with point 3., one can except bad surprise: #reset xinput matrix
xinput set-prop “$device” ‘Coordinate Transformation Matrix’ 1 0 0 0 1 0 0 0 1
making a backup of your “quiet working configuration” (after hours of strong headache) before running the script is a good idea because, by default it will reset it.
I can test on a 5inch HDMI+GPIO touch screen (next week, because I have to prepare my first week-end in the countryside after 2 month of quarantine)
It worked here flawlessly here, but got your points. After all, this shouldn’t be “final” solution as this should be properly incorporated into zynthian setup. This is just way how to do that. I’ve seen a lot of discussion here, how to properly calculate that matrix, what I seem is that not resetting it to defaults skew actual readings while calibrating, and that libinput and evdev values aren’t directly compatible, thus could lead to dead-ends.
as you said
no issue, just one display
no issue, xinput_calibration will emit those values
what bad surprise you expect from few lines of code which are clear in steps and used understandable logic?
But backup of config is good advise. Will add backup step to guide.
Well in fact, none, as the script doesn’t overwrite the existing configuration. But as I had some bad surprise in the past with some kind of “miraculous script or recipe”, I do not believe in miracle anymore
This package provides the driver for input devices using evdev, the Linux kernel’s event delivery mechanism. This driver allows for multiple keyboards and mice to be treated as separate input devices.—I appear to already have this
5.
> apt-get install -y xinput-calibrator
A generic touchscreen calibration program for X.Org —I’ve already got it but I’ve played around a bit
6.
> apt-get install -y bc
GNU bc arbitrary precision calculator language, and I’ve got that
7.
3. copy and paste bash script from link above, create this as “calib” script
(using vi [grrrr]… nano is a much easier windows like tool for people who have issues with vi . . . :-). Type nano calib, cut and paste the code into it. Cntrl O to write it Cntrl X to exit …)add this as first line on script:
6. calibration will popup on screen, follow instructions and Play tap the dot
11.
nano 99-calibration.conf
7. calibration script will end up with output which should go into /etc/X11/xorg.conf.d/99-calibration.conf [BEWARE! script recommends different file names, IDK if will work then] i already had details for this in the file so I overwrote them
Sadly E & W are still reversed . . .but I will retry with a clean build as this is a fairly corrupted zynthian-touch.local . . . .
same with calling the file 98-calibration.conf . . . sadly …
My script fixes it but presumably renders up the not quite accurate scaling factors. . .
So I’ve copied these values into my touch script and they do renerder up a pretty accurate step sequence grid … So from my perspective, it generates a decent matrix but I haven’t found where this should be applied.
Almost right
So in my case it sets the mechanism u correctly but it’s getting it’s start up settings from somewhere else. . .
I will try with a clean image, as this is a zynthian-touch.local that has had a certain amount of ‘persuasion’ …
Wow, guide check nicely done. Configuration survive reboots on my box. Haven’t investigating further, but it seems there are at least two ways for x server input, libinput and evdev and those works on different values, properties and config files. Could it happen that during tinkering with it you have switched to evdev? Seems that image I have used (downloaded yesterday from nightlies) using libinput. Also those MinX, MaxY, SwapXY options are aplied with Transform matrix. My understanding is, with proper Transformation matrix these should be removed. Please post follow up after fresh image. Thanks.
I’ll delete a lot of the previous entries as being fairly irrelevant. Thanks so much for the help @sailort Apologies if these deletions make you look as thou’ you are talking to yourself !!!