Touch screen not working

More
18 Dec 2021 15:06 #229406 by Thom
I wanted to implement a Touchscreen to my Linux CNC milling machine:Therefore I use a Touchscreen, which is detected by Linux as “EloTouchSystems,Inc Elo TouchSystems 2216 AccuTouch® USB Touchmonitor Interface”
 The touch is working as well, but the Y Axis of the Toch input is inverted
=>So I edited the config file /usr/share/X11/xorg.conf.d/40-libinput.conf and added the last section “calibration”
 [code]# Match on all types of devices but tablet devices and joysticks
Section "InputClass"
        Identifier "libinput pointer catchall"
        MatchIsPointer "on"
        MatchDevicePath "/dev/input/event*"
        Driver "libinput"
EndSection

Section "InputClass"
        Identifier "libinput keyboard catchall"
        MatchIsKeyboard "on"
        MatchDevicePath "/dev/input/event*"
        Driver "libinput"
EndSection

Section "InputClass"
        Identifier "libinput touchpad catchall"
        MatchIsTouchpad "on"
        MatchDevicePath "/dev/input/event*"
        Driver "libinput"
EndSection

Section "InputClass"
        Identifier "libinput touchscreen catchall"
        MatchIsTouchscreen "on"
        MatchDevicePath "/dev/input/event*"
        Driver "libinput"
EndSection

Section "InputClass"
        Identifier "libinput tablet catchall"
        MatchIsTablet "on"
        MatchDevicePath "/dev/input/event*"
        Driver "libinput"
EndSection

Section "InputClass"
        Identifier    "calibration"
        MatchProduct    "EloTouchSystems,Inc Elo TouchSystems 2216 AccuTouch® USB Touchmonitor Interface"
#        MatchIsPointer "on"
        MatchDevicePath "/dev/input/event*"
        Driver "elographics"
        Option    "AlwaysCore"
        Option    "sreenNo"    "1"
        Option    "MinX"    "4446"
        Option    "MaxX"    "59400"
        Option    "MinY"    "5707"
        Option    "MaxY"    "57844"
#        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
EndSection
[/code]
But now it is not working at all: in the log I have the following errors:
..
BUG: triggered 'if (dev->focus != ((void *)0))'
..
Unable to allocate Elographics touchscreen FocusClassDeviceStruct
..
[    23.732] (II) config/udev: Adding input device EloTouchSystems,Inc Elo TouchSystems 2216 AccuTouch® USB Touchmonitor Interface (/dev/input/event2)
[    23.732] (**) EloTouchSystems,Inc Elo TouchSystems 2216 AccuTouch® USB Touchmonitor Interface: Applying InputClass "evdev pointer catchall"
[    23.733] (**) EloTouchSystems,Inc Elo TouchSystems 2216 AccuTouch® USB Touchmonitor Interface: Applying InputClass "libinput pointer catchall"
[    23.733] (**) EloTouchSystems,Inc Elo TouchSystems 2216 AccuTouch® USB Touchmonitor Interface: Applying InputClass "calibration"
[    23.733] (II) LoadModule: "elographics"
[    23.733] (II) Loading /usr/lib/xorg/modules/input/elographics_drv.so
[    23.734] (II) Module elographics: vendor="X.Org Foundation"
[    23.734]     compiled for 1.19.0, module version = 1.4.1
[    23.734]     Module class: X.Org XInput Driver
[    23.734]     ABI class: X.Org XInput driver, version 24.1
[    23.734] (II) Using input driver 'elographics' for 'EloTouchSystems,Inc Elo TouchSystems 2216 AccuTouch® USB Touchmonitor Interface'
[    23.734] (**) Option "AlwaysCore"
[    23.734] (**) EloTouchSystems,Inc Elo TouchSystems 2216 AccuTouch® USB Touchmonitor Interface: always reports core events
[    23.734] (**) Option "Device" "/dev/input/event2"
[    23.848] (**) Elographics associated screen: 0
[    23.848] (**) Elographics untouch delay: 50 ms
[    23.848] (**) Elographics report delay: 10 ms
[    23.848] (**) Option "MaxX" "59400"
[    23.848] (**) Elographics maximum x position: 59400
[    23.848] (**) Option "MinX" "4446"
[    23.848] (**) Elographics minimum x position: 4446
[    23.848] (**) Option "MaxY" "57844"
[    23.848] (**) Elographics maximum y position: 57844
[    23.848] (**) Option "MinY" "5707"
[    23.848] (**) Elographics minimum y position: 5707
[    23.848] (**) Elographics device will work in Landscape mode
[    23.848] (**) Option "config_info" "udev:/sys/devices/pci0000:00/0000:00:13.0/usb7/7-1/7-1:1.0/0003:04E7:0050.0003/input/input5/event2"
[    23.848] (II) XINPUT: Adding extended input device "EloTouchSystems,Inc Elo TouchSystems 2216 AccuTouch® USB Touchmonitor Interface" (type: TOUCHSCREEN, id 10)
[    23.848] (EE) BUG: triggered 'if (dev->focus != ((void *)0))'
[    23.848] (EE) BUG: ../../../../dix/devices.c:1434 in InitFocusClassDeviceStruct()
[    23.849] (EE) 
[    23.849] (EE) Backtrace:
[    23.849] (EE) 0: /usr/lib/xorg/Xorg (xorg_backtrace+0x4a) [0x5587584e13aa]
[    23.849] (EE) 1: /usr/lib/xorg/Xorg (InitFocusClassDeviceStruct+0x50) [0x558758373b20]
[    23.849] (EE) 2: /usr/lib/xorg/modules/input/elographics_drv.so (0x7f42534f0000+0x2199) [0x7f42534f2199]
[    23.849] (EE) 3: /usr/lib/xorg/Xorg (ActivateDevice+0x4f) [0x55875837329f]
[    23.849] (EE) 4: /usr/lib/xorg/Xorg (0x558758328000+0xa6121) [0x5587583ce121]
[    23.849] (EE) 5: /usr/lib/xorg/Xorg (0x558758328000+0xb882b) [0x5587583e082b]
[    23.850] (EE) 6: /usr/lib/xorg/Xorg (0x558758328000+0xb8e73) [0x5587583e0e73]
[    23.850] (EE) 7: /usr/lib/xorg/Xorg (config_init+0x9) [0x5587583df859]
[    23.850] (EE) 8: /usr/lib/xorg/Xorg (InitInput+0xc7) [0x5587583c2db7]
[    23.850] (EE) 9: /usr/lib/xorg/Xorg (0x558758328000+0x5a8d1) [0x5587583828d1]
[    23.850] (EE) 10: /lib/x86_64-linux-gnu/libc.so.6 (__libc_start_main+0xf1) [0x7f425f7a82e1]
[    23.850] (EE) 11: /usr/lib/xorg/Xorg (_start+0x2a) [0x55875836c5aa]
[    23.850] (EE) 
[    23.850] Unable to allocate Elographics touchscreen FocusClassDeviceStruct
[    23.850] (**) EloTouchSystems,Inc Elo TouchSystems 2216 AccuTouch® USB Touchmonitor Interface: (accel) keeping acceleration scheme 1
[    23.850] (**) EloTouchSystems,Inc Elo TouchSystems 2216 AccuTouch® USB Touchmonitor Interface: (accel) acceleration profile 0
[    23.850] (**) EloTouchSystems,Inc Elo TouchSystems 2216 AccuTouch® USB Touchmonitor Interface: (accel) acceleration factor: 2.000
[    23.850] (**) EloTouchSystems,Inc Elo TouchSystems 2216 AccuTouch® USB Touchmonitor Interface: (accel) acceleration threshold: 4
[    23.909] Not at the specified rate or model 2310, will continue
[    23.910] (II) config/udev: Adding input device EloTouchSystems,Inc Elo TouchSystems 2216 AccuTouch® USB Touchmonitor Interface (/dev/input/js0)
[    23.910] (II) No input driver specified, ignoring this device.
[    23.910] (II) This device may have been added with another device file.
[    23.912] (II) config/udev: Adding input device EloTouchSystems,Inc Elo TouchSystems 2216 AccuTouch® USB Touchmonitor Interface (/dev/input/mouse1)
[    23.912] (II) No input driver specified, ignoring this device.
[    23.912] (II) This device may have been added with another device file.
[    23.912] (II) config/udev: Adding input device PC Speaker (/dev/input/event5)

Any ideas?

Best regards,
Thomas

Please Log in or Create an account to join the conversation.

More
18 Dec 2021 17:05 #229413 by Aciera
Replied by Aciera on topic Touch screen not working
Yes, I've had the same issue with an ELO touchscreen a while ago.
Solution for me was to set the transformation matrix.

First find the device name of your touch screen:
$ xinput list

Look for the touch device name in the Virtual core pointer section and copy/paste that somewhere as you will need this later. In my case the device name was "EloTouchSystems,Inc Elo TouchSystems 2216 AccuTouch® USB Touchmonitor Interface".

Now you will need to find the settings for the transformation matrix:

The screen is calibrated using a Coordinate Transformation Matrix, which defaults to the identity matrix.

[1 0 0]
[0 1 0]
[0 0 1]

for convenient entry, the matrix is flatted into a single line like this

1 0 0 0 1 0 0 0 1

were the values seem to map like this

[hscale] [vskew] [hoffset] [hskew] [vscale] [voffset] 0 0 1

To test calibration use this in terminal:
DISPLAY=:0.0 xinput set-prop "Coordinate Transformation Matrix" 1 0 0 0 -1 1 0 0 1

The above should flip your touch vertically. I also had to scale the touch entry on my device.

Now to set this permanently (after login):

Create file: ~/.xsessionrc

Content of my file:
# added to get the ELO touchscreen to flip the touch in Y
xinput set-prop "EloTouchSystems,Inc Elo TouchSystems 2216 AccuTouch® USB Touchmonitor Interface" "Coordinate Transformation Matrix" 1.205 0 -0.07 0 -1.27 1.11 0 0 1

Note that I these are my values (with scaling) so use your device name and transformation values instead
The following user(s) said Thank You: Thom

Please Log in or Create an account to join the conversation.

More
18 Dec 2021 22:03 #229437 by ALittleOffTheRails

Please Log in or Create an account to join the conversation.

More
19 Dec 2021 11:31 #229483 by Thom
Replied by Thom on topic Touch screen not working
This was exactly the solution!Thank you very much!
Just for Information:
$ DISPLAY=:0.0 xinput set-prop "Coordinate Transformation Matrix" 1 0 0 0 -1 1 0 0 1
Was not working for me, I used
$ xinput set-prop 10 "Coordinate Transformation Matrix" 1 0 0 0 -1 1 0 0 1
The “10” is the device ID (figured out by $ xinput list)

Please Log in or Create an account to join the conversation.

Time to create page: 0.062 seconds
Powered by Kunena Forum