Unsolved Qt5.6 cross compile for arm am335x - Cannot support touch
-
I'm having trouble using capacitive touchscreen with Qt 5.6.
I've cross-compiled Qt for TI am335x. The GUI window shows well, but the touch screen doesn't respond.
Actually, I have two capacitive touchscreen. One's touch IC is egalaxy, another's is ft5x60.If I use ts_test (a test demo provided by tslib) or evtest to test the two touchscreens, both of them works fine. But If I run the Qt application. The one with ft5x60 doesn't work.
I wrote a simple demo to display the touch axial points on the screen, which is mainly like this:
void Widget::mousePressEvent(QMouseEvent *e)
{
ui->label->setText(tr("(%1, %2)").arg(e->x()).arg(e->y()));
}
The touchscreen with egalaxy IC can shows the right axial values. But one with ft5x60 always show 0, 0.I also use strace to check the internal process. When I use touchscreen with with ft5x60, it seems like Qt application can get the event by polling. The strace log is below
poll([{fd=3, events=POLLIN}, {fd=8, events=POLLIN}, {fd=9, events=POLLIN}, {fd=10, events=POLLIN}, {fd=11, events=POLLIN}], 5, -1) = 1 ([{fd=3, revents=POLLIN}])
read(3, "\1\0\0\0\0\0\0\0", 16) = 8
clock_gettime(CLOCK_MONOTONIC, {tv_sec=450, tv_nsec=396808136}) = 0I also compared the evtest results of two screens:
egalaxy:
Input driver version is 1.0.1
Input device ID: bus 0x18 vendor 0xeef product 0x20 version 0x1
Input device name: "eGalax_Touch_Screen"
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 0
Min 0
Max 4095
Event code 1 (ABS_Y)
Value 0
Min 0
Max 4095
Event code 47 (ABS_MT_SLOT)
Value 0
Min 0
Max 15
Event code 48 (ABS_MT_TOUCH_MAJOR)
Value 0
Min 0
Max 255
Event code 53 (ABS_MT_POSITION_X)
Value 0
Min 0
Max 4095
Event code 54 (ABS_MT_POSITION_Y)
Value 0
Min 0
Max 4095
Event code 57 (ABS_MT_TRACKING_ID)
Value 0
Min 0
Max 65535
Event: time 1526017144.135398, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 0
Event: time 1526017144.135398, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1
Event: time 1526017144.135398, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 3971
Event: time 1526017144.135398, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 4012
Event: time 1526017144.135398, type 1 (EV_KEY), code 330 (BTN_TOUCH), value 1
Event: time 1526017144.135398, type 3 (EV_ABS), code 0 (ABS_X), value 3971
Event: time 1526017144.135398, type 3 (EV_ABS), code 1 (ABS_Y), value 4012
Event: time 1526017144.135398, -------------- SYN_REPORT ------------
Event: time 1526017144.240642, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value -1
Event: time 1526017144.240642, type 1 (EV_KEY), code 330 (BTN_TOUCH), value 0
Event: time 1526017144.240642, -------------- SYN_REPORT ------------ft506x:
Input driver version is 1.0.1
Input device ID: bus 0x18 vendor 0x0 product 0x0 version 0x0
Input device name: "EP0790M09"
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 796
Min 0
Max -1
Event code 1 (ABS_Y)
Value 479
Min 0
Max -1
Event code 47 (ABS_MT_SLOT)
Value 0
Min 0
Max 4
Event code 53 (ABS_MT_POSITION_X)
Value 0
Min 0
Max -1
Event code 54 (ABS_MT_POSITION_Y)
Value 0
Min 0
Max -1
Event code 57 (ABS_MT_TRACKING_ID)
Value 0
Min 0
Max 65535Event: time 1526016771.203739, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 9
Event: time 1526016771.203739, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 765
Event: time 1526016771.203739, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 444
Event: time 1526016771.203739, type 1 (EV_KEY), code 330 (BTN_TOUCH), value 1
Event: time 1526016771.203739, type 3 (EV_ABS), code 0 (ABS_X), value 765
Event: time 1526016771.203739, type 3 (EV_ABS), code 1 (ABS_Y), value 444
Event: time 1526016771.203739, -------------- SYN_REPORT ------------
Event: time 1526016771.276174, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value -1
Event: time 1526016771.276174, type 1 (EV_KEY), code 330 (BTN_TOUCH), value 0
Event: time 1526016771.276174, -------------- SYN_REPORT ------------I noticed that there are some differences like ABS_X ABS_Y ABS_MT_POSITION_X ABS_MT_POSITION_Y.
It seems like the event data are different. But if it's problem caused by the driver of ft5x06, why ts_test can works fine?BTW: I didn't configure tslib for Qt. My configuration is as below:
Build options:
Configuration .......... accessibility alsa audio-backend c++11 clock-gettime clock-monotonic compile_examples concurrent cross_compile egl eglfs enable_new_dtags evdev eventfd fontconfig full-config getaddrinfo getifaddrs glib harfbuzz icu inotify ipv6ifname large-config largefile libudev linuxfb medium-config minimal-config mremap no-libdl opengl opengles2 openssl png posix_fallocate qpa qpa reduce_exports release release_tools shared small-config system-freetype system-jpeg system-png system-zlib threadsafe-cloexec
Build parts ............ libs
Mode ................... release; optimized tools
Using sanitizer(s)...... none
Using C++ standard ..... c++11
Using gold linker....... no
Using new DTAGS ........ yes
Using PCH .............. no
Using LTCG ............. no
Target compiler supports:
Neon ................. noQt modules and options:
Qt D-Bus ............... no
Qt Concurrent .......... yes
Qt GUI ................. yes
Qt Widgets ............. yes
Large File ............. yes
QML debugging .......... yes
Use system proxies ..... noSupport enabled for:
Accessibility .......... yes
ALSA ................... yes
CUPS ................... no
Evdev .................. yes
FontConfig ............. yes
FreeType ............... yes (system library)
Glib ................... yes
GStreamer .............. no
GTK theme .............. no
HarfBuzz ............... yes (bundled copy)
Iconv .................. no
ICU .................... yes
Image formats:
GIF .................. yes (plugin, using bundled copy)
JPEG ................. yes (plugin, using system library)
PNG .................. yes (in QtGui, using system library)
libinput................ no
Logging backends:
journald ............... no
syslog ............... no
mtdev .................. no
Networking:
getaddrinfo .......... yes
getifaddrs ........... yes
IPv6 ifname .......... yes
libproxy.............. no
OpenSSL .............. yes (loading libraries at run-time)
OpenGL / OpenVG:
EGL .................. yes
OpenGL ............... yes (OpenGL ES 2.0+)
OpenVG ............... no
PCRE ................... system
pkg-config ............. yes
PulseAudio ............. no
QPA backends:
DirectFB ............. no
EGLFS ................ yes
EGLFS i.MX6 ........ no
EGLFS i.MX6 Wayland. no
EGLFS EGLDevice .... no
EGLFS GBM .......... no
EGLFS Mali ......... no
EGLFS Raspberry Pi . no
EGLFS X11 .......... no
LinuxFB .............. yes
Mir client............ no
XCB .................. no
Session management ..... yes
SQL drivers:
DB2 .................. no
InterBase ............ no
MySQL ................ no
OCI .................. no
ODBC ................. no
PostgreSQL ........... no
SQLite 2 ............. no
SQLite ............... no
TDS .................. no
tslib .................. no
udev ................... yes
xkbcommon-x11........... no
xkbcommon-evdev......... no
zlib ................... yes (system library)