In Xubuntu 18.04 I'm trying to apply calibration parameters to a touch screen without success. Here is what I have so far...
I can manually attach the device and perform a calibration like this:
$ sudo /usr/bin/inputattach --daemon --always -elo /dev/ttyS2
$ xinput set-int-prop "Elo Serial TouchScreen" "Evdev Axis Calibration" 32 0 4095 0 4095
$ xinput_calibrator --output-type xinput
$ xinput set-int-prop "Elo Serial TouchScreen" "Evdev Axis Calibration" 32 -97 4087 -48 4108but the new parameters I set have no effect, even though xinput is listing the updated values. All the information I find is fairly old. Some suggest that evdev should be used instead of libinput (more on that later) but it can't be installed.
Here is what I did to automatically attach the input and handle calibration in the graphic server configuration:
$ cat /etc/udev/rules.d/99-elographics.rules
ACTION=="add|change", SUBSYSTEM=="tty|pnp", KERNEL=="ttyS2", TAG+="systemd", ENV{SYSTEMD_WANTS}+="elo-inputattach@%k.service"
$ cat /etc/systemd/system/elo-inputattach@.service
[Unit]
Description=inputattach for elo serial devices
[Service]
Type=simple
ExecStart=/usr/bin/inputattach -elo /dev/%I
$ cat /usr/share/X11/xorg.conf.d/99-calibration.conf
Section "InputClass" Identifier "calibration" MatchProduct "Elo Serial TouchScreen" Option "MinX" "-1587" Option "MaxX" "66954" Option "MinY" "-690" Option "MaxY" "67633" Option "SwapXY" "0" # unless it was already set to 1 Option "InvertX" "0" # unless it was already set Option "InvertY" "0" # unless it was already set
EndSectionin 99-calibration.conf I tried various options like
Option "Calibration" "-97 4087 -48 4108"I also tried to set the Driver to evdev in that section but it reverts to libinput.
Here is an extract from /var/log/Xorg.0.log:
[ 1446.102] (II) config/udev: Adding input device Elo Serial TouchScreen (/dev/input/event15)
[ 1446.102] (**) Elo Serial TouchScreen: Applying InputClass "libinput touchscreen catchall"
[ 1446.102] (**) Elo Serial TouchScreen: Applying InputClass "calibration"
[ 1446.102] (II) Using input driver 'libinput' for 'Elo Serial TouchScreen'
[ 1446.102] (**) Elo Serial TouchScreen: always reports core events
[ 1446.102] (**) Option "Device" "/dev/input/event15"
[ 1446.102] (**) Option "_source" "server/udev"
[ 1446.103] (II) event15 - Elo Serial TouchScreen: is tagged by udev as: Touchscreen
[ 1446.103] (II) event15 - Elo Serial TouchScreen: device is a touch device
[ 1446.103] (II) event15 - Elo Serial TouchScreen: device removed
[ 1446.135] (**) Option "config_info" "udev:/sys/devices/pnp0/00:08/tty/ttyS2/serio1/input/input7/event15"
[ 1446.135] (II) XINPUT: Adding extended input device "Elo Serial TouchScreen" (type: TOUCHSCREEN, id 13)
[ 1446.135] (**) Option "AccelerationScheme" "none"
[ 1446.135] (**) Elo Serial TouchScreen: (accel) selected scheme none/0
[ 1446.135] (**) Elo Serial TouchScreen: (accel) acceleration factor: 2.000
[ 1446.135] (**) Elo Serial TouchScreen: (accel) acceleration threshold: 4
[ 1446.136] (II) event15 - Elo Serial TouchScreen: is tagged by udev as: Touchscreen
[ 1446.136] (II) event15 - Elo Serial TouchScreen: device is a touch device
[ 1446.137] (II) config/udev: Adding input device Elo Serial TouchScreen (/dev/input/mouse1)
[ 1446.137] (**) Elo Serial TouchScreen: Applying InputClass "calibration"
[ 1446.137] (II) No input driver specified, ignoring this device.
[ 1446.137] (II) This device may have been added with another device file. 1 Answer
I received from the supplier an installation package which didn't work but helped me find a solution.
First, to install evdev, do this: # apt install xserver-xorg-input-evdev-hwe-18.04.
Second, additional X configuration is required to use the driver. And finally, the calibration parameter syntax was not correct. The improvments and additions are listed below:
$ cat /etc/udev/rules.d/99-elographics.rules
ACTION=="add|change", SUBSYSTEM=="tty|pnp", KERNEL=="ttyS2", TAG+="systemd", ENV{SYSTEMD_WANTS}+="elo-inputattach@%k.service"
$ cat /etc/systemd/system/elo-inputattach@.service
[Unit]
Description=Serial touch display enablement
Before=display-manager.service
[Service]
Type=simple
Restart=always
RestartSec=3s
ExecStart=/usr/bin/inputattach -elo /dev/%i
[Install]
WantedBy=graphical.target
$ cat /usr/share/X11/xorg.conf.d/50-touch-screen.conf
Section "InputClass" Identifier "evdev touchscreen override" MatchIsTouchscreen "on" MatchDevicePath "/dev/input/event*" Driver "evdev"
EndSection
$ cat /usr/share/X11/xorg.conf.d/99-calibration.conf
Section "InputClass" Identifier "calibration" MatchProduct "Elo Serial TouchScreen" Option "Calibration" "10 4080 80 4100" Option "SwapAxes" "0"
EndSection