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.

AM572x touch screen calibration



Hi,

We have connected the usb based atmel touch panel. Whenever we connected we are getting the following log. event0 also created. A plus symbol is appearing for calibration. when we touch that it is not proceeding. Kindly suggest that what might be reason.

calibrating touch screen (first time only)
*** To continue, please complete the touchscreen calibration
*** by touching the crosshairs on the LCD screen[   39.047046] PVR_K: HWRecoverd

root@am57xx-evm:~# [  703.574772] usb 1-1: USB disconnect, device number 3
[  706.246972] usb 1-1: new full-speed USB device number 4 using xhci-hcd
[  706.395587] usb 1-1: New USB device found, idVendor=03eb, idProduct=212c
[  706.402345] usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[  706.409674] usb 1-1: Product: Atmel maXTouch Digitizer
[  706.414836] usb 1-1: Manufacturer: Atmel
[  706.441118] input: Atmel Atmel maXTouch Digitizer as /devices/platform/44000000.ocp/488c0000.omap_dwc3_2/488d0000.usb/xhci-hcd.0.auto/usb1/4
[  706.458701] hid-multitouch 0003:03EB:212C.0005: input,hiddev0: USB HID v1.11 Device [Atmel Atmel maXTouch Digitizer] on usb-xhci-hcd.0.auto0
[  706.477824] hid-multitouch 0003:03EB:212C.0006: hiddev0: USB HID v1.11 Device [Atmel Atmel maXTouch Digitizer] on usb-xhci-hcd.0.auto-1/inp

root@am57xx-evm:~# ls -l /dev/input/
total 0
drwxr-xr-x 2 root root      60 Jan  1 00:11 by-id
drwxr-xr-x 2 root root      60 Jan  1 00:11 by-path
crw-rw---- 1 root input 13, 64 Jan  1 00:11 event0
crw-rw---- 1 root input 13, 63 Jan  1  1970 mice
crw-rw---- 1 root input 13, 32 Jan  1 00:11 mouse0
lrwxrwxrwx 1 root root       6 Jan  1 00:11 touchscreen0 -> event0

Thanks & Regards,

N.V.Subbaiah


                                                                                

  • Hi,

    Linux Kernel 4.1.13+ (2015 LTS).

    Thanks & Regards,
    N.V.Subbaiah.
  • Hi,

    we have gone through this already. We have interfaced the am57xx custom board with 10.1 inch display and touch panel is usb based. We build the kernel with hid_multitouch support. When we connect the touch panel through touch usb to the custom board the module is loaded. we are getting the log also. when we run lsusb we are getting usb device info also. even0 also created in /dev/input/ folder. we are getting the calibration screen also. when we touch the + calibration point on the screen it is not proceeding. My issue is not related to mouse. Kindly read understand my issue and give relevant response instead of general responses just for the sake of process.


    calibrating touch screen (first time only)
    *** To continue, please complete the touchscreen calibration
    *** by touching the crosshairs on the LCD screen[ 39.047046] PVR_K: HWRecoverd

    root@am57xx-evm:~# [ 703.574772] usb 1-1: USB disconnect, device number 3
    [ 706.246972] usb 1-1: new full-speed USB device number 4 using xhci-hcd
    [ 706.395587] usb 1-1: New USB device found, idVendor=03eb, idProduct=212c
    [ 706.402345] usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=0
    [ 706.409674] usb 1-1: Product: Atmel maXTouch Digitizer
    [ 706.414836] usb 1-1: Manufacturer: Atmel
    [ 706.441118] input: Atmel Atmel maXTouch Digitizer as /devices/platform/44000000.ocp/488c0000.omap_dwc3_2/488d0000.usb/xhci-hcd.0.auto/usb1/4
    [ 706.458701] hid-multitouch 0003:03EB:212C.0005: input,hiddev0: USB HID v1.11 Device [Atmel Atmel maXTouch Digitizer] on usb-xhci-hcd.0.auto0
    [ 706.477824] hid-multitouch 0003:03EB:212C.0006: hiddev0: USB HID v1.11 Device [Atmel Atmel maXTouch Digitizer] on usb-xhci-hcd.0.auto-1/inp

    root@am57xx-evm:~# ls -l /dev/input/
    total 0
    drwxr-xr-x 2 root root 60 Jan 1 00:11 by-id
    drwxr-xr-x 2 root root 60 Jan 1 00:11 by-path
    crw-rw---- 1 root input 13, 64 Jan 1 00:11 event0
    crw-rw---- 1 root input 13, 63 Jan 1 1970 mice
    crw-rw---- 1 root input 13, 32 Jan 1 00:11 mouse0
    lrwxrwxrwx 1 root root 6 Jan 1 00:11 touchscreen0 -> event0

    Thanks & Regards,
    N.V.Subbaiah.
  • Hi, 

    nallapaneni venkata subbaiah said:
    when we touch the + calibration point on the screen it is not proceeding.

    Have you verified that your touch screen is responsive?

    Can you disable the touch screen calibration from /etc/init.d/weston? Comment the part which calls the weston-calibrator app, it is located after the following line:

    # Run a calibration app and save output to udev rules 

    Now the matrix-gui should display on your lcd, see if you can get any response from the touch screen. 

    Best Regards, 

    Yordan

  • HI Yordan,

    Thanks for your response. Now the touch is working but still having some calibration problem. We are using TSLIB for calibration and the calibration results are like this for my 800*600 display:
    root@am57xx-evm:~# ts_calibrate
    xres = 800, yres = 600
    Took 3 samples...
    Top left : X = 51 Y = 62
    Took 1 samples...
    Top right : X = 949 Y = 70
    Took 5 samples...
    Bot right : X = 958 Y = 932
    Took 4 samples...
    Bot left : X = 42 Y = 927
    Took 1 samples...
    Center : X = 507 Y = 513
    13.125122 0.771663 -0.000073
    12.195435 -0.004199 0.578894
    Calibration constants: 860168 50571 -4 799240 -275 37938 65536



    My LCD Timings are:
    .x_res = 800,
    .y_res = 600,

    .pixelclock = 40000000,

    .hfp = 48,
    .hsw = 128,
    .hbp = 88,

    .vfp = 1,
    .vsw = 4,
    .vbp = 23,


    After doing the calibration i have copied the results file pointercal to /etc/ folder also. Still i am facing the problem with touch cursor positions.


    Thanks & Regards,
    N.V.Subbaiah.
  • Hi,

    Why do you use the older ts_calibrate app, instead of the weston-calibrator, which is the default app in SDK_02.00.01.07?
    As far as I remember, ts_calibrate was changed, when sdk transitioned from 01.xx.xx.xx to 02.xx.xx.xx. Can you try he weston-calibrator app?

    Best Regards,
    Yordan
  • Hi,

    We are getting crashes with default 02.00.01.07 sdk. We have disabled some of the options in the kernel config with the help of texas instruments team from india. Now it is very stable. Our application almost finished except this pointer moving some where when we touch at some point. Kindly suggest where the calibration results will be stored when we use weston calibrator app. Also weston calibrator command is not in my final image.We will keep our pointercal file there or update manuall in that file.  Is there any way to make use of ts_calibrate touch screen results to make touch screen work properly.

    Thanks & Regards,
    N.V.Subbaiah.

  • Hi Yordan,

    What if ws-calibrate.rules file is not present in /etc/udev/rules.d/ what calibration result values it will take? Please help out on this issue.

    Thanks & Regards,
    N.V.Subbaiah.
  • Hi,

    Calibration files (for sdk 2.00 & 2.00.01) are located in both /boot partition of the sdcard and /etc/udev/rules.d folder. The file is called ws-calibrate.rules. For the standard AM57xx GP evm display (LCD is a OSD 7in WVGA (800x480)) it has the following values:
    SUBSYSTEM=="input", ENV{WL_CALIBRATION}="0.977496 0.024747 9.032532 0.028459 1.013379 -30.116791"

    The source code of the app can be found here:
    weston-calibrator:
    github.com/.../calibrator.c

    ts_calibrate:
    github.com/.../ts_calibrate.c

    You can have a look how both calibration apps calculate the values stored in the ws-calibrate.rules & pointercall files.

    If you don't have a calibration file, your touch screen will not be very responsive (may not detect the exact coordinates of the touches). It takes random values.

    Hope this helps.

    Best Regards,
    Yordan
  • Hi Yordan,

    I have done calibration using ts_calibrate with tslib. I have exported variables
    root@am57xx-evm:~# export TSLIB_FBDEVICE=/dev/fb0
    root@am57xx-evm:~# export TSLIB_TSDEVICE=/dev/input/touchscreen0
    root@am57xx-evm:~# export TSLIB_CONFFILE=/etc/ts.conf
    root@am57xx-evm:~# export TSLIB_PLUGINDIR=/lib/ts
    root@am57xx-evm:~# export TSLIB_CALIBFILE=/etc/pointercal

    After doing this and executed ts_test then my cursor moves accordingly to the touch positions. But while running QT applications on target , still facing the problem with touch calibration. After searching on internet i have found that i have to export

    export QWS_MOUSE_PROTO=tslib. I have done this also after doing this cursor symbol was also not displayed on the GUI. Anything more to be done to get touchscreen working for QT applications.


    Thanks & Regards,
    N.V.Subbaiah.
  • Hi,

    After calibrating , I can touch almost points correctly.But when I touch some edge points of the touchscreen the weston crash.
    The method of calibration is:
    1.$libinput-list-devides
    Device: myts-ft5x0x
    Kernel: /dev/input/event0
    Group: 3
    Seat: seat0, default
    Capabilities: touch
    Tap-to-click: n/a
    Tap-and-drag: n/a
    Tap drag lock: n/a
    Left-handed: n/a
    Nat.scrolling: n/a
    Middle emulation: n/a
    Calibration: identity matrix
    Scroll methods: none
    Click methods: none
    Disable-w-typing: n/a
    Accel profiles: n/a
    Rotation: n/a
    2.$weston-calibrator
    Calibration values: 1.286611 0.085774 -40.799133 -0.015215 1.211107 19.864624
    3.Add the .rules file in /etc/udev/rules.d/
    $cat /etc/udev/rules.d/touch-calibration.rules
    ATTRS{name}=="myts-ft5x0x", ENV{WL_CALIBRATION}="1.286611 0.085774 -40.799133 -0.015215 1.211107 19.864624"
    4.$/etc/init.d/udev restart

    Using the gdb to debug,I found that:
    #0 0x76d9e9c4 in __GI_raise (sig=5) at ../sysdeps/unix/sysv/linux/raise.c:55
    #1 <signal handler called>
    #2 weston_view_from_global_float (view=0x0, x=-nan(0x7f007c), y=9.18354962e-41, vx=0x7efff658, vy=0x7efff65c) at /usr/src/debug/weston/1.9.0-r0/weston-1.9.0/src/compositor.c:1350
    #3 0x00012468 in weston_view_from_global_fixed (view=<optimized out>, x=<optimized out>, y=y@entry=211820, vx=0x7efff690, vx@entry=0x7efff688, vy=0x7efff694, vy@entry=0x7efff68c)
    at /usr/src/debug/weston/1.9.0-r0/weston-1.9.0/src/compositor.c:1379
    #4 0x00016e28 in default_grab_touch_down (grab=<optimized out>, time=671019, touch_id=0, x=<optimized out>, y=36292) at /usr/src/debug/weston/1.9.0-r0/weston-1.9.0/src/input.c:248
    #5 0x00019988 in notify_touch (seat=<optimized out>, time=time@entry=671019, touch_id=touch_id@entry=0, x=-4092, y=36292, touch_type=touch_type@entry=0) at /usr/src/debug/weston/1.9.0-r0/weston-1.9.0/src/input.c:1582
    #6 0x76c93ef0 in handle_touch_with_coords (libinput_device=libinput_device@entry=0x2b7628, touch_event=0x328f90, touch_type=touch_type@entry=0) at /usr/src/debug/weston/1.9.0-r0/weston-1.9.0/src/libinput-device.c:250
    #7 0x76c94384 in handle_touch_down (touch_event=<optimized out>, device=0x2b7628) at /usr/src/debug/weston/1.9.0-r0/weston-1.9.0/src/libinput-device.c:257
    #8 evdev_device_process_event (event=event@entry=0x328f90) at /usr/src/debug/weston/1.9.0-r0/weston-1.9.0/src/libinput-device.c:320
    #9 0x76c93a6c in process_event (event=0x328f90) at /usr/src/debug/weston/1.9.0-r0/weston-1.9.0/src/libinput-seat.c:161
    #10 process_events (input=<optimized out>) at /usr/src/debug/weston/1.9.0-r0/weston-1.9.0/src/libinput-seat.c:171
    #11 0x76c93d14 in udev_input_dispatch (input=0x33b6c) at /usr/src/debug/weston/1.9.0-r0/weston-1.9.0/src/libinput-seat.c:182
    #12 libinput_source_dispatch (fd=<optimized out>, mask=<optimized out>, data=0x33b6c) at /usr/src/debug/weston/1.9.0-r0/weston-1.9.0/src/libinput-seat.c:192
    #13 0x76fca2e8 in wl_event_loop_dispatch (loop=0x304f0, timeout=timeout@entry=-1) at /usr/src/debug/wayland/1.9.0-r0/wayland-1.9.0/src/event-loop.c:422
    #14 0x76fc8bb4 in wl_display_run (display=display@entry=0x30478) at /usr/src/debug/wayland/1.9.0-r0/wayland-1.9.0/src/wayland-server.c:1004
    #15 0x0000f9c0 in main (argc=1, argv=0x7efffdb4) at /usr/src/debug/weston/1.9.0-r0/weston-1.9.0/src/main.c:818

    So when weston_view_from_global_float() access the view which is null, the weston crash.

    At last I found that after calling transform_absolute(device, &x, &y) which is in libinput's evdev.c,the variable x will change to negative.Then the weston will consider the view is Null.
    Is it the problem of weston-calibrator?
  • Hi,
        
    After calibrating , I can touch almost points correctly.But when I touch some edge points of the touchscreen the weston crash.
    The method of calibration is:
            1.$libinput-list-devides
                Device:           myts-ft5x0x
                Kernel:           /dev/input/event0
                Group:            3
                Seat:             seat0, default
                Capabilities:     touch
                Tap-to-click:     n/a
                Tap-and-drag:     n/a
                Tap drag lock:    n/a
                Left-handed:      n/a
                Nat.scrolling:    n/a
                Middle emulation: n/a
                Calibration:      identity matrix
                Scroll methods:   none
                Click methods:    none
                Disable-w-typing: n/a
                Accel profiles:   n/a
                Rotation:         n/a
            2.$weston-calibrator
               Calibration values:  1.286611 0.085774 -40.799133 -0.015215 1.211107 19.864624
            3.Add the .rules file in /etc/udev/rules.d/
              $cat /etc/udev/rules.d/touch-calibration.rules
                  ATTRS{name}=="myts-ft5x0x", ENV{WL_CALIBRATION}="1.286611 0.085774 -40.799133 -0.015215 1.211107 19.864624"
            4.$/etc/init.d/udev restart

    Using the gdb to debug,I found that:
            #0  0x76d9e9c4 in __GI_raise (sig=5) at ../sysdeps/unix/sysv/linux/raise.c:55
            #1  <signal handler called>
            #2  weston_view_from_global_float (view=0x0, x=-nan(0x7f007c), y=9.18354962e-41, vx=0x7efff658, vy=0x7efff65c) at /usr/src/debug/weston/1.9.0-r0/weston-1.9.0/src/compositor.c:1350
            #3  0x00012468 in weston_view_from_global_fixed (view=<optimized out>, x=<optimized out>, y=y@entry=211820, vx=0x7efff690, vx@entry=0x7efff688, vy=0x7efff694, vy@entry=0x7efff68c)
                at /usr/src/debug/weston/1.9.0-r0/weston-1.9.0/src/compositor.c:1379
            #4  0x00016e28 in default_grab_touch_down (grab=<optimized out>, time=671019, touch_id=0, x=<optimized out>, y=36292) at /usr/src/debug/weston/1.9.0-r0/weston-1.9.0/src/input.c:248
            #5  0x00019988 in notify_touch (seat=<optimized out>, time=time@entry=671019, touch_id=touch_id@entry=0, x=-4092, y=36292, touch_type=touch_type@entry=0) at /usr/src/debug/weston/1.9.0-r0/weston-1.9.0/src/input.c:1582
            #6  0x76c93ef0 in handle_touch_with_coords (libinput_device=libinput_device@entry=0x2b7628, touch_event=0x328f90, touch_type=touch_type@entry=0) at /usr/src/debug/weston/1.9.0-r0/weston-1.9.0/src/libinput-device.c:250
            #7  0x76c94384 in handle_touch_down (touch_event=<optimized out>, device=0x2b7628) at /usr/src/debug/weston/1.9.0-r0/weston-1.9.0/src/libinput-device.c:257
            #8  evdev_device_process_event (event=event@entry=0x328f90) at /usr/src/debug/weston/1.9.0-r0/weston-1.9.0/src/libinput-device.c:320
            #9  0x76c93a6c in process_event (event=0x328f90) at /usr/src/debug/weston/1.9.0-r0/weston-1.9.0/src/libinput-seat.c:161
            #10 process_events (input=<optimized out>) at /usr/src/debug/weston/1.9.0-r0/weston-1.9.0/src/libinput-seat.c:171
            #11 0x76c93d14 in udev_input_dispatch (input=0x33b6c) at /usr/src/debug/weston/1.9.0-r0/weston-1.9.0/src/libinput-seat.c:182
            #12 libinput_source_dispatch (fd=<optimized out>, mask=<optimized out>, data=0x33b6c) at /usr/src/debug/weston/1.9.0-r0/weston-1.9.0/src/libinput-seat.c:192
            #13 0x76fca2e8 in wl_event_loop_dispatch (loop=0x304f0, timeout=timeout@entry=-1) at /usr/src/debug/wayland/1.9.0-r0/wayland-1.9.0/src/event-loop.c:422
            #14 0x76fc8bb4 in wl_display_run (display=display@entry=0x30478) at /usr/src/debug/wayland/1.9.0-r0/wayland-1.9.0/src/wayland-server.c:1004
            #15 0x0000f9c0 in main (argc=1, argv=0x7efffdb4) at /usr/src/debug/weston/1.9.0-r0/weston-1.9.0/src/main.c:818   

    So when weston_view_from_global_float() access the view which is null, the weston crash.
     
    At last I found that after calling transform_absolute(device, &x, &y) which is in libinput's evdev.c,the variable x will change to negative.Then the weston will consider the view is Null.
    Is it the problem of weston-calibrator?

    ThanYou