Qt app freezes when touch screen after a time

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Qt app freezes when touch screen after a time

3,256 Views
emmanuelperea
Contributor III

Hello,

I have a big problem with a qt app. The qt version is 5.9, build It in qt creator 4.2.1 and cross-compiler to an Imx6 Linux board.

The Imx6 was built with Yocto 2.4. 

My qt app is a big project, has spi communication, date and time update with rtc driver, use qcustomplot to draw curves in real-time, use stylesheets files, use audio.

I cant show my code because its a huge project but in a nutshell the app reads data from a memory connected by spi and shows these data in curves using qcustomplot. The app shows date and time from system and user car change them.

The app is working but when it passes a few minutes the app freeze completely when the user touches the screen (touchscreen). I have reading a lot of posts in different forums, and many people had this "freeze" problem, but I haven't get any solution in nowhere, a read that It can be a deadlock because the program is locked for some reason in somewhere. When I use a mouse instead touchscreen the "freeze" problem doesn't happen. 

Y debugged the app from qt creator and when the program es "freeze" in qt creator I see the follows threads in backtrace:

1 futex_wait_cancelable futex-internal.h 88 0x76437a24
2 __pthread_cond_wait_common pthread_cond_wait.c 502 0x76437a24
3 __pthread_cond_wait pthread_cond_wait.c 655 0x76437a24
4 _XReply xcb_io.c 590 0x7580cd90
5 _XSeqSyncFunction XlibInt.c 203 0x7580f544
6 _XError XlibInt.c 1436 0x7580ee70
7 handle_error xcb_io.c 199 0x7580bcb8
8 handle_response xcb_io.c 311 0x7580bd6c
9 _XReply xcb_io.c 640 0x7580cd58
10 _XSeqSyncFunction XlibInt.c 203 0x7580f544
11 _XError XlibInt.c 1436 0x7580ee70
12 handle_error xcb_io.c 199 0x7580bcb8
13 handle_response xcb_io.c 311 0x7580bd6c
14 _XReply xcb_io.c 640 0x7580cd58
15 _XSeqSyncFunction XlibInt.c 203 0x7580f544
16 _XError XlibInt.c 1436 0x7580ee70
17 handle_error xcb_io.c 199 0x7580bcb8
18 handle_response xcb_io.c 311 0x7580bd6c
19 _XReply xcb_io.c 640 0x7580cd58
20 _XSeqSyncFunction XlibInt.c 203 0x7580f544
21 _XError XlibInt.c 1436 0x7580ee70
22 handle_error xcb_io.c 199 0x7580bcb8
23 handle_response xcb_io.c 311 0x7580bd6c
24 _XReply xcb_io.c 640 0x7580cd58
25 _XSeqSyncFunction XlibInt.c 203 0x7580f544
26 _XError XlibInt.c 1436 0x7580ee70
27 handle_error xcb_io.c 199 0x7580bcb8
28 handle_response xcb_io.c 311 0x7580bd6c
29 _XReply xcb_io.c 640 0x7580cd58
30 _XSeqSyncFunction XlibInt.c 203 0x7580f544
31 _XError XlibInt.c 1436 0x7580ee70
32 handle_error xcb_io.c 199 0x7580bcb8
33 handle_response xcb_io.c 311 0x7580bd6c
34 _XReply xcb_io.c 640 0x7580cd58
35 _XSeqSyncFunction XlibInt.c 203 0x7580f544
36 XIAllowTouchEvents XIAllowEvents.c 91 0x736a3c3c
37 QHash<int, QPointF>::operator[] qhash.h 750 0x734f45f0
38 QXcbConnection::xi2ProcessTouch qxcbconnection_xi2.cpp 722 0x734f45f0
39 QXcbConnection::xi2HandleEvent qxcbconnection_xi2.cpp 580 0x734f4c1c
40 QXcbConnection::handleXcbEvent qxcbconnection.cpp 1250 0x734d608c
41 QVector<bool ( *)(QXcbConnection *, xcb_generic_event_t *)>::resize qvector.h 416 0x734d6480
42 QVector<bool ( *)(QXcbConnection *, xcb_generic_event_t *)>::clear qvector.h 420 0x734d6480
43 QXcbConnection::processXcbEvents qxcbconnection.cpp 1743 0x734d6480
44 QObject::event qobject.cpp 1255 0x765fad14
45 QApplicationPrivate::process_cmdline qapplication.cpp 488 0x76c5ce88
46 ?? 0x3de9f0

Any suggestion or any idea that  I can handle this bug.

Thanks.

0 Kudos
Reply
2 Replies

3,039 Views
Bio_TICFSL
NXP TechSupport
NXP TechSupport

Hello Emmanuel

With latest QT 5.11 this does happens, check EVDEV working concurrently with TSLIB. Disable EVDEV setting the environment variable QT_QPA_EGLFS_DISABLE_INPUT=1 and then start my application explicitly specifying -plugin=tslib on command line.

Actually disabling EVDEV the detection of mouse is lost and the mouse pointer is always shown on the screen of my touch application. Anyway you could easily get rid of it setting another environment variable QT_QPA_EGLFS_HIDECURSOR=1.

Regards

0 Kudos
Reply

3,039 Views
emmanuelperea
Contributor III

Hi Bio_TICFSL,

Thanks for reply.

My application use X11, for the doc that I read I think that input is handled by X11. I think that the problem is how x11 and qt handling the touch input event because when I use mouse the app doesn't  freezes. 

I setted  QT_QPA_EGLFS_DISABLE_INPUT=1 but mouse is detected. 

I setted QT_QPA_EGLFS_HIDECURSOR=1 but coursor is showed.

I am lost here, I dont know how can I do to use tslib in my app, can I use both X11 and tslib ?

I croos compile with qtcreator to use the app in an IMX6 board, How can I compile my qt app to use tslib?

0 Kudos
Reply