Weston: no touch input

Hello,

I’m using a Verdin iMX8MM with BSP v6.2 on a custom carrier board and I have a similar problem like Weston-touch-calibrator problem: no devices listed.

We connected a display with USB touch, but weston doesn’t get the touch events most of the time.

The touch controller is enumerated:

$ lsusb
Bus 001 Device 004: ID 222a:0001 ILI Technology Corp. Multi-Touch Screen
[...]

The touch events are registered:

$ cat /proc/bus/input/devices
[...]

I: Bus=0003 Vendor=222a Product=0001 Version=0110
N: Name="ILITEK ILITEK-TP"
P: Phys=usb-ci_hdrc.1-1.4/input0
S: Sysfs=/devices/platform/soc@0/32c00000.bus/32e50000.usb/ci_hdrc.1/usb1/1-1/1-1.4/1-1.4:1.0/0003:222A:0001.0001/input/input5
U: Uniq=
H: Handlers=event2
B: PROP=2
B: EV=1b
B: KEY=400 0 0 0 0 0
B: ABS=260800000000003
B: MSC=20

I: Bus=0003 Vendor=222a Product=0001 Version=0110
N: Name="ILITEK ILITEK-TP Mouse"
P: Phys=usb-ci_hdrc.1-1.4/input0
S: Sysfs=/devices/platform/soc@0/32c00000.bus/32e50000.usb/ci_hdrc.1/usb1/1-1/1-1.4/1-1.4:1.0/0003:222A:0001.0001/input/input7
U: Uniq=
H: Handlers=event3
B: PROP=0
B: EV=1b
B: KEY=1f0000 0 0 0 0
B: ABS=3
B: MSC=10

And udevadm info shows that event2 is registered as a touchscreen:

udevadm info /dev/input/event2
P: /devices/platform/soc@0/32c00000.bus/32e50000.usb/ci_hdrc.1/usb1/1-1/1-1.4/1-1.4:1.0/0003:222A:0001.0001/input/input5/event2
N: input/event2
L: 0
S: input/by-id/usb-ILITEK_ILITEK-TP-event-if00
S: input/by-path/platform-ci_hdrc.1-usb-0:1.4:1.0-event
E: DEVPATH=/devices/platform/soc@0/32c00000.bus/32e50000.usb/ci_hdrc.1/usb1/1-1/1-1.4/1-1.4:1.0/0003:222A:0001.0001/input/input5/event2
E: DEVNAME=/dev/input/event2
E: MAJOR=13
E: MINOR=66
E: SUBSYSTEM=input
E: USEC_INITIALIZED=6375283
E: ID_INPUT=1
E: ID_INPUT_TOUCHSCREEN=1
E: ID_INPUT_WIDTH_MM=135
E: ID_INPUT_HEIGHT_MM=215
E: ID_VENDOR=ILITEK
E: ID_VENDOR_ENC=ILITEK
E: ID_VENDOR_ID=222a
E: ID_MODEL=ILITEK-TP
E: ID_MODEL_ENC=ILITEK-TP
E: ID_MODEL_ID=0001
E: ID_REVISION=0002
E: ID_SERIAL=ILITEK_ILITEK-TP
E: ID_TYPE=hid
E: ID_BUS=usb
E: ID_USB_INTERFACES=:030000:
E: ID_USB_INTERFACE_NUM=00
E: ID_USB_DRIVER=usbhid
E: ID_PATH=platform-ci_hdrc.1-usb-0:1.4:1.0
E: ID_PATH_TAG=platform-ci_hdrc_1-usb-0_1_4_1_0
E: LIBINPUT_DEVICE_GROUP=3/222a/1:usb-ci_hdrc.1-1
E: LIBINPUT_CALIBRATION_MATRIX=1 0 0 0 1 0
E: DEVLINKS=/dev/input/by-id/usb-ILITEK_ILITEK-TP-event-if00 /dev/input/by-path/platform-ci_hdrc.1-usb-0:1.4:1.0-event

I get touchevents:

$ evtest /dev/input/event2
Input driver version is 1.0.1
Input device ID: bus 0x3 vendor 0x222a product 0x1 version 0x110
Input device name: "ILITEK ILITEK-TP"
Supported events:
  Event type 0 (EV_SYN)
  Event type 1 (EV_KEY)
    Event code 330 (BTN_TOUCH)
  Event type 3 (EV_ABS)
    Event code 0 (ABS_X)
      Value  10090
      Min        0
      Max    16384
      Resolution      53
    Event code 1 (ABS_Y)
      Value   4642
      Min        0
      Max     9600
      Resolution      55
    Event code 47 (ABS_MT_SLOT)
      Value      1
      Min        0
      Max        9
    Event code 53 (ABS_MT_POSITION_X)
      Value      0
      Min        0
      Max    16384
      Resolution      53
    Event code 54 (ABS_MT_POSITION_Y)
      Value      0
      Min        0
      Max     9600
      Resolution      55
    Event code 57 (ABS_MT_TRACKING_ID)
      Value      0
      Min        0
      Max    65535
  Event type 4 (EV_MSC)
    Event code 5 (MSC_TIMESTAMP)
Properties:
  Property type 1 (INPUT_PROP_DIRECT)
Testing ... (interrupt to exit)
Event: time 1673539603.417363, type 3 (EV_ABS), code 47 (ABS_MT_SLOT), value 0
Event: time 1673539603.417363, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 3
Event: time 1673539603.417363, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 9772
Event: time 1673539603.417363, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 6770
Event: time 1673539603.417363, type 3 (EV_ABS), code 47 (ABS_MT_SLOT), value 1
Event: time 1673539603.417363, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 4
Event: time 1673539603.417363, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 7274
Event: time 1673539603.417363, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 6403
Event: time 1673539603.417363, type 1 (EV_KEY), code 330 (BTN_TOUCH), value 1
Event: time 1673539603.417363, type 3 (EV_ABS), code 0 (ABS_X), value 9772
Event: time 1673539603.417363, type 3 (EV_ABS), code 1 (ABS_Y), value 6770
Event: time 1673539603.417363, type 4 (EV_MSC), code 5 (MSC_TIMESTAMP), value 0
Event: time 1673539603.417363, -------------- SYN_REPORT ------------
Event: time 1673539603.423000, type 4 (EV_MSC), code 5 (MSC_TIMESTAMP), value 8000
Event: time 1673539603.423000, -------------- SYN_REPORT ------------
Event: time 1673539603.430351, type 4 (EV_MSC), code 5 (MSC_TIMESTAMP), value 16000
Event: time 1673539603.430351, -------------- SYN_REPORT ------------
Event: time 1673539603.440355, type 4 (EV_MSC), code 5 (MSC_TIMESTAMP), value 24000
Event: time 1673539603.440355, -------------- SYN_REPORT ------------
Event: time 1673539603.447102, type 4 (EV_MSC), code 5 (MSC_TIMESTAMP), value 32000
Event: time 1673539603.447102, -------------- SYN_REPORT ------------
Event: time 1673539603.452982, type 3 (EV_ABS), code 47 (ABS_MT_SLOT), value 0
Event: time 1673539603.452982, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 9775
Event: time 1673539603.452982, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 6763
Event: time 1673539603.452982, type 3 (EV_ABS), code 47 (ABS_MT_SLOT), value 1
Event: time 1673539603.452982, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 7277
Event: time 1673539603.452982, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 6395
Event: time 1673539603.452982, type 3 (EV_ABS), code 0 (ABS_X), value 9775
Event: time 1673539603.452982, type 3 (EV_ABS), code 1 (ABS_Y), value 6763
Event: time 1673539603.452982, type 4 (EV_MSC), code 5 (MSC_TIMESTAMP), value 40000
Event: time 1673539603.452982, -------------- SYN_REPORT ------------
Event: time 1673539603.460366, type 3 (EV_ABS), code 47 (ABS_MT_SLOT), value 0
Event: time 1673539603.460366, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 9781
Event: time 1673539603.460366, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 6747
Event: time 1673539603.460366, type 3 (EV_ABS), code 47 (ABS_MT_SLOT), value 1
Event: time 1673539603.460366, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 7283
Event: time 1673539603.460366, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 6379
Event: time 1673539603.460366, type 3 (EV_ABS), code 0 (ABS_X), value 9781
Event: time 1673539603.460366, type 3 (EV_ABS), code 1 (ABS_Y), value 6747
Event: time 1673539603.460366, type 4 (EV_MSC), code 5 (MSC_TIMESTAMP), value 48000
Event: time 1673539603.460366, -------------- SYN_REPORT ------------

[...]

Event: time 1673539603.796334, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value -1
Event: time 1673539603.796334, type 3 (EV_ABS), code 47 (ABS_MT_SLOT), value 1
Event: time 1673539603.796334, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value -1
Event: time 1673539603.796334, type 1 (EV_KEY), code 330 (BTN_TOUCH), value 0
Event: time 1673539603.796334, type 4 (EV_MSC), code 5 (MSC_TIMESTAMP), value 408000
Event: time 1673539603.796334, -------------- SYN_REPORT ------------

But weston sees no device:

$ weston-touch-calibrator
could not load cursor 'dnd-move'
could not load cursor 'dnd-copy'
could not load cursor 'dnd-none'
No devices listed.

It only works when I restart weston

$ systemctl restart weston
[  752.141395] audit: type=1701 audit(1692372715.840:34): auid=1001 uid=1001 gid=1005 ses=2 pid=765 comm="weston" exe="/usr/bin/weston" sig=11 res=1
[  752.363841] audit: type=1006 audit(1692372716.064:35): pid=828 uid=0 old-auid=4294967295 auid=1001 tty=tty7 old-ses=4294967295 ses=4 res=1
[  752.376552] audit: type=1300 audit(1692372716.064:35): arch=c00000b7 syscall=64 success=yes exit=4 a0=8 a1=ffffd7a009d0 a2=4 a3=0 items=0 ppid=1 pid=828 auid=1001 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=tty7 ses=4 comm="(weston)" exe="/lib/systemd/systemd" key=(null)
[  752.402349] audit: type=1327 audit(1692372716.064:35): proctitle="(weston)"

$ 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/32c00000.bus/32e50000.usb/ci_hdrc.1/usb1/1-1/1-1.4/1-1.4:1.0/0003:222A:0001.0001/input/input5/event2" - head "DSI-1"

But then I’m lost with a blackscreen. What can I do?

dmesg.log (30.9 KB)

Best regards,
Markus

Some more infos:

Weston also sees the touch device when I replug the USB touch controller:

$ weston-touch-calibrator
could not load cursor 'dnd-move'
could not load cursor 'dnd-copy'
could not load cursor 'dnd-none'
No devices listed.

$ [ 1459.891823] usb 1-1.4: USB disconnect, device number 4
[ 1468.563915] usb 1-1.4: new full-speed USB device number 7 using ci_hdrc
[ 1468.686225] input: ILITEK ILITEK-TP as /devices/platform/soc@0/32c00000.bus/32e50000.usb/ci_hdrc.1/usb1/1-1/1-1.4/1-1.4:1.0/0003:222A:0001.0002/input/input8
[ 1468.701010] input: ILITEK ILITEK-TP Mouse as /devices/platform/soc@0/32c00000.bus/32e50000.usb/ci_hdrc.1/usb1/1-1/1-1.4/1-1.4:1.0/0003:222A:0001.0002/input/input10
[ 1468.716628] hid-multitouch 0003:222A:0001.0002: input,hiddev96: USB HID v1.10 Mouse [ILITEK ILITEK-TP] on usb-ci_hdrc.1-1.4/input0

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/32c00000.bus/32e50000.usb/ci_hdrc.1/usb1/1-1/1-1.4/1-1.4:1.0/0003:222A:0001.0002/input/input8/event2" - head "DSI-1"

So it seems that weston or libinput starts at the moment when the usb devices are not yet fully enumerated. But during the boot process (boot.log) the touch controller is registered several seconds before the weston.service is started.

Can somebody help me with that problem?

Best regards,
Markus

Hello @Mowlwurf,

Thanks for reaching out.

It seems that the issue is related to the timing of the enumeration and initialization of the USB touch controller in relation to the start of the Weston compositor. One solution would be to introduce a delay starting of Weston (which might not be that elegant though). You could try something like this:

Create a Systemd Service:

# vi /etc/systemd/system/weston-delayed-start.service
[Unit]
Description=Delayed start for Weston
After=multi-user.target

[Service]
ExecStart=/bin/bash -c "sleep 5 && /usr/bin/weston"
Restart=on-failure

[Install]
WantedBy=multi-user.target

Adjust the sleep time as needed.

Save the file, Enable and Start the Service:

# systemctl enable weston-delayed-start.service
# systemctl start weston-delayed-start.service

Reboot your system and test again.
Please let me know if this would be a solution for you.

Hello Rudhi,

thank you for your response.

Yes, delaying the start of weston works. But as you wrote: it isn’t a good solution. It only addresses the symptoms, not the cause.

What conditions must be met for libinput to safely detect the touch controller when Weston is started?

Best regards,
Markus

Another possible workaround: restart the enumeration of the touch controller:

$ weston-touch-calibrator
could not load cursor 'dnd-move'
could not load cursor 'dnd-copy'
could not load cursor 'dnd-none'
No devices listed.

$ echo '1-1.4' > /sys/bus/usb/drivers/usb/unbind

$ echo '1-1.4' > /sys/bus/usb/drivers/usb/bind
[   68.510395] input: ILITEK ILITEK-TP as /devices/platform/soc@0/32c00000.bus/32e50000.usb/ci_hdrc.1/usb1/1-1/1-1.4/1-1.4:1.0/0003:222A:0001.0002/input/input8
[   68.525523] input: ILITEK ILITEK-TP Mouse as /devices/platform/soc@0/32c00000.bus/32e50000.usb/ci_hdrc.1/usb1/1-1/1-1.4/1-1.4:1.0/0003:222A:0001.0002/input/input10
[   68.540722] hid-multitouch 0003:222A:0001.0002: input,hiddev96: USB HID v1.10 Mouse [ILITEK ILITEK-TP] on usb-ci_hdrc.1-1.4/input0

$ 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/32c00000.bus/32e50000.usb/ci_hdrc.1/usb1/1-1/1-1.4/1-1.4:1.0/0003:222A:0001.0002/input/input8/event2" - head "DSI-1"

This only makes sense if the touchcontroller is always connected to the same port of the usb hub (in my case: #4)

To restart the hub, that is connect to the SOM:

$ echo '1-1' > /sys/bus/usb/drivers/usb/unbind
$ echo '1-1' > /sys/bus/usb/drivers/usb/bind

To restart the usb hub in the SOM:

$ echo usb1 > /sys/bus/usb/drivers/usb/unbind
$ echo usb1 > /sys/bus/usb/drivers/usb/bind

But again: this is only addressing the symptoms.

Is it possible to restart the device detection of libinput in a easier way? Without rebinding the device?

Best regards,
Markus

Hello @Mowlwurf,

I’m waiting for a USB touch display (unfortunately, I don’t have one here at the moment) to try and see if I can reproduce this issue. I’ll let you know the progress/next steps in a few days.

Hello @Mowlwurf,

I haven’t been able to reproduce the issue. I got the touch events working with Weston on BSP 6.2 just out of the box. I have a Verdin iMX8M Mini WB module with a Yavia board here. See some of my command line outputs below:

root@verdin-imx8mm-06912267:~# lsusb
Bus 001 Device 003: ID 222a:0001 ILI Technology Corp. Multi-Touch Screen
Bus 001 Device 002: ID 0424:2514 Microchip Technology, Inc. (formerly SMSC) USB 2.0 Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
root@verdin-imx8mm-06912267:~# 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/32c00000.bus/32e50000.usb/ci_hdrc.1/usb1/1-1/1-1.1/1-1.1:1.0/0003:222A:0001.0001/input/input6/event2" - head "HDMI-A-1"

Could you please try with one of our carrier boards? Also, have you reviewed your custom carrier board design with our hardware expert? We give free carrier board review sessions to our customers. Let me know if you would be interested in that.