Olimex Support Forum

OLinuXino Android / Linux boards and System On Modules => A10 => Topic started by: akr on February 28, 2024, 01:03:06 PM

Title: Calibration Issues with LCD-OLinuXino-10TS on A10-OLinuXino-LIME
Post by: akr on February 28, 2024, 01:03:06 PM
I am reaching out for support regarding an issue I am experiencing with the touchscreen calibration on my A10-OLinuXino-LIME using the LCD-OLinuXino-10TS. There is a significant deviation around all four corners of the touchscreen, with the deviation being less in the middle section.

https://postimg.cc/xkxxtcgX[/img]

Following the general calibration instructions, I installed xrandr, xinput-calibrator, and xinput."sudo apt install xrandr xinput-calibrator xinput"
Here is the content of my olinuxino-ts script (/usr/lib/olinuxino/olinuxino-ts):
#!/bin/bash

# Check is LCD is enabled in the device tree
LCD=$(grep -r "lcd-olinuxino-[147]" /proc/device-tree -a -h | tr -d '\0')
[[ -z $LCD ]] && exit 0

overlays=$(cat /boot/uEnv.txt)

# Select transformation matrix
if [[ $overlays == *"i2c2-ar1021"* ]];
then
    case $LCD in
        "olimex,lcd-olinuxino-4.3")
                MATRIX="1.09 0.0 -0.04 0.0 1.17 -0.09 0.0 0.0 1.0"
                ;;
        "olimex,lcd-olinuxino-7")
                MATRIX="1.05 0.0 -0.03 0.0 1.13 -0.08 0.0 0.0 1.0"
                ;;
        "olimex,lcd-olinuxino-10")
                MATRIX="1.04 0.0 -0.03 0.0 1.09 -0.07 0.0 0.0 1.0"
                ;;
        *)
                # The LCD is not supported by this script
                exit 0;
    esac

    PRODUCT="ar1021 I2C Touchscreen"

else
    case $LCD in
        "olimex,lcd-olinuxino-4.3")
                MATRIX="1.08 0.0 -0.04 0.0 1.14 -0.10 0.0 0.0 1.0"
                ;;
        "olimex,lcd-olinuxino-7")
                MATRIX="1.06 0.0 -0.03 0.0 1.11 -0.08 0.0 0.0 1.0"
                ;;
        "olimex,lcd-olinuxino-10")
                MATRIX="1.04 0.0 -0.03 0.0 1.09 -0.07 0.0 0.0 1.0"
                ;;
        *)
                # The LCD is not supported by this script
                exit 0;
    esac

    PRODUCT="1c25000.rtp"

fi

# Generate configuration file
mkdir -p /etc/X11/xorg.conf.d
tee > /etc/X11/xorg.conf.d/98-screen-calibration.conf << __EOF__
Section "InputClass"
        Identifier      "calibration"
        MatchProduct    "$PRODUCT"
        Option          "TransformationMatrix" "$MATRIX"
EndSection
__EOF__

# педалщина
LCD=$(grep -r "lcd-olinuxino-[147]" /proc/device-tree -a -h | tr -d '\0')
[[ -z $LCD ]] && exit 0

overlays=$(cat /boot/uEnv.txt)

# Select transformation matrix
if [[ $overlays == *"-gt911inv"* ]];
then
        /usr/bin/memtool mw -l 0x1C0C010  0x80000000 || :
        /usr/bin/memtool mw -l 0x1C0C044  0xF0000006 || :
fi

And this is what my 98-screen-calibration.conf looks like:
Section "InputClass"
        Identifier      "calibration"
        MatchProduct    "1c25000.rtp"
        Option          "TransformationMatrix" "1.04 0.0 -0.03 0.0 1.09 -0.07 0.0 0.0 1.0"
EndSection
[img]

Could anyone assist with the following questions?

 1.   Are there any known compatibility issues with the xinput_calibrator that may lead to incorrect calibration on the LCD-OLinuXino-10TS?
 2.   How can I fine-tune the TransformationMatrix to correct the calibration deviation?
 3.   If anyone has successfully calibrated this particular touchscreen model with A10-OLinuXino-LIME, could you share any tips or the process you followed?

Any help or guidance on this matter would be greatly appreciated!

Best regards
Title: Re: Calibration Issues with LCD-OLinuXino-10TS on A10-OLinuXino-LIME
Post by: LubOlimex on February 28, 2024, 03:45:02 PM
Did you load the configuration with olinuxino-display?
Title: Re: Calibration Issues with LCD-OLinuXino-10TS on A10-OLinuXino-LIME
Post by: LubOlimex on March 06, 2024, 01:40:00 PM
First test with Olimage linux and olinuxino-display command, download this document for more info about Olimage and olinuxino-display command:

https://github.com/OLIMEX/OLINUXINO/blob/master/DOCUMENTS/OLIMAGE/Olimage-guide.pdf

Report back.
Title: Re: Calibration Issues with LCD-OLinuXino-10TS on A10-OLinuXino-LIME
Post by: akr on March 15, 2024, 11:00:39 AM
i have protocolled the steps i did. https://docs.google.com/document/d/1oqfkm0QQoTyZlcZg3ayKIIkZZkFPQ4ySGmeAzAlThWM/edit?usp=sharing (https://docs.google.com/document/d/1oqfkm0QQoTyZlcZg3ayKIIkZZkFPQ4ySGmeAzAlThWM/edit?usp=sharing)

But still i am having the same issue with the deviation around the corners. I also have uploaded a quick demo video of the current behaviour https://www.youtube.com/watch?v=SAuSQ7Tv0FQ&ab_channel=Akr (https://www.youtube.com/watch?v=SAuSQ7Tv0FQ&ab_channel=Akr)
Title: Re: Calibration Issues with LCD-OLinuXino-10TS on A10-OLinuXino-LIME
Post by: LubOlimex on March 15, 2024, 04:32:24 PM
Maybe it is a hardware issue with this display? Can you test with the older 3.4.x images too:

https://ftp.olimex.com/Allwinner_Images/A10-OLinuXino-LIME/Debian/sd/a10_Lime_mainline_uboot_debian_3.4.90_release_4.zip

The video change script is again inside - "change_display*".

They have build in calibration tool "sudo ts_calibrate". For more details about that sunxi image refer to the wiki article and here:

https://www.olimex.com/wiki/How_to_connect_display_to_a_Lime_board
Title: Re: Calibration Issues with LCD-OLinuXino-10TS on A10-OLinuXino-LIME
Post by: akr on March 20, 2024, 02:51:41 PM
Hello,

So i was  finally able to get the correct calibration matrix . What i did was use the xlibinput_calibration (https://github.com/kreijack/xlibinput_calibrator/tree/master)  instead of xinput_calibrator. So the the xlibinput_calibration  seems to generate the correct calibration matrix for my device. So as shown bellow instead of the Coordinate Transformation Matrix(122) i have a new libinput Calibration Matrix(280) which seems to work.

olimex@a10-olinuxino:/etc/X11/xorg.conf.d$ xinput list-props "1c25000.rtp"
Device '1c25000.rtp':
        Device Enabled (121):   1
        Coordinate Transformation Matrix (122): 1.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 1.000000
        libinput Calibration Matrix (280):      1.113068, 0.011788, -0.059270, 0.001714, 1.349589, -0.187455, 0.000000, 0.000000, 1.000000
        libinput Calibration Matrix Default (281):      1.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 1.000000
        libinput Send Events Modes Available (243):     1, 0
        libinput Send Events Mode Enabled (244):        0, 0
        libinput Send Events Mode Enabled Default (245):        0, 0
        Device Node (246):      "/dev/input/event5"
        Device Product ID (247):        1, 1

 So i can set the property with command :  "xinput set-prop "1c25000.rtp" "libinput Calibration Matrix"  1.113068, 0.011788, -0.059270, 0.001714, 1.349589, -0.187455, 0.000000, 0.000000, 1.000000" and it works untill reboot.

But when i do "sudo reboot" then the value is again set to default 1 0 0 0 1 0 0 0 1. But now how can make the changes persistent. The olinuxino-ts file changes the Coordinate Transformation Matrix and not libinput Calibration Matrix(280). I tried to set the Option to just "Calibration Matrix"
 "$MATRIX"  and then set the correct $Matrix value generated with xlibinput_calibration but still  not working. Do you have any idea what i could do next?
Title: Re: Calibration Issues with LCD-OLinuXino-10TS on A10-OLinuXino-LIME
Post by: kalata23 on March 21, 2024, 11:16:34 AM
Just modify the olinuxino-ts script (/usr/lib/olinuxino/olinuxino-ts) for your needs, then you can run it once and reboot.