Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. Rotating touch screen in QT Application using Evdevtouch plugin causes crashes
QtWS25 Last Chance

Rotating touch screen in QT Application using Evdevtouch plugin causes crashes

Scheduled Pinned Locked Moved Solved Mobile and Embedded
5 Posts 2 Posters 2.0k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Angel PopovA Offline
    Angel PopovA Offline
    Angel Popov
    wrote on last edited by
    #1

    Hello everyone,
    I'm using QT 5.10 on Raspberry Pi.
    If touch screen is rotated the program suddenly crashes when one is pressing the touch.
    I'm using the following script to start the application.

    Application.sh

    #!/bin/bash

    export LD_LIBRARY_PATH=/usr/local/qt5.10/lib/
    export PATH=/usr/local/qt5.10/bin:/usr/bin:/bin:/usr/local/games:/usr/games:/usr/local/qt5.10/bin
    export QT_QPA_EGLFS_FORCE888=1
    export QT_QPA_EGLFS_PHYSICAL_WIDTH=1920
    export QT_QPA_EGLFS_PHYSICAL_HEIGHT=1080
    export QT_QPA_EGLFS_DEPTH=32

    stty -F /dev/ttyAMA0 57600
    stty -F /dev/ttyAMA0 -echo -onlcr
    sudo rm /home/pi/output.txt
    sudo /home/pi/ApplicationX -plugin Evdevtouch:/dev/input/event0:rotate=90:invertx=0:inverty=1 &> /home/pi/output.txt

    The error it gives is:
    ./Application.sh: line 16: 689 Segmentation fault sudo /home/pi/ApplicationX -plugin Evdevtouch:/dev/input/event1:rotate=90 &> /home/pi/output.txt

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      You should get the stack trace of your crash. That should give you more information about what is happening.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • Angel PopovA Offline
        Angel PopovA Offline
        Angel Popov
        wrote on last edited by Angel Popov
        #3

        The application and the build was in long term use.
        I just decided to use the touchscreen in vertical mode.

        That is the error in output.txt:
        TouchPointPressed without previous release event QQuickEventPoint(accepted:false state:Pressed scenePos:QPointF(76.4292,1829.05) id:3000001 timeHeld:0)

        I don't know where to check for more information.

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          Can you trigger that crash easily ?
          If so then run a debug build of your application and use the debugger.

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          0
          • Angel PopovA Offline
            Angel PopovA Offline
            Angel Popov
            wrote on last edited by Angel Popov
            #5

            I think I fixed the things up.

            I set the variables like:
            export QT_DEBUG_PLUGINS="1"
            export QT_QPA_EGLFS_DISABLE_INPUT="1"
            export QT_QPA_EVDEV_TOUCHSCREEN_PARAMETERS="/dev/input/event1:rotate=270"
            export QT_QPA_GENERIC_PLUGINS="evdevtouch:/dev/input/event1"

            I found that they ware not set in the Application.sh that i'm using to start the application at boot time, so i just modified main.cpp:

            **#include <QGuiApplication>
            #include <QApplication>
            #include <QtQuick>
            #include "core.h"

            int main(int argc, char *argv[])
            {
            qmlRegisterType<core>("core", 1, 0, "Gen");
            qputenv("QT_IM_MODULE", QByteArray("qtvirtualkeyboard"));
            qputenv("QT_QPA_EGLFS_PHYSICAL_WIDTH", QByteArray("1920"));
            qputenv("QT_QPA_EGLFS_PHYSICAL_HEIGHT", QByteArray("1080"));
            qputenv("QT_QPA_EGLFS_FORCE888", QByteArray("1"));
            qputenv("QT_QPA_EGLFS_DEPTH", QByteArray("32"));

            qputenv("QT_DEBUG_PLUGINS", QByteArray("1"));
            qputenv("QT_QPA_EGLFS_DISABLE_INPUT", QByteArray("1"));
            qputenv("QT_QPA_EVDEV_TOUCHSCREEN_PARAMETERS", QByteArray("/dev/input/event1:rotate=270"));
            qputenv("QT_QPA_GENERIC_PLUGINS", QByteArray("evdevtouch:/dev/input/event1"));
            qputenv("QT_QPA_EGLFS_HIDECURSOR", QByteArray("1"));
            
            QApplication app(argc,argv);
            QQuickView view;
            

            // QApplication::setOverrideCursor(Qt::BlankCursor);
            view.setResizeMode(QQuickView::SizeRootObjectToView);
            view.setSource(QUrl(QStringLiteral("qrc:/main.qml")));

            return app.exec();
            

            }**

            Now the application is starting without -plugin Evdevtouch:/dev/input/event0:rotate=90:invertx=0:inverty=1 argument.

            I think that there ware some thread problems.

            1 Reply Last reply
            0

            • Login

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt Extensions
            • Unsolved