8" Touch Screen maps every input to lower right corner

Creating a bug report/issue

I have searched the existing open and closed issues

Required Information

  • DietPi version | 10.4
  • Distro version | trixie
  • Kernel version | 6.18.29-current-sunxi64
  • Architecture | arm64
  • SBC model | PINE A64 (aarch64)
  • Power supply used | RPi 5V 1A
  • SD card used | Samsung Evo

Additional Information (if applicable)

  • Software: Kiauh, Klipperscreen, HelixScreen, xcalibrate, xinput-calibrator (fresh installs)
  • Hardware: Elecrow 8" HDMI-Touchscreen DIS85801D

Steps to reproduce

  1. Connect touchscreen with hdmi and usb.
  2. Install KIAUH via git clone
  3. Install either Klipperscreen or Helixscreen via KIAUH
  4. reboot

Expected behaviour

  • Klipperscreen or Helixscreen should respond to touch inputs .

Actual behaviour

  • No apparent reaction from any GUI element to touch input regardless where I touch the screen.

Extra details

  • The issue started after I updated to dietpi 10.4.
  • I found that I can wake up the screen by touch. I connected it to my windows machine and it worked fine using the same cables I used for my SBC.
  • I tried recalibration using xinput-calibrator and xcalibrate. Both showed that every touch is mapped to the right lower corner. But no matter what, both tools weren’t able to change this behaviour.
  • I also tried Elecrow’s guide. But I can’t find config.txt. It’s not in /boot and I don’t have /boot/firmware.

I’m at the brink of pulling my hair. Help would be greatly appreciated.

config.txt only exists on raspberry pi.
Can you share the guide you are talking about?

Oh that’s why I can’t find config.txt. I was starting to question my installation…

You can find that guide here: 8 inch Touchscreen IPS Display 1280x800 Small Portable Monitor Compatible with Raspberry Pi 540043 Win 111087 Jetson Nano - Elecrow Wiki
(just after the pictures showing how to mount a Rpi to the back of the screen).

I also read a thread on the arch forums ( [SOLVED] Touchscreen not working / Newbie Corner / Arch Linux Forums ) and verified that the touch screen is correctly recognized (and not as a generic device or a graphic tablet).

Can you share

xinput list

Sure:

dietpi@OctoPine:~$ DISPLAY=:0 xinput list
⎡ Virtual core pointer id=2 [master pointer (3)]
⎜ ↳ Virtual core XTEST pointer id=4 [slave pointer (2)]
⎜ ↳ dw_hdmi id=7 [slave pointer (2)]
⎜ ↳ QDtech MPI1001 Touchscreen id=6 [slave pointer (2)]
⎣ Virtual core keyboard id=3 [master keyboard (2)]
↳ Virtual core XTEST keyboard id=5 [slave keyboard (3)]
↳ axp20x-pek id=8 [slave keyboard (3)]
↳ dw_hdmi id=9 [slave keyboard (3)]

Okay can you also check

DISPLAY=:0 xinput list-props 6

And then test the screen, execute

DISPLAY=:0 xinput test 6

and touch it in different places. You should see different values. If you always see the same, then it’s probably a kernel/driver issue

Here are the touch screen’s props:

DISPLAY=:0 xinput list-props 6
Device ‘dw_hdmi’:
Device Enabled (129):   1
Coordinate Transformation Matrix (130): 1.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 1.000000
libinput Natural Scrolling Enabled (251):       0
libinput Natural Scrolling Enabled Default (252):       0
libinput Scroll Methods Available (253):        0, 0, 1
libinput Scroll Method Enabled (254):   0, 0, 1
libinput Scroll Method Enabled Default (255):   0, 0, 1
libinput Button Scrolling Button (256): 0
libinput Button Scrolling Button Default (257): 0
libinput Button Scrolling Button Lock Enabled (258):    0
libinput Button Scrolling Button Lock Enabled Default (259):    0
libinput Accel Speed (260):     0.000000
libinput Accel Speed Default (261):     0.000000
libinput Accel Profiles Available (262):        1, 1, 1
libinput Accel Profile Enabled (263):   1, 0, 0
libinput Accel Profile Enabled Default (264):   1, 0, 0
libinput Accel Custom Fallback Points (265):    
libinput Accel Custom Fallback Step (266):      0.000000
libinput Accel Custom Motion Points (267):      
libinput Accel Custom Motion Step (268):        0.000000
libinput Accel Custom Scroll Points (269):      
libinput Accel Custom Scroll Step (270):        0.000000
libinput Left Handed Enabled (271):     0
libinput Left Handed Enabled Default (272):     0
libinput Send Events Modes Available (273):     1, 0
libinput Send Events Mode Enabled (274):        0, 0
libinput Send Events Mode Enabled Default (275):        0, 0
Device Node (276):      “/dev/input/event1”
Device Product ID (277):        0, 0
libinput Drag Lock Buttons (278):       
libinput Horizontal Scroll Enabled (279):       1
libinput Scrolling Pixel Distance (280):        15
libinput Scrolling Pixel Distance Default (281):        15
libinput High Resolution Wheel Scroll Enabled (282):    1

I couldn’t find any info on what the props for my device should be. I wonder why natural scrolling is disabled, but everything else seems in order. Did I overlook something?

I did

DISPLAY=:0 xinput test 6

and I can see that some process started, but there is no verbose feedback in my SSH console.

Verbose output of xinput-calibrator:

dietpi@OctoPine:~$ DISPLAY=:0 xinput_calibrator -v
DEBUG: XInputExtension version is 2.4
DEBUG: Skipping virtual master devices and devices without axis valuators.
DEBUG: Skipping device 'Virtual core XTEST pointer' id=4, does not report Absolute events.
DEBUG: Skipping device 'dw_hdmi' id=7, does not report Absolute events.
DEBUG: Selected device: QDtech MPI1001 Touchscreen
DEBUG: Not usbtouchscreen calibrator: Not a usbtouchscreen device
DEBUG: Not evdev calibrator: Evdev: invalid "Evdev Axis Calibration" property format
Calibrating standard Xorg driver "QDtech MPI1001 Touchscreen"
        current calibration values: min_x=0, max_x=65535 and min_y=0, max_y=65535
        If these values are estimated wrong, either supply it manually with the --precalib option, or run the 'get_precalib.sh' script to automatically get it (through HAL).
DEBUG: Found that 'QDtech MPI1001 Touchscreen' is a sysfs name.
INFO: width=1280, height=800
DEBUG: Adding click 0 (X=1278, Y=798)
DEBUG: Not adding click 1 (X=1278, Y=798): within 7 pixels of previous click
DEBUG: Not adding click 1 (X=1278, Y=798): within 7 pixels of previous click
DEBUG: Not adding click 1 (X=1278, Y=798): within 7 pixels of previous click
DEBUG: Not adding click 1 (X=1278, Y=798): within 7 pixels of previous click
DEBUG: Not adding click 1 (X=1278, Y=798): within 7 pixels of previous click
DEBUG: Not adding click 1 (X=1278, Y=798): within 7 pixels of previous click
DEBUG: Not adding click 1 (X=1278, Y=798): within 7 pixels of previous click
DEBUG: Not adding click 1 (X=1278, Y=798): within 7 pixels of previous click
DEBUG: Not adding click 1 (X=1278, Y=798): within 7 pixels of previous click

I made click 0 on the first cross shown in the upper left part of the screen, and the next cross is shown in the upper right part. Every click is registered in the same spot.

Alright, the calibration is correct, it shows meaningful min and max values, but it always registers just one coordinate, no matter where you touch.

Can you make one last test, with evtest (You probably need to install it first: apt install evtest):slight_smile:
run sudo evtest and chose the correct device from the list, then just touch the dispaly as you did before. It will show us the raw kernel events. If the coordinates stay the same again then we know that it is a kernel/driver problem.

This is odd, it does not recogn

Oh wow i totally missed that. On the arch forums someone talked about how his touchscreen’s IDs weren’t listed in the kernel: [SOLVED] Touchscreen not working / Newbie Corner / Arch Linux Forums

Here is the output of evtest, I did four touches, each near a different corner.

dietpi@OctoPine:~$ sudo DISPLAY=:0 evtest
No device specified, trying to scan all of /dev/input/event*
Available devices:
/dev/input/event0:      axp20x-pek
/dev/input/event1:      dw_hdmi
/dev/input/event2:      QDtech MPI1001 Touchscreen
Select the device event number [0-2]: 2
Input driver version is 1.0.1
Input device ID: bus 0x3 vendor 0x484 product 0x5750 version 0x101
Input device name: "QDtech MPI1001 Touchscreen"
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   1280
      Min        0
      Max     1280
    Event code 1 (ABS_Y)
      Value    800
      Min        0
      Max      800
    Event code 40 (ABS_MISC)
      Value      0
      Min        0
      Max        1
  Event type 4 (EV_MSC)
    Event code 4 (MSC_SCAN)
Properties:
Testing ... (interrupt to exit)
Event: time 1781128886.698273, type 4 (EV_MSC), code 4 (MSC_SCAN), value d0042
Event: time 1781128886.698273, type 1 (EV_KEY), code 330 (BTN_TOUCH), value 1
Event: time 1781128886.698273, type 3 (EV_ABS), code 0 (ABS_X), value 183
Event: time 1781128886.698273, type 3 (EV_ABS), code 1 (ABS_Y), value 146
Event: time 1781128886.698273, type 3 (EV_ABS), code 0 (ABS_X), value 1280
Event: time 1781128886.698273, type 3 (EV_ABS), code 1 (ABS_Y), value 800
Event: time 1781128886.698273, -------------- SYN_REPORT ------------
Event: time 1781128886.812222, type 4 (EV_MSC), code 4 (MSC_SCAN), value d0042
Event: time 1781128886.812222, type 1 (EV_KEY), code 330 (BTN_TOUCH), value 0
Event: time 1781128886.812222, -------------- SYN_REPORT ------------
Event: time 1781128887.455267, type 4 (EV_MSC), code 4 (MSC_SCAN), value d0042
Event: time 1781128887.455267, type 1 (EV_KEY), code 330 (BTN_TOUCH), value 1
Event: time 1781128887.455267, type 3 (EV_ABS), code 0 (ABS_X), value 1124
Event: time 1781128887.455267, type 3 (EV_ABS), code 1 (ABS_Y), value 156
Event: time 1781128887.455267, type 3 (EV_ABS), code 0 (ABS_X), value 1280
Event: time 1781128887.455267, type 3 (EV_ABS), code 1 (ABS_Y), value 800
Event: time 1781128887.455267, -------------- SYN_REPORT ------------
Event: time 1781128887.589223, type 4 (EV_MSC), code 4 (MSC_SCAN), value d0042
Event: time 1781128887.589223, type 1 (EV_KEY), code 330 (BTN_TOUCH), value 0
Event: time 1781128887.589223, -------------- SYN_REPORT ------------
Event: time 1781128888.274271, type 4 (EV_MSC), code 4 (MSC_SCAN), value d0042
Event: time 1781128888.274271, type 1 (EV_KEY), code 330 (BTN_TOUCH), value 1
Event: time 1781128888.274271, type 3 (EV_ABS), code 0 (ABS_X), value 234
Event: time 1781128888.274271, type 3 (EV_ABS), code 1 (ABS_Y), value 596
Event: time 1781128888.274271, type 3 (EV_ABS), code 0 (ABS_X), value 1280
Event: time 1781128888.274271, type 3 (EV_ABS), code 1 (ABS_Y), value 800
Event: time 1781128888.274271, -------------- SYN_REPORT ------------
Event: time 1781128888.418223, type 4 (EV_MSC), code 4 (MSC_SCAN), value d0042
Event: time 1781128888.418223, type 1 (EV_KEY), code 330 (BTN_TOUCH), value 0
Event: time 1781128888.418223, -------------- SYN_REPORT ------------
Event: time 1781128889.082272, type 4 (EV_MSC), code 4 (MSC_SCAN), value d0042
Event: time 1781128889.082272, type 1 (EV_KEY), code 330 (BTN_TOUCH), value 1
Event: time 1781128889.082272, type 3 (EV_ABS), code 0 (ABS_X), value 1064
Event: time 1781128889.082272, type 3 (EV_ABS), code 1 (ABS_Y), value 516

Ok good to know, at least this does not indicate any problem.

So the system gets the right coordinates, but then also gets the coordiantes for the bottom right corner, like you described. This is likely a scaling/calibration issue.
With the update to dietpi 10.4 you also udpated your kernel to mitigate the “Copy Fail” and “Dirty Frag” bugs?
And the display also runs in it’s native resolution?

Klipper does also provice some troubleshooting steps for a behaviour like you are experiencing:
https://klipperscreen.readthedocs.io/en/latest/Troubleshooting/Touch_issues/#touch-rotation-and-matrix

If I read the posts at Arch Forums correctly, this might lead to wrong drivers being loaded:

  1. the touchscreen manufacturer id (0x1ddb) and product id (0x1) are currently not into the usb vendors database (even after update-usbids)
  2. as such, the kernel (through udev) tried to discover the nature of it blind folded (i’d be interested to know on what basis), and ends up thinking that’s a tablet device (and not a touchscreen)

(From the last post in that thread.)

No I’v never explicitly updated the kernel. I only used apt upgrade or apt full-upgrade so far. How can do that?

Yes.

But in your case the kernel detects a touch device also with the correct resolution (see the evtest output)

When you did full-upgrade you installed the newest kernel (which is recommended to mitigate the CVEs).
You could try to downgrade the kernel for testing and see if it’s working again, but then you have a vulnerable system.
@MichaIng what do you think is the best to do here?

The guide you mentioned is explicitly for RPi, and cannot work anywhere else. The config.txt changes are only to enforce the correct (display) resolution, mode, and disable HDMI audio, along with some legacy options that are noops since a longer time, nothing which would affect touch input coordinates or so. There is a weird “driver” download listed, which however is no driver, but RPi-only config.txt files and scripts, basically this repo: GitHub - goodtft/LCD-show: 2.4" 2.8"3.2" 3.5" 5.0" 7.0" TFT LCD driver for the Raspberry PI 3B+/A/A+/B/B+/PI2/ PI3/ZERO/ZERO W · GitHub
Moreover, this is almost only for (smaller) DSI displays, some with I2C-attached touch. None of this is relevant for a HDMI display + USB touch. => That guide is crap, forget about it :smile:.

The Arch Linux thread is 14 years old, before the SBC era even started, and maybe a decade before your touchscreen was released. => Irrelevant :wink:.

The DietPi v10.4 v10.3 update implied the kernel upgrade from Linux 6.12 to 6.18, hence generally possible that this included some breaking change. But HDMI displays + USB touch inputs should not require any special drivers, but work mostly OOTB, after calibration.

xinput_calibrator should create a config below /etc/X11/. Check the configs there, /etc/X11/xorg.conf and everything below /etc/X11/xorg.conf.d in particular. Maybe there are some contradicting/conflicting ones. Maybe easiest to remove all of them (back them up somewhere). Then check again coordinates via evtest and/or touch input. If still wrong, run xinput_calibrator once. Check /etc/X11/ about which config file it generated, so we know the pattern. … IIRC it is /etc/X11/xorg.conf.d/99-calibration.conf.

If nothing helps, you can try to downgrade the kernel. But before you do, run these commands to protect your system against the Copy Fail, Dirty Frag, and Fragnesia vulnerabilities:

printf 'install algif_aead /bin/false\nblacklist algif_aead\n' | sudo tee /etc/modprobe.d/copyfail.conf
printf 'install esp4 /bin/false\ninstall esp6 /bin/false\ninstall rxrpc /bin/false\n' | sudo tee /etc/modprobe.d/dirtyfrag.conf
printf 'blacklist esp4\nblacklist esp6\nblacklist rxrpc\n' | sudo tee -a /etc/modprobe.d/dirtyfrag.conf
sudo modprobe -r algif_aead esp4 esp6 rxrpc
echo 3 | sudo tee /proc/sys/vm/drop_caches

Then:

apt install linux-{image,dtb}-current-sunxi64=26.02.0-trunk-dietpi8

This is the latest Linux 6.12, from March. We pushed the first Linux 6.18 kernel in early April, so DietPi v10.3 included it already. Did you upgrade to v10.4 from an earlier version than that? Else, it is unlikely that a Linux 6.18 patch release caused the issue :thinking:.