5" touch HDMI+USB touch screen problem

I’m considering a custom build, possibly in a master keyboard, to get a more self-contained “zynthesizer”.

For this purpose, I bought a 5" touchscreen:

https://www.amazon.co.uk/dp/B07ZD4QGQJ?ref=ppx_yo2ov_dt_b_fed_asin_title

with HDMI+USB, as I figure I might have to mount the screen some way away from the Raspberry Pi (which is an RPi 5 by the way). Downloaded the latest oram-2504-stable image (which had some issues in itself, see Headless RPi5 boot issue).

The screen works fine … mostly, except that touch doesn’t work out of boot. If I unplug and replug the USB connector (which also powers the screen), it works fine.

Looking at /var/log/Xorg.0.log, I can’t really see anything that looks wrong.

After some digging, I found that

DISPLAY=:0 xinput enable 6

brings touch back to life. And running

xinput

after boot gives me:

⎡ Virtual core pointer                          id=2    [master pointer  (3)]
⎜   ↳ Virtual core XTEST pointer                id=4    [slave  pointer  (2)]
⎣ Virtual core keyboard                         id=3    [master keyboard (2)]
    ↳ Virtual core XTEST keyboard               id=5    [slave  keyboard (3)]
    ↳ pwr_button                                id=7    [slave  keyboard (3)]
∼ wch.cn USB2IIC_CTP_CONTROL                    id=6    [floating slave]

whereas after replugging, or executing the xinput enable command above gives me

⎡ Virtual core pointer                          id=2    [master pointer  (3)]
⎜   ↳ Virtual core XTEST pointer                id=4    [slave  pointer  (2)]
⎜   ↳ wch.cn USB2IIC_CTP_CONTROL                id=6    [slave  pointer  (2)]
⎣ Virtual core keyboard                         id=3    [master keyboard (2)]
    ↳ Virtual core XTEST keyboard               id=5    [slave  keyboard (3)]
    ↳ pwr_button 

‘floating slave’ apparently means that it is not associated with the master device.

I tried adding a rule in /etc/X11/xorg.conf.d/ to disable “Floating” when the screen is found. According to /var/log/Xorg.0.log, the rule is found and executed, but it doesn’t seem to make a difference.

Anyone else have a similar problem? I get the feeling that something is disabling the touch feature at some point after boot, but I can’t figure out how or why. Like I said, replugging the USB device or issuing the xinput enable command causes it to work fine, so it’s not a question of the device itself not working.

One thing I’m going to try is to add a systemd rule that tries to enable the display just before starting the zynthian service.

1 Like

I’m going to blame the PSU. Give us more PSU deets.

It’s the standard official Raspberry Pi5 27W PSU.

I don’t think it’s a power issue, as I can see in the Xorg log (/var/log/Xorg.0.log) that the touch screen is recognized as an input device when starting up. Or are you thinking that there is some dip after startup which causes it to loose the connection (but then why isn’t there anything in the log)?

My suspicion was a dip, but you’re right, that would be logged.

Here’s the complete /var/log/Xorg.0.log , with the initial startup, and then unplugging the USB connector for the screen after about 17 seconds and reconnecting it two seconds later:

(venv) root@zynthian:~# cat /var/log/Xorg.0.log
[     3.495] 
X.Org X Server 1.21.1.7
X Protocol Version 11, Revision 0
[     3.495] Current Operating System: Linux zynthian 6.6.47+rpt-rpi-2712 #1 SMP PREEMPT Debian 1:6.6.47-1+rpt1 (2024-09-02) aarch64
[     3.495] Kernel command line: reboot=w coherent_pool=1M 8250.nr_uarts=1 pci=pcie_bus_safe bcm2708_fb.fbwidth=640 bcm2708_fb.fbheight=480 bcm2708_fb.fbdepth=16 bcm2708_fb.fbswap=1 smsc95xx.macaddr=2C:CF:67:40:DD:9D vc_mem.mem_base=0x3fc00000 vc_mem.mem_size=0x40000000  root=PARTUUID=e249d476-02 rootfstype=ext4 fsck.repair=yes rootwait console=tty1 logo.nologo modules-load=dwc2,libcomposite
[     3.495] xorg-server 2:21.1.7-3+rpt3+deb12u8 (https://www.debian.org/support) 
[     3.495] Current version of pixman: 0.42.2
[     3.495] 	Before reporting problems, check http://wiki.x.org
	to make sure that you have the latest version.
[     3.495] Markers: (--) probed, (**) from config file, (==) default setting,
	(++) from command line, (!!) notice, (II) informational,
	(WW) warning, (EE) error, (NI) not implemented, (??) unknown.
[     3.495] (==) Log file: "/var/log/Xorg.0.log", Time: Mon May  5 07:38:24 2025
[     3.524] (==) Using config directory: "/etc/X11/xorg.conf.d"
[     3.524] (==) Using system config directory "/usr/share/X11/xorg.conf.d"
[     3.546] (==) No Layout section.  Using the first Screen section.
[     3.546] (==) No screen section available. Using defaults.
[     3.546] (**) |-->Screen "Default Screen Section" (0)
[     3.546] (**) |   |-->Monitor "<default monitor>"
[     3.546] (==) No monitor specified for screen "Default Screen Section".
	Using a default monitor configuration.
[     3.546] (**) Option "Debug" "dmabuf_capable"
[     3.546] (==) Automatically adding devices
[     3.546] (==) Automatically enabling devices
[     3.546] (==) Automatically adding GPU devices
[     3.546] (==) Automatically binding GPU devices
[     3.546] (==) Max clients allowed: 256, resource mask: 0x1fffff
[     3.575] (WW) The directory "/usr/share/fonts/X11/cyrillic" does not exist.
[     3.575] 	Entry deleted from font path.
[     3.575] (WW) The directory "/usr/share/fonts/X11/100dpi/" does not exist.
[     3.575] 	Entry deleted from font path.
[     3.575] (WW) The directory "/usr/share/fonts/X11/75dpi/" does not exist.
[     3.575] 	Entry deleted from font path.
[     3.579] (WW) The directory "/usr/share/fonts/X11/100dpi" does not exist.
[     3.579] 	Entry deleted from font path.
[     3.579] (WW) The directory "/usr/share/fonts/X11/75dpi" does not exist.
[     3.579] 	Entry deleted from font path.
[     3.579] (==) FontPath set to:
	/usr/share/fonts/X11/misc,
	/usr/share/fonts/X11/Type1,
	built-ins
[     3.579] (==) ModulePath set to "/usr/lib/xorg/modules"
[     3.579] (II) The server relies on udev to provide the list of input devices.
	If no devices become available, reconfigure udev or disable AutoAddDevices.
[     3.579] (II) Loader magic: 0x555595140ef0
[     3.579] (II) Module ABI versions:
[     3.579] 	X.Org ANSI C Emulation: 0.4
[     3.579] 	X.Org Video Driver: 25.2
[     3.579] 	X.Org XInput driver : 24.4
[     3.579] 	X.Org Server Extension : 10.0
[     3.579] (--) using VT number 2

[     3.579] (II) systemd-logind: logind integration requires -keeptty and -keeptty was not provided, disabling logind integration
[     3.579] (II) no primary bus or device found
[     3.579] (II) LoadModule: "glx"
[     3.597] (II) Loading /usr/lib/xorg/modules/extensions/libglx.so
[     3.658] (II) Module glx: vendor="X.Org Foundation"
[     3.658] 	compiled for 1.21.1.7, module version = 1.0.0
[     3.658] 	ABI class: X.Org Server Extension, version 10.0
[     3.658] (==) Matched modesetting as autoconfigured driver 0
[     3.658] (==) Matched fbdev as autoconfigured driver 1
[     3.658] (==) Assigned the driver to the xf86ConfigLayout
[     3.658] (II) LoadModule: "modesetting"
[     3.658] (II) Loading /usr/lib/xorg/modules/drivers/modesetting_drv.so
[     3.680] (II) Module modesetting: vendor="X.Org Foundation"
[     3.680] 	compiled for 1.21.1.7, module version = 1.21.1
[     3.680] 	Module class: X.Org Video Driver
[     3.680] 	ABI class: X.Org Video Driver, version 25.2
[     3.683] (II) LoadModule: "fbdev"
[     3.683] (II) Loading /usr/lib/xorg/modules/drivers/fbdev_drv.so
[     3.684] (II) Module fbdev: vendor="X.Org Foundation"
[     3.684] 	compiled for 1.21.1.3, module version = 0.5.0
[     3.684] 	Module class: X.Org Video Driver
[     3.684] 	ABI class: X.Org Video Driver, version 25.2
[     3.684] (II) modesetting: Driver for Modesetting Kernel Drivers: kms
[     3.685] (II) FBDEV: driver for framebuffer: fbdev
[     3.692] (WW) Falling back to old probe method for modesetting
[     3.692] (EE) open /dev/dri/card0: No such file or directory
[     3.692] (WW) Falling back to old probe method for fbdev
[     3.692] (II) Loading sub module "fbdevhw"
[     3.692] (II) LoadModule: "fbdevhw"
[     3.692] (II) Loading /usr/lib/xorg/modules/libfbdevhw.so
[     3.706] (II) Module fbdevhw: vendor="X.Org Foundation"
[     3.706] 	compiled for 1.21.1.7, module version = 0.0.2
[     3.706] 	ABI class: X.Org Video Driver, version 25.2
[     3.706] (II) FBDEV(0): using default device
[     3.706] (II) FBDEV(0): Creating default Display subsection in Screen section
	"Default Screen Section" for depth/fbbpp 16/16
[     3.706] (==) FBDEV(0): Depth 16, (==) framebuffer bpp 16
[     3.706] (==) FBDEV(0): RGB weight 565
[     3.706] (==) FBDEV(0): Default visual is TrueColor
[     3.706] (==) FBDEV(0): Using gamma correction (1.0, 1.0, 1.0)
[     3.706] (II) FBDEV(0): hardware: BCM2708 FB (video memory: 600kB)
[     3.706] (DB) xf86MergeOutputClassOptions unsupported bus type 0
[     3.706] (II) FBDEV(0): checking modes against framebuffer device...
[     3.706] (II) FBDEV(0): checking modes against monitor...
[     3.706] (II) FBDEV(0): Virtual size is 640x480 (pitch 640)
[     3.706] (**) FBDEV(0):  Built-in mode "current"
[     3.706] (==) FBDEV(0): DPI set to (96, 96)
[     3.706] (II) Loading sub module "fb"
[     3.706] (II) LoadModule: "fb"
[     3.706] (II) Module "fb" already built-in
[     3.706] (**) FBDEV(0): using shadow framebuffer
[     3.706] (II) Loading sub module "shadow"
[     3.706] (II) LoadModule: "shadow"
[     3.706] (II) Loading /usr/lib/xorg/modules/libshadow.so
[     3.713] (II) Module shadow: vendor="X.Org Foundation"
[     3.713] 	compiled for 1.21.1.7, module version = 1.1.0
[     3.713] 	ABI class: X.Org ANSI C Emulation, version 0.4
[     3.713] (II) UnloadModule: "modesetting"
[     3.713] (II) Unloading modesetting
[     3.738] (==) FBDEV(0): Backing store enabled
[     3.741] (==) FBDEV(0): DPMS enabled
[     3.743] (II) Initializing extension Generic Event Extension
[     3.744] (II) Initializing extension SHAPE
[     3.744] (II) Initializing extension MIT-SHM
[     3.744] (II) Initializing extension XInputExtension
[     3.747] (II) Initializing extension XTEST
[     3.747] (II) Initializing extension BIG-REQUESTS
[     3.747] (II) Initializing extension SYNC
[     3.747] (II) Initializing extension XKEYBOARD
[     3.747] (II) Initializing extension XC-MISC
[     3.747] (II) Initializing extension SECURITY
[     3.747] (II) Initializing extension XFIXES
[     3.747] (II) Initializing extension RENDER
[     3.747] (II) Initializing extension RANDR
[     3.748] (II) Initializing extension COMPOSITE
[     3.748] (II) Initializing extension DAMAGE
[     3.748] (II) Initializing extension MIT-SCREEN-SAVER
[     3.748] (II) Initializing extension DOUBLE-BUFFER
[     3.748] (II) Initializing extension RECORD
[     3.748] (II) Initializing extension DPMS
[     3.748] (II) Initializing extension Present
[     3.748] (II) Initializing extension DRI3
[     3.748] (II) Initializing extension X-Resource
[     3.748] (II) Initializing extension XVideo
[     3.748] (II) Initializing extension XVideo-MotionCompensation
[     3.748] (II) Initializing extension SELinux
[     3.748] (II) SELinux: Disabled on system
[     3.748] (II) Initializing extension GLX
[     3.748] (II) AIGLX: Screen 0 is not DRI2 capable
[     5.035] (II) IGLX: Loaded and initialized swrast
[     5.035] (II) GLX: Initialized DRISWRAST GL provider for screen 0
[     5.035] (II) Initializing extension XFree86-VidModeExtension
[     5.036] (II) Initializing extension XFree86-DGA
[     5.036] (II) Initializing extension XFree86-DRI
[     5.036] (II) Initializing extension DRI2
[     5.103] (II) config/udev: Adding input device wch.cn USB2IIC_CTP_CONTROL (/dev/input/event1)
[     5.103] (**) wch.cn USB2IIC_CTP_CONTROL: Applying InputClass "evdev touchscreen catchall"
[     5.103] (II) LoadModule: "evdev"
[     5.103] (II) Loading /usr/lib/xorg/modules/input/evdev_drv.so
[     5.106] (II) Module evdev: vendor="X.Org Foundation"
[     5.106] 	compiled for 1.21.1.3, module version = 2.10.6
[     5.106] 	Module class: X.Org XInput Driver
[     5.106] 	ABI class: X.Org XInput driver, version 24.4
[     5.106] (II) Using input driver 'evdev' for 'wch.cn USB2IIC_CTP_CONTROL'
[     5.106] (**) wch.cn USB2IIC_CTP_CONTROL: always reports core events
[     5.106] (**) evdev: wch.cn USB2IIC_CTP_CONTROL: Device: "/dev/input/event1"
[     5.168] (--) evdev: wch.cn USB2IIC_CTP_CONTROL: Vendor 0x1a86 Product 0xe2e3
[     5.168] (--) evdev: wch.cn USB2IIC_CTP_CONTROL: Found absolute axes
[     5.168] (--) evdev: wch.cn USB2IIC_CTP_CONTROL: Found absolute multitouch axes
[     5.168] (II) evdev: wch.cn USB2IIC_CTP_CONTROL: No buttons found, faking one.
[     5.168] (--) evdev: wch.cn USB2IIC_CTP_CONTROL: Found x and y absolute axes
[     5.168] (--) evdev: wch.cn USB2IIC_CTP_CONTROL: Found absolute touchscreen
[     5.168] (II) evdev: wch.cn USB2IIC_CTP_CONTROL: Configuring as touchscreen
[     5.168] (**) evdev: wch.cn USB2IIC_CTP_CONTROL: YAxisMapping: buttons 4 and 5
[     5.168] (**) evdev: wch.cn USB2IIC_CTP_CONTROL: EmulateWheelButton: 4, EmulateWheelInertia: 10, EmulateWheelTimeout: 200
[     5.168] (**) Option "config_info" "udev:/sys/devices/platform/axi/1000120000.pcie/1f00300000.usb/xhci-hcd.1/usb3/3-2/3-2:1.0/0003:1A86:E2E3.0001/input/input3/event1"
[     5.168] (II) XINPUT: Adding extended input device "wch.cn USB2IIC_CTP_CONTROL" (type: TOUCHSCREEN, id 6)
[     5.168] (II) evdev: wch.cn USB2IIC_CTP_CONTROL: initialized for absolute axes.
[     5.168] (**) wch.cn USB2IIC_CTP_CONTROL: (accel) keeping acceleration scheme 1
[     5.168] (**) wch.cn USB2IIC_CTP_CONTROL: (accel) acceleration profile 0
[     5.168] (**) wch.cn USB2IIC_CTP_CONTROL: (accel) acceleration factor: 2.000
[     5.168] (**) wch.cn USB2IIC_CTP_CONTROL: (accel) acceleration threshold: 4
[     5.168] (II) config/udev: Adding input device wch.cn USB2IIC_CTP_CONTROL (/dev/input/mouse0)
[     5.168] (II) No input driver specified, ignoring this device.
[     5.168] (II) This device may have been added with another device file.
[     5.169] (II) config/udev: Adding input device wch.cn USB2IIC_CTP_CONTROL UNKNOWN (/dev/input/event2)
[     5.169] (II) No input driver specified, ignoring this device.
[     5.169] (II) This device may have been added with another device file.
[     5.169] (II) config/udev: Adding input device pwr_button (/dev/input/event0)
[     5.169] (**) pwr_button: Applying InputClass "evdev keyboard catchall"
[     5.169] (II) Using input driver 'evdev' for 'pwr_button'
[     5.169] (**) pwr_button: always reports core events
[     5.169] (**) evdev: pwr_button: Device: "/dev/input/event0"
[     5.169] (--) evdev: pwr_button: Vendor 0x1 Product 0x1
[     5.169] (--) evdev: pwr_button: Found keys
[     5.169] (II) evdev: pwr_button: Configuring as keyboard
[     5.169] (**) Option "config_info" "udev:/sys/devices/platform/pwr_button/input/input0/event0"
[     5.169] (II) XINPUT: Adding extended input device "pwr_button" (type: KEYBOARD, id 7)
[     5.169] (**) Option "xkb_rules" "evdev"
[     5.169] (**) Option "xkb_model" "pc105"
[     5.169] (**) Option "xkb_layout" "es"
[    17.388] (II) config/udev: removing device wch.cn USB2IIC_CTP_CONTROL
[    17.388] (II) evdev: wch.cn USB2IIC_CTP_CONTROL: Close
[    17.388] (II) UnloadModule: "evdev"
[    19.585] (II) config/udev: Adding input device wch.cn USB2IIC_CTP_CONTROL (/dev/input/mouse0)
[    19.585] (II) No input driver specified, ignoring this device.
[    19.585] (II) This device may have been added with another device file.
[    19.684] (II) config/udev: Adding input device wch.cn USB2IIC_CTP_CONTROL UNKNOWN (/dev/input/event2)
[    19.684] (II) No input driver specified, ignoring this device.
[    19.684] (II) This device may have been added with another device file.
[    19.900] (II) config/udev: Adding input device wch.cn USB2IIC_CTP_CONTROL (/dev/input/event1)
[    19.900] (**) wch.cn USB2IIC_CTP_CONTROL: Applying InputClass "evdev touchscreen catchall"
[    19.900] (II) Using input driver 'evdev' for 'wch.cn USB2IIC_CTP_CONTROL'
[    19.900] (**) wch.cn USB2IIC_CTP_CONTROL: always reports core events
[    19.900] (**) evdev: wch.cn USB2IIC_CTP_CONTROL: Device: "/dev/input/event1"
[    19.964] (--) evdev: wch.cn USB2IIC_CTP_CONTROL: Vendor 0x1a86 Product 0xe2e3
[    19.964] (--) evdev: wch.cn USB2IIC_CTP_CONTROL: Found absolute axes
[    19.964] (--) evdev: wch.cn USB2IIC_CTP_CONTROL: Found absolute multitouch axes
[    19.964] (II) evdev: wch.cn USB2IIC_CTP_CONTROL: No buttons found, faking one.
[    19.964] (--) evdev: wch.cn USB2IIC_CTP_CONTROL: Found x and y absolute axes
[    19.964] (--) evdev: wch.cn USB2IIC_CTP_CONTROL: Found absolute touchscreen
[    19.964] (II) evdev: wch.cn USB2IIC_CTP_CONTROL: Configuring as touchscreen
[    19.964] (**) evdev: wch.cn USB2IIC_CTP_CONTROL: YAxisMapping: buttons 4 and 5
[    19.964] (**) evdev: wch.cn USB2IIC_CTP_CONTROL: EmulateWheelButton: 4, EmulateWheelInertia: 10, EmulateWheelTimeout: 200
[    19.964] (**) Option "config_info" "udev:/sys/devices/platform/axi/1000120000.pcie/1f00300000.usb/xhci-hcd.1/usb3/3-2/3-2:1.0/0003:1A86:E2E3.0002/input/input5/event1"
[    19.964] (II) XINPUT: Adding extended input device "wch.cn USB2IIC_CTP_CONTROL" (type: TOUCHSCREEN, id 6)
[    19.964] (II) evdev: wch.cn USB2IIC_CTP_CONTROL: initialized for absolute axes.
[    19.964] (**) wch.cn USB2IIC_CTP_CONTROL: (accel) keeping acceleration scheme 1
[    19.964] (**) wch.cn USB2IIC_CTP_CONTROL: (accel) acceleration profile 0
[    19.964] (**) wch.cn USB2IIC_CTP_CONTROL: (accel) acceleration factor: 2.000
[    19.964] (**) wch.cn USB2IIC_CTP_CONTROL: (accel) acceleration threshold: 4