I am using a touchscreen with Raspberry Pi 4 Buster OS to implement a multiscreen UI. The app is implemented in PyQt5. The screen occasionally freezes if touched very frequently. The QT buttons stop working.
The freeze is so rare that under normal use, it would happen once in a few weeks.
The freeze state recovers if:
- The fullscreen QT window refreshes into another window (after timeout)
- USB cable to the display is unplugged/plugged again
It is interesting to note that the QT app does not freeze as a VNC session can interact with the window and buttons can be pressed.
The issue happens on both HDMI and DSI display from this manufacturer.
I am trying to find a solution to periodically refresh the touch drivers. I have tried the following two solutions:
xinput disable 6 | xinput enable 6 (6 is the id from xinput)
sudo ./usbreset /dev/bus/usb/001/004
usbreset is suggested in this thread: https://askubuntu.com/questions/645/how-do-you-reset-a-usb-device-from-the-command-line
Both solutions do not work and can't fix once a freeze is there.
Here is my example configuration:
lsusb:
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 004: ID 0484:5750 Specialix <--- Touchscreen
Bus 001 Device 003: ID 1a86:7523 QinHeng Electronics HL-340 USB-Serial adapter
Bus 001 Device 002: ID 2109:3431 VIA Labs, Inc. Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
xinput:
⎡ Virtual core pointer id=2 [master pointer (3)]
⎜ ↳ Virtual core XTEST pointer id=4 [slave pointer (2)]
⎜ ↳ 深圳市全动电子技术有限公司 MPI7002 id=6 [slave pointer (2)] <----- Touchscreen
⎣ Virtual core keyboard id=3 [master keyboard (2)]
↳ Virtual core XTEST keyboard id=5 [slave keyboard (3)]
Ideas on how to reset would be greatly appreciated. I am planning to have a periodic reset as a background thread to counter this issue.