Resistive touch screen calibration does not work on BSP 6.1 with weston-touch-calibration

Hi everyone.

I got an error when try to run the weston-touch-calibration. Following the output:

root@colibri-imx6ull-06823042:~# weston-touch-calibrator 
could not load cursor 'dnd-move'
could not load cursor 'dnd-copy'
could not load cursor 'dnd-none'
device "/sys/devices/platform/soc/2100000.bus/21a4000.i2c/i2c-1/1-002c/input/input0/event0" - head "DPI-1"

I performed some modification, provides in this other post.

The original weston.ini was

# configuration file for Weston

[core]
use-pixman=true
idle-time=0
#modules=xwayland.so,cms-colord.so
#shell=desktop-shell.so
#gbm-format=xrgb2101010
require-input=false

#[shell]
#background-image=/usr/share/backgrounds/gnome/Aqua.jpg
#background-color=0xff002244
#background-type=tile
#clock-format=minutes
#panel-color=0x90ff0000
#locking=true
#animation=zoom
#startup-animation=fade
#binding-modifier=ctrl
#num-workspaces=6
#cursor-theme=whiteglass
#cursor-size=24

#lockscreen-icon=/usr/share/icons/gnome/256x256/actions/lock.png
#lockscreen=/usr/share/backgrounds/gnome/Garden.jpg
#homescreen=/usr/share/backgrounds/gnome/Blinds.jpg
#animation=fade

#[launcher]
#icon=/usr/share/icons/gnome/24x24/apps/utilities-terminal.png
#path=/usr/bin/gnome-terminal

#[launcher]
#icon=/usr/share/icons/gnome/24x24/apps/utilities-terminal.png
#path=/usr/bin/weston-terminal

#[launcher]
#icon=/usr/share/icons/hicolor/24x24/apps/google-chrome.png
#path=/usr/bin/google-chrome

#[launcher]
#icon=/usr/share/icons/gnome/24x24/apps/arts.png
#path=/build/weston-0lEgCh/weston-1.11.0/weston-flower

#[input-method]
#path=/usr/libexec/weston-keyboard

#[output]
#name=LVDS1
#mode=1680x1050
#transform=90
#icc_profile=/usr/share/color/icc/colord/Bluish.icc

#[output]
#name=VGA1
#mode=173.00  1920 2048 2248 2576  1080 1083 1088 1120 -hsync +vsync
#transform=flipped

#[output]
#name=X1
#mode=1024x768
#transform=flipped-90

[libinput]
enable_tap=true
touchscreen_calibrator=true
calibration_helper=/usr/bin/toradex-save-touchscreen-calibration

#[touchpad]
#constant_accel_factor = 50
#min_accel_factor = 0.16
#max_accel_factor = 1.0

[screen-share]
command=/usr/bin/weston --backend=rdp-backend.so --shell=fullscreen-shell.so --no-clients-resize

#[xwayland]
#path=/usr/bin/Xwayland

I change it to

# configuration file for Weston

[core]
idle-time=0
require-input=false
xwayland=true

[libinput]
touchscreen_calibrator=true
calibration_helper=/usr/bin/save-calibration.sh

[shell]
panel-position=top
locking=false
allow-zap=true
num-workspaces=1

And I created the /usr/bin/save-calibration.sh file with execution permission.

#!/bin/bash

# Store the transformation arguments for the resistive touchscreen as udev rule
echo 'SUBSYSTEM=="input", KERNEL=="event[0-9]*", ENV{ID_INPUT_TOUCHSCREEN}=="1", ENV{LIBINPUT_CALIBRATION_MATRIX}="'$2 $3 $4 $5 $6 $7'"' >> /etc/udev/rules.d/touchscreen.rules

After the reset I check the content inside /etc/udev/rules.d/touchscreen.rules file. Is it right?

# There are a number of modifiers that are allowed to be used in some
# of the different fields. They provide the following subsitutions:
#
# %n the "kernel number" of the device.
#    For example, 'sda3' has a "kernel number" of '3'
# %e the smallest number for that name which does not matches an existing node
# %k the kernel name for the device
# %M the kernel major number for the device
# %m the kernel minor number for the device
# %b the bus id for the device
# %c the string returned by the PROGRAM
# %s{filename} the content of a sysfs attribute
# %% the '%' char itself
#

# Create a symlink to any touchscreen input device
SUBSYSTEM=="input", KERNEL=="event[0-9]*", ATTRS{modalias}=="input:*-e0*,3,*a0,1,*18,*", SYMLINK+="input/touchscreen0"
SUBSYSTEM=="input", KERNEL=="event[0-9]*", ATTRS{modalias}=="ads7846", SYMLINK+="input/touchscreen0"

After all of these modifications, the error is still the same.

Thanks for any help!

System and Hardware:

  • TDX Wayland with XWayland Upstream 6.1.0+build.5 (kirkstone) colibri-imx6ull-06823042 ttymxc0
    Colibri-iMX6ULL_Reference-Multimedia-Image-upstream
  • Linux colibri-imx6ull-06823042 6.0.17-6.1.0+git.71e1e02850ab #1 SMP Wed Jan 4 10:26:32 UTC 2023 armv7l armv7l armv7l GNU/Linux
  • Colibri iMX6ULL 512MB IT V1.1A
  • Custom board based on Aster V1.1B
1 Like

Hi @CharlesDias ,

Thanks for detailed information!

The output of the command weston-touch-calibrator shows the event0 as an input device, whichis the expected output, what exactly error did you face?

Your /usr/bin/save-calibration.sh also seems right, it’s also according to this answer on NXP community.

Best regards,
Daniel Morais

Hi @daniel_m.tx .

When a run the weston-touch-calibrator I got the message below and no one calibration process is shown.

Thanks for you help!

Hello Charles
any news on this topic?
I have the same problem on verdin-imx8mp on dahlia board with resistive touch and lvds-display.
“weston-touch-calibrator” application is finishing without opening any GUI or displaying any error message, just output same like yours.

weston-calibrator application is working normal and showing calibration values when finished, but not saving them.

Looks like Touch is working, only weston-touch-calibration app has some problem.

Thanks for help!

I know in the past, I would first run the calibrator to figure out the input device, then run it again with the touch input device on the command line for the calibrator. Like:

weston-touch-calibrator /sys/devices/platform/soc/2100000.bus/21a4000.i2c/i2c-1/1-002c/input/input0/event0

Maybe the latest stuff with the containers and whatnot doesn’t need that anymore?

Hi @DaveM ,
this was the solution for my problem!!
Thanks a lot!

1 Like

Hi @DaveM.

This solved my problem on iMX6ULL too. However, I need to do extra steps to configure the display resolution on BSP 6.0. These steps are described in this link.

Thanks a lot for your help!

1 Like