Dual Displays Touchscreen Issues

Post Reply
proteinklumpen
Posts: 9
Joined: Sat Oct 18, 2025 3:35 pm

Dual Displays Touchscreen Issues

Post by proteinklumpen »

Hello,

I have a Raspberry Pi 5 Running Hudiy on

Linux hudiy 6.12.47+rpt-rpi-2712 #1 SMP PREEMPT Debian 1:6.12.47-1+rpt1~bookworm (2025-09-16) aarch64 GNU/Linux

I have two Waveshare 7" displays installed (https://www.waveshare.com/wiki/7inch_HDMI_LCD_(C)). One on top, one underneith. They have a resolution of 1024x600 each. So this is my main_configuration.json

Code: Select all

{
    "application" : {
        "handednessOfTraffic" : "LEFT",
        "defaultAction" : "",
        "showDashboardsIcon" : true,
        "showMenuIcon" : true,
        "touchscreen" : true,
        "showCursor" : true,
        "width" : 1024,
        "height" : 600,
        "x" : 0,
        "y" : 0,
        "splitWithProjections" : false,
        "windowWidth" : 1024,
        "windowHeight" : 1200,
        "handleKeyboardEvents" : true,
        "translationFile" : ""
    },
    "appearance" : {
        "timeFormat" : "24h",
        "showClock" : true,
        "fonts" : [

        ]
    },
    "theme" : {
        "darkThemeEnabled" : true,
        "darkContrastLevel" : 0,
        "darkSourceColor" : "#3AED6F",
        "lightContrastLevel" : 0,
        "lightSourceColor" : "#F78500",
        "availableColors" : [
            "#769CDF",
            "#862272",
            "#DADFBB",
            "#F78500",
            "#E1D648",
            "#3AED6F",
            "#E02129",
            "#4AD155"
        ],
        "lightBackgroundsMap" : {

        },
        "darkBackgroundsMap" : {

        },
        "defaultDarkBackground" : "",
        "defaultLightBackground" : "",
        "darkBackgroundOpacity" : 100,
        "lightBackgroundOpacity" : 100
    },
    "sound" : {
        "startupSoundFile" : "",
        "notificationSoundFile" : "",
        "volumeSinkName" : "",
        "playbackSinkName" : "hudiy_equalizer_sink",
        "sourceName" : "",
        "sourceMaxVolume" : 100,
        "sinkMaxVolume" : 100,
        "outputVolumeStep" : 5,
        "inputVolumeStep" : 5,
        "subwooferBalanceStep" : 5,
        "balanceStep" : 5,
        "fadeStep" : 5,
        "subwooferBalance" : 0,
        "fade" : 0,
        "balance" : 0,
        "storageMusicAutoplay" : false,
        "fmRadioAutoplay" : false,
        "ringtoneFile" : ""
    },
    "androidAuto" : {
        "speechAudio" : true,
        "mediaAudio" : true,
        "resolution" : "720p",
        "bluetoothAddress" : "",
        "autostart" : true,
        "dpi" : 160,
        "widthMargin" : 256,
        "heightMargin" : 120,
        "width" : 1024,
        "height" : 600,
        "x" : 0,
        "y" : 600
    },
    "hotspot" : {
        "enabled" : false,
        "hardwareAddress" : "AC:15:A2:98:7C:EF",
        "ipAddress" : "192.168.12.1",
        "passphrase" : "1234567890",
        "ssid" : "Hudiy",
        "bandwidth" : "A"
    },
    "equalizer" : {
        "enabled" : true,
        "step" : 0.25,
        "minValue" : -10,
        "maxValue" : 15,
        "band25" : 0,
        "band40" : 0,
        "band63" : 0,
        "band100" : 0,
        "band160" : 0,
        "band250" : 0,
        "band400" : 0,
        "band630" : 0,
        "band1000" : 0,
        "band1600" : 0,
        "band2500" : 0,
        "band4000" : 0,
        "band6300" : 0,
        "band10000" : 0,
        "band16000" : 0,
        "presets" : [
            {
                "name" : "Flat",
                "band25" : 0,
                "band40" : 0,
                "band63" : 0,
                "band100" : 0,
                "band160" : 0,
                "band250" : 0,
                "band400" : 0,
                "band630" : 0,
                "band1000" : 0,
                "band1600" : 0,
                "band2500" : 0,
                "band4000" : 0,
                "band6300" : 0,
                "band10000" : 0,
                "band16000" : 0
            },
            {
                "name" : "Rock",
                "band25" : 3,
                "band40" : 4,
                "band63" : 5,
                "band100" : 4,
                "band160" : 1,
                "band250" : -3,
                "band400" : -2,
                "band630" : 2,
                "band1000" : 2,
                "band1600" : 4,
                "band2500" : 4,
                "band4000" : 4,
                "band6300" : 3,
                "band10000" : 4,
                "band16000" : 3
            },
            {
                "name" : "Jazz",
                "band25" : 2,
                "band40" : 3,
                "band63" : 4,
                "band100" : 2,
                "band160" : -2,
                "band250" : 0,
                "band400" : 2,
                "band630" : 2,
                "band1000" : 3,
                "band1600" : 3,
                "band2500" : 2,
                "band4000" : 3,
                "band6300" : 3,
                "band10000" : 4,
                "band16000" : 3
            },
            {
                "name" : "Classical",
                "band25" : 3,
                "band40" : 3,
                "band63" : 2,
                "band100" : -2,
                "band160" : 0,
                "band250" : -3,
                "band400" : -2,
                "band630" : 0,
                "band1000" : 2,
                "band1600" : 3,
                "band2500" : 3,
                "band4000" : 2,
                "band6300" : 4,
                "band10000" : 4,
                "band16000" : 4
            },
            {
                "name" : "Pop",
                "band25" : 3,
                "band40" : 4,
                "band63" : 5,
                "band100" : 4,
                "band160" : -2,
                "band250" : -3,
                "band400" : 0,
                "band630" : 2,
                "band1000" : 3,
                "band1600" : 3,
                "band2500" : 4,
                "band4000" : 4,
                "band6300" : 4,
                "band10000" : 5,
                "band16000" : 4
            }
        ]
    },
    "notificatons" : {
        "outputVolumeToast" : true,
        "inputVolumeToast" : true,
        "nowPlaying" : true,
        "notificationDuration" : 8000,
        "toastDuration" : 2000
    },
    "fmRadio" : {
        "bandwidth" : "EU",
        "squelchLevel" : 350,
        "squelchLimit" : 10,
        "rdsEnabled" : true,
        "autoGain" : true,
        "gain" : 0,
        "presets" : [

        ]
    },
    "autobox" : {
        "dpi" : 160,
        "width" : 0,
        "height" : 0,
        "x" : 0,
        "y" : 0,
        "oemName" : "",
        "autoWirelessConnection" : true,
        "vendorId" : 4884,
        "productId" : 5409,
        "bandwidth" : "AUTO"
    },
    "obd" : {
        "deviceType" : "NONE",
        "serialDescriptor" : "",
        "baudrate" : 115200,
        "rfcommAddress" : "",
        "rfcommChannel" : 1,
        "maxInvalidResponseCount" : 20,
        "startupSequence" : [
            "ATZ",
            "ATE0",
            "ATS0",
            "ATL0",
            "ATH0",
            "ATSP0"
        ]
    },
    "api" : {
        "tcpEndpointPort" : 44405,
        "webSocketEndpointPort" : 44406
    },
    "reverseCamera" : {
        "width" : 0,
        "height" : 0,
        "x" : 0,
        "y" : 0,
        "pipeline" : "v4l2src device=/dev/video0 ! videoconvert ! video/x-raw,format=RGBA,width=640,height=480 ! glupload ! qml6glsink name=video-sink"
    }
}
On the top display, there is Hudiy UI and if Android Auto is connected, its displayed on the lower display. Works perfectly fine. My problem is, that the touchinputs from the top display register on the bottom display. The touch of the bottom display are also on the bottom display. If I go in the screen configuration, there is a touchscreen configuration. You can check the Waveshare touchscreen for this display, but it checks both at one. Please see the attachments :) So both inputs get redirected to one display. Can please help me get rid of this?

Thanks in advance!

Best regards
Sandro
Attachments
touch registers on wrong display
touch registers on wrong display
PXL_20251018_153640347.jpg (1.81 MiB) Viewed 466 times
screen configuration touchscreen (if you select one, both get checked)
screen configuration touchscreen (if you select one, both get checked)
PXL_20251018_153654241.jpg (2.25 MiB) Viewed 468 times
hudiy
Site Admin
Posts: 440
Joined: Mon Jul 14, 2025 7:42 pm

Re: Dual Displays Touchscreen Issues

Post by hudiy »

Hello,
What happens when you select one of the touch inputs to the other screen? Is it possible?

Labwc stores mapping of touch inputs in $HOME/.config/labwc/rc.xml. If it is not possible to assign the touch input via Screen Configuration Tool, you can try to do it manually in mentioned file.

It might be related to:

https://github.com/raspberrypi/bookworm ... issues/446
https://github.com/raspberrypi/bookworm ... issues/336
https://github.com/raspberrypi/linux/pull/6356
https://github.com/raspberrypi/linux/pull/7061
proteinklumpen
Posts: 9
Joined: Sat Oct 18, 2025 3:35 pm

Re: Dual Displays Touchscreen Issues

Post by proteinklumpen »

Hey,

thanks for the hint and sorry for the late reply. I tried a LOT of stuff, nothing helped. So a short summary about the actual problem:

In the Raspberry Pi Screen Configurator, there are thow "Touch-Devices" with the exact same name. If i select HDMI-A-1 and bind the touchdevice to it, it works. If I use the touchscreen of the second display (HDMI-A-2), it works also on HDMI-A-1. Same vise-versa.

The main problem ist labwc, which is only able to work with the name of the device. But the name of the touchinput is the same. Unfortunately the name ist one of the rare attributes, you can't change with udev rules. I tried to do so. Creating symlinks via udev-rules for the physical addresses of the devices works, but labwc can't handle that. At least I didn't manage to do it. Maybe you can find a solution
Those are my udev-rules (the ones creating symlinks, as changing the device name is proprietary to the kernel):

Code: Select all

sandro@hudiy:/etc/udev/rules.d $ cat 99-waveshare-touch.rules
# Oberes Display
SUBSYSTEM=="input", ATTRS{phys}=="usb-xhci-hcd.1-1.2/input0", SYMLINK+="input/WaveShare_Touch1"

# Unteres Display
SUBSYSTEM=="input", ATTRS{phys}=="usb-xhci-hcd.1-1.3/input0", SYMLINK+="input/WaveShare_Touch2"
This was my labwc config you mentioned:

Code: Select all

<?xml version="1.0"?>
<openbox_config xmlns="http://openbox.org/3.4/rc">
  <libinput>
    <device category="default">
      <pointerSpeed>1,000000</pointerSpeed>
    <leftHanded>no</leftHanded></device>
  </libinput>
  <mouse>
    <doubleClickTime>130</doubleClickTime>
  </mouse>
  <touch devicePath="/dev/input/WaveShare_Touch1" mapToOutput="HDMI-A-1" mouseEmulation="yes"/>
  <touch devicePath="/dev/input/WaveShare_Touch2" mapToOutput="HDMI-A-2" mouseEmulation="yes"/>
  <keyboard>
    <repeatRate>25</repeatRate>
    <repeatDelay>600</repeatDelay>
  </keyboard>&gt;
<touch deviceName="WaveShare WS170120" mapToOutput="HDMI-A-1" mouseEmulation="yes"/></openbox_config>
I also tried the patch for hid-multitouch driver. I really didn't know what I was doing, all ChatGPT. But I documentated all of my commands as you can see in the attatchments. The driver seems to not be used. The modified driver is called "hid-multitouch.ko" (and as a compressed version "hid-multitouch.ko.xz") and its safed at /lib/modules/6.12.47+rpt-rpi-2712/kernel/drivers/hid/. If I do "lsmod | grep hid_multitouch" there is a result. For "lsmod | grep hid-multitouch" nothing. I dont really know what to troubleshoot about this. I just saw something in dmesg, again one event with "hid_multitouch" and two other with "hid-multitouch":

Code: Select all

sandro@hudiy:~ $ dmesg | grep multitouch
[    2.591638] hid_multitouch: loading out-of-tree module taints kernel.
[    2.668212] hid-multitouch 0003:0EEF:0005.0004: input,hiddev96,hidraw3: USB HID v1.11 Device [WaveShare WS170120] on usb-xhci-hcd.0-1.1/input0
[    2.776532] hid-multitouch 0003:0EEF:0005.0005: input,hiddev97,hidraw4: USB HID v1.11 Device [WaveShare WS170120] on usb-xhci-hcd.0-1.2/input0
sandro@hudiy:~ $ cd /lib/modules/$(uname -r)/kernel/drivers/hid/
Now I tried to switch to x11, because it has better output handling. Unfortunately, hudiy would't start anymore. Can I make it work again or is it a dependency? I switched back to wayland, hudiy starts again.

Can you please help me out? I am really desperate finding a solution
Thanks in Advance
Attachments
3-recompile-hid-multitouch-driver-dual-touchdisplay.jpg
3-recompile-hid-multitouch-driver-dual-touchdisplay.jpg (292.47 KiB) Viewed 160 times
2-recompile-hid-multitouch-driver-dual-touchdisplay.jpg
2-recompile-hid-multitouch-driver-dual-touchdisplay.jpg (587.85 KiB) Viewed 160 times
1-recompile-hid-multitouch-driver-dual-touchdisplay.jpg
1-recompile-hid-multitouch-driver-dual-touchdisplay.jpg (375.06 KiB) Viewed 160 times
hudiy
Site Admin
Posts: 440
Joined: Mon Jul 14, 2025 7:42 pm

Re: Dual Displays Touchscreen Issues

Post by hudiy »

By default, Hudiy is configured to autostart only on labwc, as it is the default window compositor for Raspberry Pi OS. The easiest way to autostart Hudiy on X11 is by using a .desktop file. To do this, create a hudiy.desktop file in the $HOME/.config/autostart

Code: Select all

mkdir -p $HOME/.config/autostart
touch $HOME/.config/autostart/hudiy.desktop
nano $HOME/.config/autostart/hudiy.desktop
and paste the following content to the hudiy.desktop file

Code: Select all

[Desktop Entry]
Type=Application
Name=Hudiy
Exec=/usr/bin/bash -c "$HOME/.hudiy/share/hudiy_run.sh"
You can also open a ticket regarding your touchscreens issue in the official Raspberry Pi Foundation repository. These repositories are monitored by Raspberry Pi engineers:

https://github.com/raspberrypi/trixie-feedback/issues
proteinklumpen
Posts: 9
Joined: Sat Oct 18, 2025 3:35 pm

Re: Dual Displays Touchscreen Issues

Post by proteinklumpen »

Hey,

thanks for the quick reply!! With x11 I was finally able to fix my problem. For everybody who might also run into this problem:

How to switch from wayland to x11:

Code: Select all

sudo raspi-config
Go into the advanced Options -> Wayland -> Choose x11

After that, Hudiy would not start anymore. Thats why its necessary to add hudiy to autostart, like the Mod 'hudiy' told me in the previous post. Thanks :)

You might also need to reconfigure your display configuration and positioning.

Now you can list your devices

Code: Select all

xinput list
There are your devices with a unique id. In my case id 6 & 7.

You can map the touchscreens to the correct screens like this. You have to try out which way round its right

Code: Select all

xinput map-to-output 6 HDMI-1

Code: Select all

xinput map-to-output 7 HDMI-2
Those changes are not persistent. Unfortunately, the IDs of the devices are also not persistent. If you switch USB-Ports or anything, its the same result. Thats why I wrote a little script, which also runs in autostart

Code: Select all

nano $HOME/.config/autostart/touchscreens.desktop
enter following

Code: Select all

[Desktop Entry]
Type=Application
Name=Touchscreens
Exec=/usr/bin/bash -c "/usr/local/bin/touchscreens_mapping.sh"
Now create the script file

Code: Select all

sudo nano /usr/local/bin/touchscreens_mapping.sh
If you don't need any logic and just want to use the IDs from xinput list, paste this. This works only if you don't change any wiring at all

Code: Select all

#!/bin/sh
xset -dpms
xinput map-to-output <your first ID from xinput list> HDMI-1
xinput map-to-output <your second ID from xinput list> HDMI-2
If you want to have it modular and with a bit more logic to is, paste this:

Code: Select all

#!/bin/sh

#Disable Powermanagement of displays
xset -dpms

#Map Touchscreens
#Get ID from xinput list for Waveshare touchscreens
for id in $(xinput list | grep 'WaveShare WS170120' | sed -n 's/.*id=\([0-9]\+\).*/\1/p'); do
    #Get Device Node (/dev/input/eventX") Value from xinput properties via ID
    devnode=$(xinput list-props "$id" | grep 'Device Node' | sed -n 's/.*"\(.*\)".*/\1/p')
    #Get unique ID_PATH of each touchscreen via - udevadm info /dev/input/eventX
    path=$(udevadm info "$devnode" | grep '^E: ID_PATH=' | cut -d= -f2)

    case "$path" in
        #touchscreen with ID_Path *usb-0:1.2* to HDMI-1
        *usb-0:1.2*)
            xinput map-to-output "$id" HDMI-1
            ;;
        #touchscreen with ID_Path *usb-0:1.1* to HDMI-2
        *usb-0:1.1*)
            xinput map-to-output "$id" HDMI-2
            ;;
    esac
done
The important value for you to find out is via 'udevadm info /dev/input/eventX', where the X represents the number of your device. You can find this devicepath via

Code: Select all

libinput list-devices
Search for your touchscreen devices and find the string, which is called '/dev/input/eventX'

Now replace the X with the number and do a second, more advanced search with the devicePath of the device

Code: Select all

udevadm info /dev/input/event4
You should see something similar like this. One of the unique properties is ID_PATH

Code: Select all

sandro@hudiy:~ $ udevadm info /dev/input/event4
P: /devices/platform/axi/1000120000.pcie/1f00200000.usb/xhci-hcd.0/usb1/1-1/1-1.1/1-1.1:1.0/0003:0EEF:0005.0004/input/input12/event4
M: event4
R: 4
U: input
D: c 13:68
N: input/event4
L: 0
S: input/by-id/usb-WaveShare_WS170120_220211-event-if00
S: input/by-path/platform-xhci-hcd.0-usb-0:1.1:1.0-event
E: DEVPATH=/devices/platform/axi/1000120000.pcie/1f00200000.usb/xhci-hcd.0/usb1/1-1/1-1.1/1-1.1:1.0/0003:0EEF:0005.0004/input/input12/event4
E: DEVNAME=/dev/input/event4
E: MAJOR=13
E: MINOR=68
E: SUBSYSTEM=input
E: USEC_INITIALIZED=3796466
E: ID_INPUT=1
E: ID_INPUT_TOUCHSCREEN=1
E: ID_INPUT_WIDTH_MM=204
E: ID_INPUT_HEIGHT_MM=150
E: ID_BUS=usb
E: ID_MODEL=WS170120
E: ID_MODEL_ENC=WS170120
E: ID_MODEL_ID=0005
E: ID_SERIAL=WaveShare_WS170120_220211
E: ID_SERIAL_SHORT=220211
E: ID_VENDOR=WaveShare
E: ID_VENDOR_ENC=WaveShare
E: ID_VENDOR_ID=0eef
E: ID_REVISION=0111
E: ID_TYPE=hid
E: ID_USB_MODEL=WS170120
E: ID_USB_MODEL_ENC=WS170120
E: ID_USB_MODEL_ID=0005
E: ID_USB_SERIAL=WaveShare_WS170120_220211
E: ID_USB_SERIAL_SHORT=220211
E: ID_USB_VENDOR=WaveShare
E: ID_USB_VENDOR_ENC=WaveShare
E: ID_USB_VENDOR_ID=0eef
E: ID_USB_REVISION=0111
E: ID_USB_TYPE=hid
E: ID_USB_INTERFACES=:030000:
E: ID_USB_INTERFACE_NUM=00
E: ID_USB_DRIVER=usbhid
E: ID_PATH=platform-xhci-hcd.0-usb-0:1.1:1.0
E: ID_PATH_TAG=platform-xhci-hcd_0-usb-0_1_1_1_0
E: LIBINPUT_DEVICE_GROUP=3/eef/5:usb-xhci-hcd.0-1
E: DEVLINKS=/dev/input/by-id/usb-WaveShare_WS170120_220211-event-if00 /dev/input/by-path/platform-xhci-hcd.0-usb-0:1.1:1.0-event
Remember the value of ID_PATH. In my case one touchscreen has "platform-xhci-hcd.0-usb-0:1.1:1.0" and the other "platform-xhci-hcd.0-usb-0:1.1:2.0"

this is my unique identifier, I am using to determine, which touchscreens belongs to which display in the script.

Do this for both touchscreen devices and change the script at the case condition

Code: Select all

case "$path" in
        #touchscreen with ID_Path *usb-0:1.2* to HDMI-1
        *usb-0:1.2*)
            xinput map-to-output "$id" HDMI-1
            ;;
        #touchscreen with ID_Path *usb-0:1.1* to HDMI-2
        *usb-0:1.1*)
            xinput map-to-output "$id" HDMI-2
            ;;
    esac
I hope I could help somebody having the same problem. I almost gave up on this problem but now it works!

Thanks for the help Mr Hudiy! Your reply time is insane! You are doing great work, I love your product so far <3
Post Reply