• TI Thinks Resolved

Linux/AM3352: Touchscreen issues

Part Number: AM3352

Tool/software: Linux

Hello,

I am workning on AM3352 based custom board.

I need to run touch screen on qt GUI application.

In that Qt application GUI on LCD is working fine without "weston", and with "-platform linuxfb".

But I am facing problem when i touch on the touch screen, I am getting X and Y coordinate, I checked with "evtest" utility.

In Matrix GUI application(running as -platform linuxfb) or any custom qt application touch  is not working.

But "pinchzoom" example which is available in the filesyatem it is working.(Zoom in Zoom out working fine in pinchzoom).

Below is the log for referance.

/--------------------------------------------- Log ----------------------------------------------/

root@am335x-evm:~# evtest
No device specified, trying to scan all of /dev/input/event*
Available devices:
/dev/input/event0:      goodix-ts
/dev/input/event1:      volume_keys@0
/dev/input/event2:      ti-tsc
Select the device event number [0-2]: 0
Input driver version is 1.0.1
Input device ID: bus 0x18 vendor 0xdead product 0xbeef version 0x28bb
Input device name: "goodix-ts"
Supported events:
  Event type 0 (EV_SYN)
  Event type 1 (EV_KEY)
    Event code 330 (BTN_TOUCH)
  Event type 3 (EV_ABS)
    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      480
    Event code 54 (ABS_MT_POSITION_Y)
      Value      0
      Min        0
      Max      272
    Event code 57 (ABS_MT_TRACKING_ID)
      Value      0
      Min        0
      Max      255
    Event code 58 (ABS_MT_PRESSURE)
      Value      0
      Min        0
      Max      255
Properties:
  Property type 1 (INPUT_PROP_DIRECT)
Testing ... (interrupt to exit)
Event: time 1494428001.078759, type 1 (EV_KEY), code 330 (BTN_TOUCH), value 1
Event: time 1494428001.078759, type 3 (EV_ABS), code 58 (ABS_MT_PRESSURE), value 15
Event: time 1494428001.078759, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 15
Event: time 1494428001.078759, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 0
Event: time 1494428001.078759, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 282
Event: time 1494428001.078759, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 151
Event: time 1494428001.078759, ++++++++++++++ SYN_MT_REPORT ++++++++++++
Event: time 1494428001.078759, -------------- SYN_REPORT ------------
Event: time 1494428001.107006, type 1 (EV_KEY), code 330 (BTN_TOUCH), value 0
Event: time 1494428001.107006, ++++++++++++++ SYN_MT_REPORT ++++++++++++
Event: time 1494428001.107006, -------------- SYN_REPORT ------------

/---------------------------------------------------------------------------------------------------------------------------------------/

It's look like touch driver working properly but matrix GUI application not accepting the touch which is use "linuxfb" as a platform.


I also cross compiled "tslib" and try to run "ts_calibrate", but looks like calibration is not happening.
below is the log and env setup for your referance.

/---------------------------------------- Exported Variables --------------------------------------/
export QT_PLUGIN_PATH=/usr/lib/qt5/plugins/
export QT_QPA_FONTDIR=/usr/lib/fonts
export QT_QPA_PLATFORM_PLUGIN_PATH=/usr/lib/qt5/plugins/platforms/
export QT_QPA_PLATFORM=linuxfb
export QT_QPA_EVDEV_TOUCHSCREEN_PARAMETERS=/dev/input/event0
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/root/Tslib/Install/lib
export TSLIB_TSEVENTTYPE='INPUT'
export TSLIB_FBDEVICE=/dev/fb0
export TSLIB_TSDEVICE=/dev/input/event0
export TSLIB_CONFFILE=/home/root/Tslib/Install/etc/ts.conf
export TSLIB_PLUGINDIR=/home/root/Tslib/Install/lib/ts
export TSLIB_CONSOLEDEVICE='none'

/---------------------------------------------------------------------------------------------------------------/
/---------------------- Out put of ts_calibrate -------------------------/
root@am335x-evm:~/Tslib/Install/bin# ./ts_calibrate
xres = 480, yres = 272


/----------------------------------------------------------------------------/

Display is coming on screen calibration curser is also comming on screen.
But when I touch there is not calibration going to happen, at that time in "evtest" utility I can see the X and Y coordinate.

Please do the needful.

Regards,
-- Ronak

  • The software team have been notified. They will respond here.

     

    Best Regards
    Biser
  • In reply to Biser Gatchev-XID:

    Hello,

    Thank You for your response.

    Regards,

    -- Ronak

  • In reply to Ronak Patel:

    Hello Ronak,

    Matrix browser by itself is a Qt application, so if the touch screen works on any Qt application it should work over Matrix browser too. Try export QT_QPA_EVDEV_TOUCHSCREEN_PARAMETERS="rotate=180" since you may have the touch pointers mirrored.

    Try also installing the latest tslib github.com/.../releases
    Try to unset TSLIB_CONSOLEDEVICE and calibrate.
    Try exporting just export TSLIB_FBDEVICE=/dev/fb0 and export TSLIB_TSDEVICE=/dev/input/touchscreen0 instead of all these stuff.

    Please, also check these wiki pages.
    processors.wiki.ti.com/.../Matrix_Users_Guide
    processors.wiki.ti.com/.../How_to_Recalibrate_the_Touchscreen
    processors.wiki.ti.com/.../AM335x_Touchscreen_Driver's_Guide

    Best regards,
    Kemal

  • In reply to Kemal R. Shakir:

    Hello Kemal,

    I did the change what you said, install new tslib1.10 and refer all the links which you sent.

    But still it is not taking input event in Qt.

    /-------------------------------------------------------- LOG ---------------------------------------------------------------/

    root@am335x-evm:~# export QT_QPA_EVDEV_TOUCHSCREEN_PARAMETERS="rotate=180"
    root@am335x-evm:~# unset TSLIB_CONSOLEDEVICE
    root@am335x-evm:~# export TSLIB_FBDEVICE=/dev/fb0
    root@am335x-evm:~# export TSLIB_TSDEVICE=/dev/input/touchscreen0
    root@am335x-evm:~#
    root@am335x-evm:~#
    root@am335x-evm:~#
    root@am335x-evm:~# ts_calibrate
    xres = 480, yres = 272
    [ 231.453268] <<GTP-DBG>>[gt1x_touch_event_handler:1303](0)(63,41)[13]
    [ 231.463505] <<GTP-DBG>>[gt1x_touch_event_handler:1303](0)(63,41)[13]
    [ 231.477508] <<GTP-DBG>>[gt1x_request_event_handler:1104]Request state:0xff.
    [ 231.491344] <<GTP-DBG>>[gt1x_touch_event_handler:1303](0)(63,41)[13]
    [ 231.506893] <<GTP-DBG>>[gt1x_request_event_handler:1104]Request state:0xff.
    [ 231.523201] <<GTP-DBG>>[gt1x_touch_event_handler:1303](0)(63,41)[13]
    [ 231.540587] <<GTP-DBG>>[gt1x_request_event_handler:1104]Request state:0xff.
    [ 231.561800] <<GTP-DBG>>[gt1x_request_event_handler:1104]Request state:0xff.
    [ 231.581695] <<GTP-DBG>>[gt1x_request_event_handler:1104]Request state:0xff.
    [ 231.601918] <<GTP-DBG>>[gt1x_request_event_handler:1104]Request state:0xff.

    /-----------------------------------------------------------------------------------------------------------------------------/

    So GUI is going to open on the LCD, I can see the cursor but when i touch on the cursor to calibrate it is not taking input.

    From the touch driver i can see the X and Y position in kernel log.

    Am i missing something?? Please do the needful.

    Regards,

    -- Ronak

  • In reply to Ronak Patel:

    Hello Kemal,

    As per the link refer on e2e SDK(3.2.0.5), have Qt5.6 and it is having by default evdev support in place of tslib.
    So how to calibrate with evdev, Is there any way to calibrate because ts_calibrate is not working?

    Regards,
    -- Ronak
  • In reply to Ronak Patel:

    Evdev gets calibrated automatically. Try disabling it QT_QPA_EGLFS_DISABLE_INPUT=1 and force your application to use -plugin=tslib Then also check if all the linuxfb touch input handlers are built-in, see this page doc.qt.io/.../embedded-linux.html Also, double check you touch screen device node settings in the device tree.