This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

AM3354: Weston calibrator does not read events

Part Number: AM3354
Other Parts Discussed in Thread: TSC2046

Hi,

I have the following environment: Custom board, which is basically a copy of BBB with tsc2046 attached to spi0.0 and Resistive touchscreen (1024x768) attached to the TSC2046. I use Processor SDK Linux 06_01_00_08.

I have the following problem:
TSC2046 driver is correctly initialized in the kernel. I see the activity on the SPI line & the GPIO_PENDOW IRQ on an oscilloscope, when I touch the display, but when I run weston-calibrator it does not recognize the taps on the "x" simbol from the touchscreen.

I can see the touchscreen is sending data from xxd /dev/input/touchscreen0. I also used evtest and I am getting correct output out of it:
  root@am335x-evm:~# evtest /dev/input/touchscreen0                               
Input driver version is 1.0.1                                                   
Input device ID: bus 0x0 vendor 0x0 product 0x0 version 0x0                     
Input device name: "TSC2046 touchscreen"                                        
Supported events:                                                               
  Event type 0 (EV_SYN)                                                         
  Event type 1 (EV_KEY)                                                         
    Event code 330 (BTN_TOUCH)                                                  
  Event type 3 (EV_ABS)                                                         
    Event code 0 (ABS_X)                                                        
      Value      0                                                              
      Min        0                                                              
      Max     1023                                                              
    Event code 1 (ABS_Y)                                                        
      Value      0                                                              
      Min        0                                                              
      Max      767                                                              
    Event code 24 (ABS_PRESSURE)                                                
      Value      0                                                              
      Min        0                                                              
      Max        1                                                              
Properties:                                                                     
Testing ... (interrupt to exit)                                                 
Event: time 1554515124.851973, type 3 (EV_ABS), code 0 (ABS_X), value 1746      
Event: time 1554515124.851973, type 3 (EV_ABS), code 1 (ABS_Y), value 1155      
Event: time 1554515124.851973, type 3 (EV_ABS), code 24 (ABS_PRESSURE), value 1
Event: time 1554515124.851973, type 1 (EV_KEY), code 330 (BTN_TOUCH), value 1   
Event: time 1554515124.851973, -------------- SYN_REPORT ------------           
Event: time 1554515124.930751, type 3 (EV_ABS), code 24 (ABS_PRESSURE), value 0
Event: time 1554515124.930751, type 1 (EV_KEY), code 330 (BTN_TOUCH), value 0   
Event: time 1554515124.930751, -------------- SYN_REPORT ------------           
Event: time 1554515126.281975, type 3 (EV_ABS), code 0 (ABS_X), value 1811      
Event: time 1554515126.281975, type 3 (EV_ABS), code 1 (ABS_Y), value 2099      
Event: time 1554515126.281975, type 3 (EV_ABS), code 24 (ABS_PRESSURE), value 1
Event: time 1554515126.281975, type 1 (EV_KEY), code 330 (BTN_TOUCH), value 1   
Event: time 1554515126.281975, -------------- SYN_REPORT ------------           
Event: time 1554515126.302033, type 3 (EV_ABS), code 0 (ABS_X), value 1810      
Event: time 1554515126.302033, type 3 (EV_ABS), code 1 (ABS_Y), value 2110      
Event: time 1554515126.302033, -------------- SYN_REPORT ------------           
Event: time 1554515126.321968, type 3 (EV_ABS), code 0 (ABS_X), value 1822      
Event: time 1554515126.321968, type 3 (EV_ABS), code 1 (ABS_Y), value 2120      
Event: time 1554515126.321968, -------------- SYN_REPORT ------------           
Event: time 1554515126.341945, type 3 (EV_ABS), code 0 (ABS_X), value 1821      
Event: time 1554515126.341945, type 3 (EV_ABS), code 1 (ABS_Y), value 2128      
Event: time 1554515126.341945, -------------- SYN_REPORT ------------           
Event: time 1554515126.361982, type 3 (EV_ABS), code 0 (ABS_X), value 1828      
Event: time 1554515126.361982, type 3 (EV_ABS), code 1 (ABS_Y), value 2122      
Event: time 1554515126.361982, -------------- SYN_REPORT ------------           

However, weston-calibrator does not accept touch events on the resistive touchscreen display.  Can anyone point me to what might be the problem?

Thanks and regards.

  • Update on this:

    I built & installed tslib (MACHINE=am335x-evm bitbake tslib & then opkg install for all resulting .ipk), and then calibrated the touchscreen with ts_calibrate & verified that it works properly with ts_test.

    Also verified that display works when I stopped weston (/etc/init.d/weston stop) & ran some apps with -platform eglfs, but in this case since there was no calibration, the coordinates were very messed up. 

    So again, could you provide some pointers on why weston-calibrator is not accepting events from my resistive touchscreen display?

    Best Regards,
    Yordan

  • Hi,

    I made some progress on this one. When I boot the board, I create my own ws-calibrate.rules (with the help of the pointercal values) so the board can get past the first calibration stage. Then once I am able to boot the board, I add the following line in /etc/udev/rules.d/touchscreen.rules:

       SUBSYSTEM=="input", KERNEL=="event[0-9]*", ENV{ID_INPUT}=="1", ENV{ID_INPUT_TOUCHSCREEN}=="1", ATTRS{modalias}=="TSC2046 touchscreen", SYMLINK+="input/touchscreen0"

    Now when I run weston-calibrator for the second time I can calibrate the resistive touchscreen.

    The problem at this point is that Matrix GUI does not accept the touchscreen display. My suspicion here is that libinput is breaking somehow. I will try rebuilding qt-base without libinput, that is remove libinput from the following line in <tisdk>/sources/meta-arago/meta-arago-distro/conf/distro/arago.conf:
      PACKAGECONFIG_DISTRO_pn-qtbase = "icu examples accessibility gif libinput gbm kms xkbcommon-evdev"

    So it looks like this:
       PACKAGECONFIG_DISTRO_pn-qtbase = "icu examples accessibility gif gbm kms xkbcommon-evdev"

    I will test this and post my feedback.

    PS: To convert pointercal to ws-calibrate.rules you need to calculate the following:
    If these are your pointercal values:
    a    b     c         d      e   f        g     h    i

    The respective ws-calibrate.rules values are:
    a/g   b/g   c/g   d/g   e/g    f/g

    Best Regards,
    Yordan

  • Hello Yordan,

    What happens if you provide a ws-calibrate.rules but do not run calibration afterwards? Are touchscreen inputs still not accepted?

    I am curious to see what happens when you remove libinput.

    Regards,

    Nick

  • Hi Nick,

    What happens if you provide a ws-calibrate.rules but do not run calibration afterwards? Are touchscreen inputs still not accepted?

    Touchscreen inputs are not accepted by Matrix GUI. However if I run other simple applications like weston-simple-touch, weston-clickdot, weston fingerpaint touchscreen input is accepted, coordinates are a little off, but but inputs are accepted by those apps. Also if I run some of the apps with -platform eglfs, again input events are accepted, but coordinates are messed up.

    As I mentioned ts_test & ts_calibrate work fine. Everything is ok there. Coordinates are as they should be and touchscreen works OK.

    I am curious to see what happens when you remove libinput.

    My plan is to get this built by end of the week and test, perhaps I will provide my inputs on this one next week.

    Best Regards,
    Yordan

  • Hi,

    I tried removing the libinput and it didn't help.

    Is there a way to add tslib in PACKAGECONFIG_DISTRO_PN-qtbase? Something like:
      PACKAGECONFIG_DISTRO_pn-qtbase = "icu examples tslib accessibility gif gbm kms xkbcommon-evdev"

    Will this cause some conflicts within the filesystem when running the Matrix Gui?

    Thanks and regards.