Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

[solved] Touchscreen calibration issue on Qt 4.8.4 on ARM



  • I'm having hard time calibrating the touchscreen when running Qt on the i.mx6 board (SabreLite)

    the tslib calibration works ok and I can see the cursor following my finger.

    However when I run any Qt app (either mine or one of the Qt demos included with Qt) the cursor seems to be moving at different pace than the finger. Seems like cursor is moving across a much larger space than the screen and it goes off the screen when the finger is still about 30% away from the edge.

    Why the Qt does not use tslib calibration data?
    Is there a way to define the touchscreen size which I maybe missed?

    I have come across posts where other people had similar issue but no solutions.


  • Lifetime Qt Champion

    Hi,

    Are you sure you are using the tslib input when starting your application ?
    Did you configure all tslib related environment variables ?



  • It is entirely possible that I have missed something since I'm a beginner in this area. To be honest, I am not sure how to specify tsllib intput when starting my Qt application.
    I would appreciate a short code example, if possible.

    FYI: I am using QtQuick(qml) for my gui, but this should not matter.. I think.

    I did configure the tslib env vars:
    export LD_LIBRARY_PATH=/usr/lib
    export TSLIB_TSEVENTTYPE=INPUT
    export TSLIB_CONSOLEDEVICE=none
    export TSLIB_FBDEVICE=/dev/fb0
    export TSLIB_CALIBFILE=/etc/pointercal
    export TSLIB_CONFFILE=/etc/ts.conf
    export TSLIB_PLUGINDIR=/usr/lib/ts
    export TSLIB_TSDEVICE=/dev/input/event1

    and the:
    TSLIB_CONFFILE contents:

    module_raw input
    module pthres pmin=1
    module variance delta=30
    module dejitter delta=100
    module linear



  • UPDATE:
    problem solved by updating env variables as shown below:

    export LD_LIBRARY_PATH=/usr/lib
    export TSLIB_TSEVENTTYPE=INPUT
    export QTDIR=/home/martin/Qt_E/qt-4.8.4_tslib/
    export QWS_MOUSE_PROTO=tslib:/dev/input/event1
    export TSLIB_CONSOLEDEVICE=none
    export TSLIB_FBDEVICE=/dev/fb0
    export TSLIB_CALIBFILE=/etc/pointercal
    export TSLIB_CONFFILE=/etc/ts.conf
    export TSLIB_PLUGINDIR=/usr/lib/ts
    export TSLIB_TSDEVICE=/dev/input/event1
    export QWS_DISPLAY=LinuxFB:mmWidth=800:mmHeight=480

    I have not nailed down which exact line fixed it but I have a feeling the QWS_DISPLAY is the one.


  • Lifetime Qt Champion

    Great you found out !
    Since it's the only line that was missing, my guess is that Qt was maybe using a different plugin (I don't remember which is the default), couldn't find the correct screen size or was given a wrong size (but I might be wrong).

    Don't forget to set the thread's title to solved so other forum users may know a solution has been found :)



  • hi have the same problem where do i find the tslib env vars file to edit,sorry i am new to this kindly help me if i am wrong.


  • Lifetime Qt Champion

    Hi and welcome to devnet,

    For testing purpose, you can simply set the variables on the command line before calling your application



  • hi,

    i have one more problem now i am using qt4e-demo-image and i get smart home demo on the target and says xres=800 and yres=460 after this i am not able to calibrate the touch screen its a touch screen from freescale scale its mciimx lvds connected to lvds 1 of sbaresd board the display says TOUCH CROSSHAIR TO CALIBRATE but if i touch it does not detect anything it does not work, kindly let me know what changes i have to make and where..


  • Lifetime Qt Champion

    That I can't, I don't have such a setup at hand. You should have a look at the documentation of your board/provider.


Log in to reply