Could this be the end of all touch screen calibration issues?

Wonderful guys!! Really brave!!

We have this issue opened:

and it would be nice to close it.

Some volunteer to integrate this procedure in the UI’s admin menu? :wink:

Thanks!

1 Like

I will when I get a little time. Work has me in a bit of a death grip at the moment.

I have a strange feeling that I will not avoid :face_with_monocle: this time.

Makes note . . . .
opens wicker basket,
pulls out raven,
puts hood over it’s head marked https…,
attaches note to birds leg, badly …
it falls of…
reaches back into basket and takes out staple gun . . .
staples note to ravens leg a lets it flap off asymmetrical down the corridor. . .

1 Like

Have you read Iain Banks??? :rofl:

Do you wanna buy a wasp . … . ?

I’ll have to make it first . . .

A bit too much literary for a non English native speaker but maybe I catch the idea…

My point is not to put any pressure :slight_smile:
It is rather that seeing my name next to the “enhancement issue” and @wyleu raising his hand to fix it, I’m most likely to have to provide a sound sample soon or later :grin:

1 Like

I followed the ./calib procedure, created the
98-screen-calibration.conf as directed (tried both directories that where mentioned) but changes where not permanent. Anyone else observed this?
What worked for me was to replace the numbers after CoordinateTransformationMatrix in /zynthian/config/zynthian_custom_config.sh by the numbers generated from the calib script.

Edit: what I wrote still holds for latest zynthian image (https://os.zynthian.org/2020-05-25-zynthianos-buster-lite-1.0.0.zip). I have official Kit V2 and in webconf there is Piscreen 3.5 (V2) selected.

2nd edit: the file /zynthian/config/zynthian_custom_config.sh survives reboot, but when I do a software update, then it’s reset / overwritten to default values and calibration is lost again.

I think, different displays all seem to have different ways they get their config data.

I altered pretyy much everything at one time or another, and the

/usr/share/X11/xorg.conf.d/98-screen-calibration.conf

was the only one that worked for me.

The output from xinput -list-props “AD5746 Touchscreen” ( from memory check it . . .)

might help to show the differences, but there seems to be many different set ups for this.

The most useful approach is lots of photos and a detailed list of what you did …
and then rebuild from scratch recording ‘exactly;’ what you do, because in this sort of thing it’s easy to apply a fix, have it not do anything and preceded to something else that then interacts.

Very frustrating but I’m sure we will get it all tied down at some point.

I think it has something with this in /zynthian/zynthian-ui/zynthian.sh

function load_config_env() {

    if [ -d "$ZYNTHIAN_CONFIG_DIR" ]; then
            source "$ZYNTHIAN_CONFIG_DIR/zynthian_envars.sh"
    else
            source "$ZYNTHIAN_SYS_DIR/scripts/zynthian_envars.sh"
    fi

    if [ ! -z "$ZYNTHIAN_SCRIPT_MIDI_PROFILE" ]; then
            source "$ZYNTHIAN_SCRIPT_MIDI_PROFILE"
    else
            source "$ZYNTHIAN_MY_DATA_DIR/midi-profiles/default.sh"
    fi

    if [ -f "$ZYNTHIAN_CONFIG_DIR/zynthian_custom_config.sh" ]; then
            source "$ZYNTHIAN_CONFIG_DIR/zynthian_custom_config.sh"
    fi

}

could this be the solution for custom configs?

if [ ! -f “/usr/share/X11/xorg.conf.d/98-screen-calibration.conf” ]; then
if [ -f “$ZYNTHIAN_CONFIG_DIR/zynthian_custom_config.sh” ]; then
source “$ZYNTHIAN_CONFIG_DIR/zynthian_custom_config.sh”
fi
fi

but it is not a fix if there is any other ideas behind usage of zynthian_custom_config.sh scripts for future.

The “$ZYNTHIAN_CONFIG_DIR/zynthian_custom_config.sh” is not intended for display configuration only and could be used for other configuration adjustments. Anyway i’m not sure if currently it’s been used by display configuration only.
I think that the solution is to add conditions to the display configuration code inside this file, so it would be executed only when needed (i.e. no /usr/share/X11/xorg.conf.d/98-screen-calibration.conf file found).

Doing so would require to modify custom display configuration files in:

  /zynthian-sys/custom/display/

what it’s not difficult at all, but it MUST be tested carefully for not breaking things.

Regards,

i’m trying just now… will let you know soon
… by now had inverted axes, but as many of us know, there was a lot of struggling on this :laughing:

Please make sure that your display doesn’t use custom config as this seem to overwrite your new calibration settings. IMHO, calibration should work on flipped axes as this creates transformation which takes this into account. Right after calibration, your display should behave as it should. If so, calibration was successful. If not, there is another problem which can’t be identified without more information (at least, which display configuration you are using).

actually i did an undefined number of tryouts before having right axes orientation (but honestly not a satisfying precision between touch and cursor). for this, i received an inverted axes result as expected, exactly because of something messed up around various configuration files. I really should try on a fresh image, to see if it works …

which screen do you use?

on webconf acts as a waveshare35a clone. first calibration made stuck cursor on upper right corner. second calibration changed values and resulted in moving but inverted axes

ok, succeded but had to add some tweaks to resulting calibration conf.
My working transformation Matrix was:
0 -1 1 1 0 0 0 0 1

Resulting matrix from calib was -1 and zeroes with different order, but more precise coordinates. So i Just adapted positions of -1 and zeroes as in previous matrix :
"0 -1.09255955854158678292 1.05368187653168397712 1.11368850369615090491 -.05597756818761152179 0 0 0 1"
Now i have a lot more precision on edges, cursor reaches the very end of screen borders as never before :upside_down_face:

2 Likes

i believe is a huge step forward for sure. thanks a lot. Soon will try with a fresh image. At the moment can’t have time to reflash :clap:
[UPDATE]
ok, i can give you some update regarding my experience: i tried on a fresh image. Must give my screen a Waveshare 4a (gpio only) display type as default. Deleted not relevant lines from webconf and left these:
dtoverlay=waveshare35a:rotate=270
is the minimum i can do. After that i installed calibration stuff following your instructions.
My result after calbrating is unfortunately always wrong. X and Y has inverted orientation and reversed direction (touch X west east> cursor moves Y north south - touch Y north south> cursor moves X East west). Display’s native orientation is portrait. Assuming i don’t want to write anything elsewhere on that configuration file, i can just switch positions of that
matrix values…

could you try this in display config?

dtoverlay=waveshare35a:rotate=270,swapxy=1

if it helps to avoid messing with calibration matrix?

Some more info from my tests.
I installed recent image https://os.zynthian.org/2020-05-25-zynthianos-buster-lite-1.0.0.zip on my official kit V2, with rpi 4, official PiScreen 3.5 (V2). So I would say my configuration is rather standard, nothing special.
Touchscreen calibration is still unsatisfying, as I do not find a way to make calibration matrix permanent. The file 98-screen-calibration.conf has no effect, neither in /usr/share/X11/xorg.conf.d nor in /etc/X11/xorg.conf.d.
Changing the calibration matrix numbers in /zynthian/config/zynthian_custom_config.sh survives reboot, but does not survive a software update; they are reset back to -1 0 1 0 -1 1 0 0 1.
here is my configuration:
zy
I’m running out of ideas…