Hi.
I have an imx7d board running with a yocto-built imx-linux-zeus version operating system (with weston implementation of wayland). Everything's working fine except for touchscreen calibration. I can calibrate touchscreen via weston-touch-calibrator application without any problem. However, after reboot touch screen calibration reverts to the default calibration values. I couldn't find any calibration matrix on the user space. How can I make the calibration permanent?
I appreciate any help you can provide..
Solved! Go to Solution.
Hello ahmetcihan,
You need to be in kernel mode and modified the weston.ini, this will be done one time.
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
Regards
Hello ahmetcihan,
You need to be in kernel mode and modified the weston.ini, this will be done one time.
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
Regards
Thank you. It's working now. In addition, my save-calibration.sh file is as;
#!/bin/bash
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
Hi @ahmetcihan,
I want to save touch-panel calibration permanently. I used weston-touch-calibrator, It calibers touch panel but does not save calibration after weston restart or reboot. I followed your post but no success. My weston.ini, save-calibration.sh as follows.
Weston.ini as follow.
*************************************
[core]
#gbm-format=argb8888
idle-time=0
require-input=false
use-g2d=1
xwayland=true
repaint-window=16
#enable-overlay-view=1
[shell]
size=960x480
panel-position=top
locking=false
allow-zap=true
num-workspaces=1
[libinput]
touchscreen_calibrator=true
calibration_helper=/usr/bin/save-calibration.sh
#calibration_helper=/bin/echo
[output]
name=DSI-1
mode=960x480@24
transform=rotate-90
#[output]
#name=HDMI-A-2
#mode=off
# WIDTHxHEIGHT Resolution size width and height in pixels
# off Disables the output
# preferred Uses the preferred mode
# current Uses the current crt controller mode
#transform=rotate-90
[screen-share]
command=@bindir@/weston --backend=rdp-backend.so --shell=fullscreen-shell.so --no-clients-resize
[launcher]
icon=/home/root/.nxp-demo-experience/icon/icon_demo_launcher.png
path=/usr/bin/demoexperience
[launcher]
icon=/usr/share/weston/terminal.png
path=/usr/bin/weston-terminal
***********************************************
save-calibration.sh as follow.
***********************************************
#!/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
***********************************************
Please provide a lead.
Thanks,
Ajita
Hi Ajita.
Are you sure that ENV{ID_INPUT_TOUCHSCREEN}=="1" for your system? When you calibrate your system, are you sure it's working before reboot? You can check this with some faulty calibration.
Hi @ahmetcihan,
I able to save calibration permanently. There were multiple stale calibration entries in '/etc/udev/rules.d/touchscreen.rules' file which was causing incorrect calibration after restart. Rules file should contain single fresh entry of calibration.
Thanks for your post. It helped me!
Regards,
Ajita
I am also working on weston.
I can able to integrate the weston utility in my yocto but when I run, I get the below Error.
root@imx53qsb:~# weston-touch-calibrator
failed to connect to Wayland display: No such file or directory
when I run weston , I get below errors
root@imx53qsb:/# weston
Date: 2023-08-10 UTC
[04:56:00.346] weston 10.0.2
https://wayland.freedesktop.org
Bug reports to: https://gitlab.freedesktop.org/wayland/weston/issues/
Build: 10.0.2
[04:56:00.347] Command line: weston
[04:56:00.347] OS: Linux, 6.1.38-fslc+gb7129fd88027, #1 SMP Fri Jul 14 17:17:36 UTC 2023, armv7l
[04:56:00.347] Flight recorder: enabled
[04:56:00.349] Using config file '/etc/xdg/weston/weston.ini'
[04:56:00.349] Output repaint window is 7 ms maximum.
[04:56:00.350] Loading module '/usr/lib/libweston-10/drm-backend.so'
[04:56:00.397] initializing drm backend
[04:56:00.397] Trying logind launcher...
[04:56:00.399] logind: failed to get session seat
[04:56:00.399] logind: cannot setup systemd-logind helper error: (No data available), using legacy fallback
[04:56:00.400] Trying weston_launch launcher...
[04:56:00.400] could not get launcher fd from env
[04:56:00.400] Trying direct launcher...
[04:56:00.400] <stdin> not a vt
[04:56:00.400] if running weston from ssh, use --tty to specify a tty
[04:56:00.400] fatal: drm backend should be run using weston-launch binary, or your system should provide the logind D-Bus API.
[04:56:00.400] fatal: failed to create compositor backend
Internal warning: debug scope 'drm-backend' has not been destroyed.
root@imx53qsb:/#
Please suggest how to proceed and any dependencies to be added
Hi @syedr1 ,
I do get same log for `weston` command. but for `weston-touch-calibrator` I get below output.
**********************************************************************************
root@imx8mmevk:~# 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@0/soc@0:bus@30800000/30a40000.i2c/i2c-2/2-001a/input/input1/event1" - head "DSI-1"
************************************************************************************
as my display touch panel is connected over MIPI-DSI. By observing your log, it seems your display panel is not correctly initialized with weston.
You can test few things:
1. While booting whether you able to see boot up penguins on display.
2. Whether you able to get touch co-ordinates on evtest,
ex. root@imx8mmevk:~# evtest /dev/input/event1
Input driver version is 1.0.1
Input device ID: bus 0x18 vendor 0x0 product 0x0 version 0x0
Input device name: "hyn_ts"
....
3. Check if you have build yocto image with `xwayland`, mine was `fsl-imx-xwayland`. It contains support of x11 and weston.
I hope these things will give you lead.
Thanks,
Ajita
Hi @ajita02
Thanks for the reply.
I have verified touch with cat /dev/input/event0 and I see touch interrupts are happening whenever I touch it.
Regrading Display, I can see our custom images loading during boot.
root@imx53qsb:~# cat /sys/class/drm/card1-LVDS-1/device/card1-LVDS-1/uevent
DEVTYPE=drm_connector
root@imx53qsb:~# cat /sys/class/drm/card1-LVDS-1/modes
1024x768
my distro is poky.
Is there a way to initialize display panel with Weston,Please suggest
Hi @syedr1 ,
what is your output of `cat /sys/class/drm/card1-DSI-1/device/card1-DSI-1/status`? also can you see frame buffer created?
`ls /dev/fb*`
Hi @ajita02
It is connected.
root@imx53qsb:~# cat /sys/class/drm/card1-LVDS-1/device/card1-LVDS-1/status
connected
@syedr1 , Can you share your /etc/xdg/weston/weston.ini file?
Hi @syedr1 , I have attached my weston.ini. PTAL. In your weston.ini few fields are commented. Such as #[output], #[libinput], #[shell]. can you make changes according to my weston.ini and restart the weston, ` systemctl restart weston@root` ? also `LVDS1` should be `LVDS-1`, I guess.
*******************************************************
root@imx8mmevk:~# cat /etc/xdg/weston/weston.ini,
[core]
#gbm-format=argb8888
idle-time=0
require-input=false
use-g2d=1
xwayland=true
repaint-window=16
#enable-overlay-view=1
[shell]
size=960x480
panel-position=top
locking=false
allow-zap=true
num-workspaces=1
[libinput]
touchscreen_calibrator=true
calibration_helper=/usr/bin/save-calibration.sh
#calibration_helper=/bin/echo
[output]
name=DSI-1
mode=960x480@24
transform=rotate-90
#[output]
#name=HDMI-A-2
#mode=off
# WIDTHxHEIGHT Resolution size width and height in pixels
# off Disables the output
# preferred Uses the preferred mode
# current Uses the current crt controller mode
#transform=rotate-90
[screen-share]
command=@bindir@/weston --backend=rdp-backend.so --shell=fullscreen-shell.so --no-clients-resize
[launcher]
icon=/home/root/.nxp-demo-experience/icon/icon_demo_launcher.png
path=/usr/bin/demoexperience
[launcher]
icon=/usr/share/weston/terminal.png
path=/usr/bin/weston-terminal
**************************************************************
Hi @ajita02
Tried with you weston.ini , Issue is still same.
also `LVDS1` should be `LVDS-1`, I guess. --> still issue persist?
Hi @ajita02
After changing to LVDS-1 also issue persist.
Below is my env information and display is not listed.
root@imx53qsb:~# env
SHELL=/bin/sh
EDITOR=vi
PWD=/home/root
LOGNAME=root
XDG_SESSION_TYPE=tty
MOTD_SHOWN=pam
HOME=/home/root
LANG=C
XDG_SESSION_CLASS=user
TERM=linux
USER=root
SHLVL=1
SYSTEMD_PAGER=
XDG_SESSION_ID=c2
XDG_RUNTIME_DIR=/run/user/0
PS1=\u@\h:\w\$
HUSHLOGIN=FALSE
PATH=/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin
DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/0/bus
MAIL=/var/spool/mail/root
_=/usr/bin/env
Any thing missing if compared with your env data.
hi @syedr1 ,
my env output,
root@imx8mmevk:~# env
SHELL=/bin/sh
EDITOR=vi
PWD=/home/root
LOGNAME=root
XDG_SESSION_TYPE=tty
HOME=/home/root
LANG=C
QT_QPA_PLATFORM=wayland
XDG_SESSION_CLASS=user
TERM=xterm
USER=root
SHLVL=1
XDG_SESSION_ID=c2
XDG_RUNTIME_DIR=/run/user/0
PS1=\u@\h:\w\$
HUSHLOGIN=FALSE
PATH=/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin
DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/0/bus
MAIL=/var/spool/mail/root
_=/usr/bin/env
I am running out of ideas. NXP guys should give you further lead.
Thanks,
Ajita