Raspberry Pi 4 touchscreen with Qt5.15 embedded is not working
-
I have Qt5.15 embedded with Linux Raspberry Pi 4. My touch screen does not work when I run my program, Qt5.15.
More details:
display ids-3210r-40sva1e. ver. Linux pi 5.10.103-v7l+ #1529 SMP Tue Mar 8 12:24:00 GMT 2022 armv7l GNU/Linux
Qt Cross-compiling.
Log build:
Mode ................................... release Optimize release build for size ........ no Building shared libraries .............. yes Using C standard ....................... C11 Using C++ standard ..................... C++17 Using ccache ........................... no Using new DTAGS ........................ yes Relocatable ............................ yes Using precompiled headers .............. yes Using LTCG ............................. no Target compiler supports: NEON ................................. yes Build parts ............................ libs Qt modules and options: Qt Concurrent .......................... yes Qt D-Bus ............................... yes Qt D-Bus directly linked to libdbus .... yes Qt Gui ................................. yes Qt Network ............................. yes Qt Sql ................................. yes Qt Testlib ............................. yes Qt Widgets ............................. yes Qt Xml ................................. yes Support enabled for: Using pkg-config ....................... yes udev ................................... yes Using system zlib ...................... yes Zstandard support ...................... no Qt Core: DoubleConversion ....................... yes Using system DoubleConversion ........ yes GLib ................................... yes iconv .................................. no ICU .................................... yes Built-in copy of the MIME database ..... yes Tracing backend ........................ <none> Logging backends: journald ............................. no syslog ............................... no slog2 ................................ no PCRE2 .................................. yes Using system PCRE2 ................... yes Qt Network: getifaddrs() ........................... yes IPv6 ifname ............................ yes libproxy ............................... no Linux AF_NETLINK ....................... yes OpenSSL ................................ yes Qt directly linked to OpenSSL ........ no OpenSSL 1.1 ............................ yes DTLS ................................... yes OCSP-stapling .......................... yes SCTP ................................... no Use system proxies ..................... yes GSSAPI ................................. no Qt Gui: Accessibility .......................... yes FreeType ............................... yes Using system FreeType ................ yes HarfBuzz ............................... yes Using system HarfBuzz ................ yes Fontconfig ............................. yes Image formats: GIF .................................. yes ICO .................................. yes JPEG ................................. yes Using system libjpeg ............... yes PNG .................................. yes Using system libpng ................ yes Text formats: HtmlParser ........................... yes CssParser ............................ yes OdfWriter ............................ yes MarkdownReader ....................... yes Using system libmd4c ............... no MarkdownWriter ....................... yes EGL .................................... yes OpenVG ................................. no OpenGL: Desktop OpenGL ....................... no OpenGL ES 2.0 ........................ yes OpenGL ES 3.0 ........................ yes OpenGL ES 3.1 ........................ yes OpenGL ES 3.2 ........................ yes Vulkan ................................. yes Session Management ..................... yes Features used by QPA backends: evdev .................................. yes libinput ............................... yes INTEGRITY HID .......................... no mtdev .................................. yes tslib .................................. yes xkbcommon .............................. yes X11 specific: XLib ................................. yes XCB Xlib ............................. yes EGL on X11 ........................... yes xkbcommon-x11 ........................ yes QPA backends: DirectFB ............................... no EGLFS .................................. yes EGLFS details: EGLFS OpenWFD ........................ no EGLFS i.Mx6 .......................... no EGLFS i.Mx6 Wayland .................. no EGLFS RCAR ........................... no EGLFS EGLDevice ...................... yes EGLFS GBM ............................ yes EGLFS VSP2 ........................... no EGLFS Mali ........................... no EGLFS Raspberry Pi ................... no EGLFS X11 ............................ yes LinuxFB ................................ yes VNC .................................... yes XCB: Using system-provided xcb-xinput ..... no Native painting (experimental) ....... no GL integrations: GLX Plugin ......................... no EGL-X11 Plugin ..................... yes Qt Sql: SQL item models ........................ yes Qt Widgets: GTK+ ................................... no Styles ................................. Fusion Windows Qt PrintSupport: CUPS ................................... yes Qt Sql Drivers: DB2 (IBM) .............................. no InterBase .............................. no MySql .................................. no OCI (Oracle) ........................... no ODBC ................................... yes PostgreSQL ............................. yes SQLite2 ................................ yes SQLite ................................. yes Using system provided SQLite ......... no TDS (Sybase) ........................... yes Qt Testlib: Tester for item models ................. yes Serial Port: ntddmodm ............................... no Qt SerialBus: Socket CAN ............................. yes Socket CAN FD .......................... yes SerialPort Support ..................... yes Further Image Formats: JasPer ................................. no MNG .................................... yes TIFF ................................... yes Using system libtiff ................. yes WEBP ................................... yes Using system libwebp ................. yes Qt QML: QML network support .................... yes QML debugging and profiling support .... yes QML just-in-time compiler .............. yes QML sequence object .................... yes QML XML http request ................... yes QML Locale ............................. yes Qt QML Models: QML list model ......................... yes QML delegate model ..................... yes Qt Quick: Direct3D 12 ............................ no AnimatedImage item ..................... yes Canvas item ............................ yes Support for Qt Quick Designer .......... yes Flipable item .......................... yes GridView item .......................... yes ListView item .......................... yes TableView item ......................... yes Path support ........................... yes PathView item .......................... yes Positioner items ....................... yes Repeater item .......................... yes ShaderEffect item ...................... yes Sprite item ............................ yes QtQuick3D: Assimp ................................. yes System Assimp .......................... no Qt Scxml: ECMAScript data model for QtScxml ...... yes Qt Gamepad: SDL2 ................................... no Qt 3D: Assimp ................................. yes System Assimp .......................... no Output Qt3D GL traces .................. no Use SSE2 instructions .................. no Use AVX2 instructions .................. no Aspects: Render aspect ........................ yes Input aspect ......................... yes Logic aspect ......................... yes Animation aspect ..................... yes Extras aspect ........................ yes Qt 3D Renderers: OpenGL Renderer ........................ yes RHI Renderer ........................... no Qt 3D GeometryLoaders: Autodesk FBX ........................... no Qt Bluetooth: BlueZ .................................. yes BlueZ Low Energy ....................... yes Linux Crypto API ....................... yes Native Win32 Bluetooth ................. no WinRT Bluetooth API (desktop & UWP) .... no WinRT advanced bluetooth low energy API (desktop & UWP) . no Qt Sensors: sensorfw ............................... no Qt Quick Controls 2: Styles ................................. Default Fusion Imagine Material Universal Qt Quick Templates 2: Hover support .......................... yes Multi-touch support .................... yes Qt Positioning: Gypsy GPS Daemon ....................... no WinRT Geolocation API .................. no Qt Location: Qt.labs.location experimental QML plugin . yes Geoservice plugins: OpenStreetMap ........................ yes HERE ................................. yes Esri ................................. yes Mapbox ............................... yes MapboxGL ............................. yes Itemsoverlay ......................... yes QtXmlPatterns: XML schema support ..................... yes Qt Multimedia: ALSA ................................... yes GStreamer 1.0 .......................... yes GStreamer 0.10 ......................... no Video for Linux ........................ yes OpenAL ................................. yes PulseAudio ............................. yes Resource Policy (libresourceqt5) ....... no Windows Audio Services ................. no DirectShow ............................. no Windows Media Foundation ............... no Qt TextToSpeech: Flite .................................. no Flite with ALSA ........................ no Speech Dispatcher ...................... no Qt Tools: Qt Assistant ........................... yes Qt Designer ............................ yes Qt Distance Field Generator ............ yes kmap2qmap .............................. yes Qt Linguist ............................ yes Mac Deployment Tool .................... no makeqpf ................................ yes pixeltool .............................. yes qdbus .................................. yes qev .................................... yes Qt Attributions Scanner ................ yes qtdiag ................................. yes qtpaths ................................ yes qtplugininfo ........................... yes Windows deployment tool ................ no WinRT Runner Tool ...................... no Qt Tools: QDoc ................................... no
definition USB:
root@pi:~# lsusb Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub Bus 001 Device 003: ID 0eef:0001 D-WAV Scientific Co., Ltd eGalax Touch Screen Bus 001 Device 002: ID 2109:3431 VIA Labs, Inc. Hub Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub root@pi:~#
Run evtest:
root@pi:~# evtest No device specified, trying to scan all of /dev/input/event* Available devices: /dev/input/event0: eGalax Inc. USB TouchController UNKNOWN /dev/input/event1: eGalax Inc. USB TouchController Stylus /dev/input/event2: eGalax Inc. USB TouchController` check 1: `root@pi:~# evtest No device specified, trying to scan all of /dev/input/event* Available devices: /dev/input/event0: eGalax Inc. USB TouchController UNKNOWN /dev/input/event1: eGalax Inc. USB TouchController Stylus /dev/input/event2: eGalax Inc. USB TouchController Select the device event number [0-2]: 1 Input driver version is 1.0.1 Input device ID: bus 0x3 vendor 0xeef product 0x1 version 0x210 Input device name: "eGalax Inc. USB TouchController Stylus" Supported events: Event type 0 (EV_SYN) Event type 1 (EV_KEY) Event code 320 (BTN_TOOL_PEN) Event code 330 (BTN_TOUCH) Event code 331 (BTN_STYLUS) Event type 3 (EV_ABS) Event code 0 (ABS_X) Value 2008 Min 0 Max 4095 Event code 1 (ABS_Y) Value 2052 Min 0 Max 4095 Event type 4 (EV_MSC) Event code 4 (MSC_SCAN) Properties: Testing ... (interrupt to exit) Event: time 1716869875.859086, type 4 (EV_MSC), code 4 (MSC_SCAN), value d0042 Event: time 1716869875.859086, type 1 (EV_KEY), code 330 (BTN_TOUCH), value 1 Event: time 1716869875.859086, type 3 (EV_ABS), code 0 (ABS_X), value 1488 Event: time 1716869875.859086, type 3 (EV_ABS), code 1 (ABS_Y), value 1990 Event: time 1716869875.859086, -------------- SYN_REPORT ------------ Event: time 1716869875.874988, type 3 (EV_ABS), code 0 (ABS_X), value 1490 Event: time 1716869875.874988, -------------- SYN_REPORT ------------ Event: time 1716869875.878990, type 3 (EV_ABS), code 0 (ABS_X), value 1496 Event: time 1716869875.878990, -------------- SYN_REPORT ------------ Event: time 1716869875.885024, type 3 (EV_ABS), code 0 (ABS_X), value 1506 Event: time 1716869875.885024, -------------- SYN_REPORT ------------ Event: time 1716869875.890991, type 3 (EV_ABS), code 0 (ABS_X), value 1518
The reaction to pressing the touchscreen. Instal tslib:
apt-get install evtest libts-bin apt-get install libts-dev export TSLIB_TSDEVICE=/dev/input/event1 export TSLIB_FBDEVICE=/dev/fb0:
ts_calibrate and ts_test work. next step:
export QT_QPA_PLATFORM=eglfs export TSLIB_FBDEVICE=/dev/fb0 export TSLIB_TSDEVICE=/dev/input/event1 export QT_QPA_EGLFS_NO_LIBINPUT=1 export QT_QPA_FB_TSLIB=1 export QT_QPA_EVDEV_TOUCHSCREEN_PARAMETERS=/dev/input/event1 export QWS_MOUSE_PROTO=tslib:/dev/input/event1
Run program on qt5.15.
I tried different environments, but nothing helped me. Touchscreen not working.
Help me!
-
you need to install drivers for your touch screen
-
@Ronel_qtmaster I think @Alexey_Golubev has installed the drivers here
apt-get install evtest libts-bin apt-get install libts-dev
@Alexey_Golubev
ts_calibrate and ts_test have meaningful outputs, and the TS works e.g. hooked up to a PC.Touchscreen not working.
What's not working? Display? Touch? Both?
export QT_QPA_EVDEV_TOUCHSCREEN_PARAMETERS=/dev/input/event1
=> what is intended here? I use this env variable for parameters, e.g.
/dev/input/event1:rotate=180
IMHO, you don't have to pass anything here, unless you want to pass a parameter. -
@Ronel_qtmaster I think @Alexey_Golubev has installed the drivers here
apt-get install evtest libts-bin apt-get install libts-dev
@Alexey_Golubev
ts_calibrate and ts_test have meaningful outputs, and the TS works e.g. hooked up to a PC.Touchscreen not working.
What's not working? Display? Touch? Both?
export QT_QPA_EVDEV_TOUCHSCREEN_PARAMETERS=/dev/input/event1
=> what is intended here? I use this env variable for parameters, e.g.
/dev/input/event1:rotate=180
IMHO, you don't have to pass anything here, unless you want to pass a parameter.@Axel-Spoerl said in Raspberry Pi 4 touchscreen with Qt5.15 embedded is not working:
ts_calibrate and ts_test have meaningful outputs, and the TS works e.g. hooked up to a PC.
ts_calibrate and ts_test output correct data. When connected to a PC, the touch works correctly.
@Axel-Spoerl said in Raspberry Pi 4 touchscreen with Qt5.15 embedded is not working:
What's not working? Display? Touch? Both?
The touchscreen is not working. The display is working.
When running the qt 5.15 program, the display works. The touchscreen doesn't work. -
Which XInput driver are you using?
libinput
(wrong), orevdev
(right). -
@Axel-Spoerl said in Raspberry Pi 4 touchscreen with Qt5.15 embedded is not working:
evdev(right)
I installed it first evdev:
sudo apt-get install xserver-xorg-input-evdevchange the driver in a config file:
sudo nano /usr/share/X11/xorg.conf.d/40-libinput.confat the lines with touchscreen driver replace libinput by evdev
Section "InputClass" Identifier "evdev tablet catchall" MatchIsTablet "on" MatchDevicePath "/dev/input/event*" Driver "evdev" EndSection
-
Hm, that looks just fine.
The only thing left would be to try/dev/input/event0
and/dev/input/event2
respectively.
Maybe the "stylus" device reacts only to a pen. -
Hm, that looks just fine.
The only thing left would be to try/dev/input/event0
and/dev/input/event2
respectively.
Maybe the "stylus" device reacts only to a pen.@Axel-Spoerl said in Raspberry Pi 4 touchscreen with Qt5.15 embedded is not working:
The only thing left would be to try /dev/input/event0 and /dev/input/event2 respectively.
How can this be done? You can learn more for beginners.
-
To begin with, you're not a beginner, @Alexey_Golubev ;-)
Replace this
export TSLIB_TSDEVICE=/dev/input/event1
and try this
export TSLIB_TSDEVICE=/dev/input/event0
and this
export TSLIB_TSDEVICE=/dev/input/event2
-
if export TSLIB_TSDEVICE=/dev/input/event1 that ts_calibrate work.
if export TSLIB_TSDEVICE=/dev/input/event0 that ts_calibrate notwork.
if export TSLIB_TSDEVICE=/dev/input/event2 that ts_calibrate notwork.
-
To begin with, you're not a beginner, @Alexey_Golubev ;-)
Replace this
export TSLIB_TSDEVICE=/dev/input/event1
and try this
export TSLIB_TSDEVICE=/dev/input/event0
and this
export TSLIB_TSDEVICE=/dev/input/event2
@Axel-Spoerl said in Raspberry Pi 4 touchscreen with Qt5.15 embedded is not working:
export TSLIB_TSDEVICE=/dev/input/event1
What should I do next?
-
I am kinda lost.
Maybe try Qt 6, even though I wouldn't know of a long standing bug that prevents touch from working. -
I am kinda lost.
Maybe try Qt 6, even though I wouldn't know of a long standing bug that prevents touch from working.@Axel-Spoerl said in Raspberry Pi 4 touchscreen with Qt5.15 embedded is not working:
I wouldn't know of a long standing bug that prevents touch from working
I can't use Qt6.
Maybe you need special keys for qt 5.15? -
I am kinda lost.
Maybe try Qt 6, even though I wouldn't know of a long standing bug that prevents touch from working.@Axel-Spoerl said in Raspberry Pi 4 touchscreen with Qt5.15 embedded is not working:
I am kinda lost.
Can you help?
-
No, I have no more ideas.
-
No, I have no more ideas.
@Axel-Spoerl said in Raspberry Pi 4 touchscreen with Qt5.15 embedded is not working:
No, I have no more ideas.
I found that "-plugin tslib" touchscreen works.
"export QT_QPA_FB_TSLIB=1" does not work.
If I write "root@pi:~# /home/pi/Qt_Projects/kiab/kia -plugin tslib" then the touchscreen works.