Touch display scaling on DIY build

I’ve been trying to build a DIY Zynthian but am struggling with touchscreen calibration. It’s running on a Pi5 with the active cooler and the proper Pi power supply. The screen is a 1024 x 600 7 inch HDMI/USB Duinotech (XC9026) that works perfectly out of the box with Raspian (which I have installed on a second SD).

When running Zynthian, the display works well however when using the Generic Display option it wants to run at 1920 x 1080. If I set a lower resolution manually in webconfig it only uses a portion of the screen (with the Oram splash screen visible on the rest of the screen). Most of the other options don’t work well, apart from Waveshare 7 inch 1024 x 600 which gives a nice-looking display.

In all cases the touch response is misaligned. The top-left of the screen responds accurately, but the further I move from that point, the worse it gets. Basically, it looks like touch coordinates are being scaled by roughly 2:1 away from the origin.

I’ve already read almost every relevant thread I could find and have tried the following:

  • flashing a new (Sandisk Extreme Pro) SD card

  • changing the HDMI cable

  • using xinput_calibrator and putting the results in x.conf.d (in both /usr/share/X11/ and /etc/X11/)

  • changing hdmi_cvt in config

One problem is that whenever I try to run xinput or similar I get the following error: “Unable to connect to X server”

Any ideas?

Otherwise Zynthian is very, very cool and I look forward to playing with it!

Here’s what I hope is the relevant part of the Xorg log```
6.727] (II) config/udev: Adding input device wch.cn USB2IIC_CTP_CONTROL (/dev/input/event3) [ 6.727] (**) wch.cn USB2IIC_CTP_CONTROL: Applying InputClass "evdev touchscreen catchall" [ 6.727] (**) wch.cn USB2IIC_CTP_CONTROL: Applying InputClass "calibration" [ 6.727] (II) Using input driver 'evdev' for 'wch.cn USB2IIC_CTP_CONTROL' [ 6.727] (**) wch.cn USB2IIC_CTP_CONTROL: always reports core events [ 6.727] (**) evdev: wch.cn USB2IIC_CTP_CONTROL: Device: "/dev/input/event3" [ 6.780] (--) evdev: wch.cn USB2IIC_CTP_CONTROL: Vendor 0x1a86 Product 0xe5e3 [ 6.780] (--) evdev: wch.cn USB2IIC_CTP_CONTROL: Found absolute axes [ 6.780] (--) evdev: wch.cn USB2IIC_CTP_CONTROL: Found absolute multitouch axes [ 6.780] (II) evdev: wch.cn USB2IIC_CTP_CONTROL: No buttons found, faking one. [ 6.780] (--) evdev: wch.cn USB2IIC_CTP_CONTROL: Found x and y absolute axes [ 6.780] (--) evdev: wch.cn USB2IIC_CTP_CONTROL: Found absolute touchscreen [ 6.780] (**) Option "SwapAxes" "0" [ 6.780] (II) evdev: wch.cn USB2IIC_CTP_CONTROL: Configuring as touchscreen [ 6.780] (**) evdev: wch.cn USB2IIC_CTP_CONTROL: YAxisMapping: buttons 4 and 5 [ 6.780] (**) evdev: wch.cn USB2IIC_CTP_CONTROL: EmulateWheelButton: 4, EmulateWheelInertia: 10, EmulateWheelTimeout: 200 [ 6.780] (**) Option "config_info" "udev:/sys/devices/platform/axi/1000120000.pcie/1f00200000.usb/xhci-hcd.0/usb2/2-2/2-2:1.0/0003:1A86:E5E3.0003/input/input4/event3" [ 6.780] (II) XINPUT: Adding extended input device "wch.cn USB2IIC_CTP_CONTROL" (type: TOUCHSCREEN, id 7) [ 6.780] (II) evdev: wch.cn USB2IIC_CTP_CONTROL: initialized for absolute axes. [ 6.780] (**) wch.cn USB2IIC_CTP_CONTROL: (accel) keeping acceleration scheme 1 [ 6.780] (**) wch.cn USB2IIC_CTP_CONTROL: (accel) acceleration profile 0 [ 6.780] (**) wch.cn USB2IIC_CTP_CONTROL: (accel) acceleration factor: 2.000 [ 6.780] (**) wch.cn USB2IIC_CTP_CONTROL: (accel) acceleration threshold: 4 [ 6.780] (**) Option "TransformationMatrix" "2 0 0 0 2 0 0 0 1" [ 6.780] (II) config/udev: Adding input device wch.cn USB2IIC_CTP_CONTROL (/dev/input/mouse1) [ 6.780] (**) wch.cn USB2IIC_CTP_CONTROL: Applying InputClass "calibration" [ 6.780] (II) No input driver specified, ignoring this device. [ 6.780] (II) This device may have been added with another device file.

The touchscreen settings have always been an uncertain area.

Have you managed to get any consistent behaviour out of your rig?

Frequently solutions tend not to last past the initial alterations and don’t survive a reboot.

Apart from adjusting the resolution, I haven’t really been able to change the touch behaviour at all, temporarily or permanently. In fact the ‘Option “TransformationMatrix” “2 0 0 0 2 0 0 0 1”‘ line in the log above was an attempt to make something happen via X.conf - I originally tried a matirx with 0.5 (to halve the scaling. I think…) and then changed it to 2 in case I was going the wrong way. But niether actually changed the scaling issue in any way.