tslib yocto touch event is not working



  • I'm trying to execute tslib in my yocto. The problem is that my touch screen is not recognized by the tslib (with ts_calibrate or ts_test).

    If I use the evtest, it works perfectly, take a look:

    ps: My device was recognized in "/dev/input/event0"

    ~# evtest
    No device specified, trying to scan all of /dev/input/event*
    Available devices:
    /dev/input/event0: cyttsp5_mt
    /dev/input/event1: Logitech USB Receiver
    /dev/input/event2: Logitech USB Receiver

    I'm selecting the "zero" device:
    ...
    Min 0
    Max 1
    Event code 57 (ABS_MT_TRACKING_ID)
    Value 0
    Min 0
    Max 65535
    Event code 58 (ABS_MT_PRESSURE)
    Value 0
    Min 0
    Max 255
    Properties:
    Property type 1 (INPUT_PROP_DIRECT)
    Property type 1 (INPUT_PROP_DIRECT)
    Testing ... (interrupt to exit)
    Event: time 1472308931.862872, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 2
    Event: time 1472308931.862872, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 92
    Event: time 1472308931.862872, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 267
    Event: time 1472308931.862872, type 3 (EV_ABS), code 58 (ABS_MT_PRESSURE), value 30
    Event: time 1472308931.862872, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 12
    Event: time 1472308931.862872, type 3 (EV_ABS), code 49 (ABS_MT_TOUCH_MINOR), value 12
    Event: time 1472308931.862872, -------------- SYN_REPORT ------------
    Event: time 1472308931.881448, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 93
    ...

    I tried set the enviromental variables:
    export TSLIB_TSEVENTTYPE=INPUT
    export TSLIB_TSDEVICE=/dev/input/event0
    export TSLIB_CALIBFILE=/etc/pointercal
    export TSLIB_CONFFILE=/etc/ts.conf
    export TSLIB_PLUGINDIR=/usr/lib/ts
    export TSLIB_FBDEVICE=/dev/fb0
    export TSLIB_CONSOLEDEVICE=none

    I'm using QT5 to develop, and I'm starting the applications in this way.
    export QWS_MOUSE_PROTO=tslib:/dev/input/event0
    ./app -platform eglfs "QWS_MOUSE_PROTO=tslib:/dev/input/event0"

    My ts.conf file is:
    /etc/ts.conf
    module_raw input
    module pthres pmin=1
    module variance delta=30
    module dejitter delta=100
    module linear

    I haven't any idea about the reason that it's not working.


  • Lifetime Qt Champion

    Hi,

    You're mixing Qt 4 old architecture (QWS) and Qt 5. See here for input handling for Embedded Linux.



  • @SGaist thank you. I did work the touchscreen on my Qt5 application, using this environment variable:

    export QT_QPA_EVDEV_TOUCHSCREEN_PARAMETERS=/dev/input/event0

    If I start the application: ./app -platform eglfs, the touch events are working now.

    But the touch screen axes (X and Y) are inverted. I uninstalled the tslib and libinput package.
    Some idea?


  • Lifetime Qt Champion

    You can try to add the rotate parameter to the plugin parameters. See on the same page of documentation I linked before



  • Yes, the rotation can work. I tried this:

    export QT_QPA_EVDEV_TOUCHSCREEN_PARAMETERS=/dev/input/event0:rotate=270

    But, what is happening, is that the axes are inverted. Should be a way to calibrate the touchscreen (like ts_calibrate) to set correctly the axes. Appear that rotating will not to solve.

    In my view, something like this, should be sufficient to tslib works.
    export QT_QPA_EGLFS_DISABLE_INPUT=1
    export TSLIB_TSDEVICE=/dev/input/event0
    export QT_QPA_PLATFORM=eglfs

    ./app -plugin tslib


  • Lifetime Qt Champion

    If you want to use tslib you have to calibrate it and set all the environment variables related to it.

    By the way, what about 90° ?



  • If I rotate 90º, is not sufficient. Look the image attached.

    0_1473721789394_click.png

    The click on right top is correct. But, for example, if I click on position of the blue ball, the touch will recognize on position of the red ball.

    It will be the same if I click on red ball (the touch will recognize the event on position of the blue ball)


  • Lifetime Qt Champion

    The direct upload function is currently broken so nobody but you can see the image. Can you post it on an image sharing site ?




  • Lifetime Qt Champion

    After re-reading something's not clear. Did you re-try with tslib ?


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.