Touchsupport

  • This addon can be installed from repository or it can be included directly in image (I'm doing this for my images). That's why there is a check if addon exists in /usr. This part is ok.

    But what is not ok is that touchscreen device is not found. You can see empty touchscreen device:. Seems you don't use correct vid or pid.
    Can you run this commands and post al 3 url's you get?

    Code
    pastebinit /sys/class/hidraw/hidraw*/device/uevent
    dmesg | pastebinit
    lsusb -vv | pastebinit

    I forgot how waveshare screens work...

    Edited once, last by vpeter (January 22, 2017 at 2:34 PM).

  • WimPiMedia:~ # pastebinit /sys/class/hidraw/hidraw*/device/uevent
    BVNQ
    WimPiMedia:~ # dmesg | pastebinit
    ISbC
    WimPiMedia:~ # lsusb -vv | pastebinit
    can't get device qualifier: Resource temporarily unavailable
    can't get debug descriptor: Resource temporarily unavailable
    can't get debug descriptor: Resource temporarily unavailable
    can't get debug descriptor: Resource temporarily unavailable
    can't get debug descriptor: Resource temporarily unavailable
    can't get debug descriptor: Resource temporarily unavailable
    can't get device qualifier: Resource temporarily unavailable
    can't get debug descriptor: Resource temporarily unavailable
    VSIG
    [hr]
    EVTEST gives:

    WimPiMedia:~ # evtest
    No device specified, trying to scan all of /dev/input/event*
    Available devices:
    /dev/input/event0: Microsoft Microsoft 3-Button Mouse with IntelliEye(TM)
    /dev/input/event1: HID 046a:0001
    /dev/input/event2: BYZHYYZHY By ZH851
    Select the device event number [0-2]: 2
    Input driver version is 1.0.1
    Input device ID: bus 0x3 vendor 0xeef product 0x5 version 0x110
    Input device name: "BYZHYYZHY By ZH851"
    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 648
    Min 0
    Max 4095
    Event code 1 (ABS_Y)
    Value 705
    Min 0
    Max 4095
    Event code 47 (ABS_MT_SLOT)
    Value 0
    Min 0
    Max 1
    Event code 53 (ABS_MT_POSITION_X)
    Value 0
    Min 0
    Max 4095
    Event code 54 (ABS_MT_POSITION_Y)
    Value 0
    Min 0
    Max 4095
    Event code 57 (ABS_MT_TRACKING_ID)
    Value 0
    Min 0
    Max 65535
    Properties:
    Property type 1 (INPUT_PROP_DIRECT)
    Testing ... (interrupt to exit)
    ***********************************************
    This device is grabbed by another process.
    No events are available to evtest while the
    other grab is active.
    In most cases, this is caused by an X driver,
    try VT-switching and re-run evtest again.
    Run the following command to see processes with
    an open fd on this device
    "fuser -v /dev/input/event2"
    ***********************************************

    Edited once, last by WimAdriaens (January 22, 2017 at 2:43 PM).

  • With evtest you can see that you need to use PRODUCT_PID=0005.

    Run again this 2 commands and post what you get (again).

    Code
    systemctl stop kodi
    ts_calibrate.sh

    After kodi is stopped you can run evtest again and only press short time on top/left, top/right, bottom/right, bottom/left and in center. Maybe I see how this screen works from the output.

    If you have time you can come to irc so we can talk more directly.

  • WimPiMedia:~ # evtest
    No device specified, trying to scan all of /dev/input/event*
    Available devices:
    /dev/input/event0: Microsoft Microsoft 3-Button Mouse with IntelliEye(TM)
    /dev/input/event1: HID 046a:0001
    /dev/input/event2: BYZHYYZHY By ZH851
    Select the device event number [0-2]: 2
    Input driver version is 1.0.1
    Input device ID: bus 0x3 vendor 0xeef product 0x5 version 0x110
    Input device name: "BYZHYYZHY By ZH851"
    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 397
    Min 0
    Max 4095
    Event code 1 (ABS_Y)
    Value 3711
    Min 0
    Max 4095
    Event code 47 (ABS_MT_SLOT)
    Value 0
    Min 0
    Max 1
    Event code 53 (ABS_MT_POSITION_X)
    Value 0
    Min 0
    Max 4095
    Event code 54 (ABS_MT_POSITION_Y)
    Value 0
    Min 0
    Max 4095
    Event code 57 (ABS_MT_TRACKING_ID)
    Value 0
    Min 0
    Max 65535
    Properties:
    Property type 1 (INPUT_PROP_DIRECT)
    Testing ... (interrupt to exit)
    Event: time 1485102062.756399, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 19
    Event: time 1485102062.756399, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 276
    Event: time 1485102062.756399, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 329
    Event: time 1485102062.756399, type 1 (EV_KEY), code 330 (BTN_TOUCH), value 1
    Event: time 1485102062.756399, type 3 (EV_ABS), code 0 (ABS_X), value 276
    Event: time 1485102062.756399, type 3 (EV_ABS), code 1 (ABS_Y), value 329
    Event: time 1485102062.756399, -------------- SYN_REPORT ------------
    Event: time 1485102062.788379, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 272
    Event: time 1485102062.788379, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 330
    Event: time 1485102062.788379, type 3 (EV_ABS), code 0 (ABS_X), value 272
    Event: time 1485102062.788379, type 3 (EV_ABS), code 1 (ABS_Y), value 330
    Event: time 1485102062.788379, -------------- SYN_REPORT ------------
    Event: time 1485102062.820375, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 275
    Event: time 1485102062.820375, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 335
    Event: time 1485102062.820375, type 3 (EV_ABS), code 0 (ABS_X), value 275
    Event: time 1485102062.820375, type 3 (EV_ABS), code 1 (ABS_Y), value 335
    Event: time 1485102062.820375, -------------- SYN_REPORT ------------
    Event: time 1485102062.852371, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value -1
    Event: time 1485102062.852371, type 1 (EV_KEY), code 330 (BTN_TOUCH), value 0
    Event: time 1485102062.852371, -------------- SYN_REPORT ------------
    Event: time 1485102064.260380, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 20
    Event: time 1485102064.260380, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 3767
    Event: time 1485102064.260380, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 429
    Event: time 1485102064.260380, type 1 (EV_KEY), code 330 (BTN_TOUCH), value 1
    Event: time 1485102064.260380, type 3 (EV_ABS), code 0 (ABS_X), value 3767
    Event: time 1485102064.260380, type 3 (EV_ABS), code 1 (ABS_Y), value 429
    Event: time 1485102064.260380, -------------- SYN_REPORT ------------
    Event: time 1485102064.292377, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 431
    Event: time 1485102064.292377, type 3 (EV_ABS), code 1 (ABS_Y), value 431
    Event: time 1485102064.292377, -------------- SYN_REPORT ------------
    Event: time 1485102064.324376, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 3781
    Event: time 1485102064.324376, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 424
    Event: time 1485102064.324376, type 3 (EV_ABS), code 0 (ABS_X), value 3781
    Event: time 1485102064.324376, type 3 (EV_ABS), code 1 (ABS_Y), value 424
    Event: time 1485102064.324376, -------------- SYN_REPORT ------------
    Event: time 1485102064.356372, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value -1
    Event: time 1485102064.356372, type 1 (EV_KEY), code 330 (BTN_TOUCH), value 0
    Event: time 1485102064.356372, -------------- SYN_REPORT ------------
    Event: time 1485102066.612377, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 21
    Event: time 1485102066.612377, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 216
    Event: time 1485102066.612377, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 3871
    Event: time 1485102066.612377, type 1 (EV_KEY), code 330 (BTN_TOUCH), value 1
    Event: time 1485102066.612377, type 3 (EV_ABS), code 0 (ABS_X), value 216
    Event: time 1485102066.612377, type 3 (EV_ABS), code 1 (ABS_Y), value 3871
    Event: time 1485102066.612377, -------------- SYN_REPORT ------------
    Event: time 1485102066.756372, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value -1
    Event: time 1485102066.756372, type 1 (EV_KEY), code 330 (BTN_TOUCH), value 0
    Event: time 1485102066.756372, -------------- SYN_REPORT ------------
    Event: time 1485102067.844378, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 22
    Event: time 1485102067.844378, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 2263
    Event: time 1485102067.844378, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 2062
    Event: time 1485102067.844378, type 1 (EV_KEY), code 330 (BTN_TOUCH), value 1
    Event: time 1485102067.844378, type 3 (EV_ABS), code 0 (ABS_X), value 2263
    Event: time 1485102067.844378, type 3 (EV_ABS), code 1 (ABS_Y), value 2062
    Event: time 1485102067.844378, -------------- SYN_REPORT ------------
    Event: time 1485102067.940378, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 2258
    Event: time 1485102067.940378, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 2067
    Event: time 1485102067.940378, type 3 (EV_ABS), code 0 (ABS_X), value 2258
    Event: time 1485102067.940378, type 3 (EV_ABS), code 1 (ABS_Y), value 2067
    Event: time 1485102067.940378, -------------- SYN_REPORT ------------
    Event: time 1485102068.004372, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value -1
    Event: time 1485102068.004372, type 1 (EV_KEY), code 330 (BTN_TOUCH), value 0
    Event: time 1485102068.004372, -------------- SYN_REPORT ------------
    [hr]
    Touch is doing something anyway. What do you mean with "irc"?
    [hr]
    so, with evtest touch is working.

    when i try to start the touchscreen service manually I get this error:

    systemctl start ts_uinput_touch
    Failed to start ts_uinput_touch.service: Unit ts_uinput_touch.service not found.

    Getting closer every minute

    Edited once, last by WimAdriaens (January 22, 2017 at 4:30 PM).

  • WimPiMedia:~ # systemctl stop kodi
    tsWimPiMedia:~ # ts_calibrate.sh
    touchscreen device: /dev/hidraw2
    Stopping Kodi and touchscreen daemon...
    Failed to stop ts_uinput_touch.service: Unit ts_uinput_touch.service not loaded.
    waveshare raw data len: 25 bytes
    Linear calibration constants: 0 369384 -381300 0 221630 -228780 65536
    xres = 1, yres = 1

    Here it freezes. Touch doesn't give any input.
    I got out with CTRL+C

  • Sorry but I'm out of ideas. Like I wrote I don't have this two devices and managed to run only with the help of few users.
    Seems you will need to figure out this yourself.

  • No worry. I just had a calibration screen in kodi once. But the picture was too small and touch didn't workas expected. After reboot I can do the calibration once again but only once after every reboot.
    You already helped me a lot just by asking the right questions.
    If I find out how to get it working, I'll send you a copy of my project.

    Edited once, last by WimAdriaens (January 22, 2017 at 6:41 PM).

  • I started all over again and came up with the same problems.

    But apparently it has something to do with how the touchscreen is made. Mine has a resistive touchpad that works as a mouse. So I'm pretty sure anything we tried was going in the wrong direction. When loading a brand new Jessie Raspbian the touch works almost out-of the box. But I need to configure things in a "99-calibration.conf" file.
    Also, the touchscreen gives data through /dev/input/event2 and not "hidraw2" as I always thought.

    Has anyone any new thoughts about this? The combination of a small touchscreen and a kodi-based mediaplayer is definitely worth the effort. Unfortunately I don't have the right development knowledge to figure out the bits and pieces...

  • I think I missed this /dev/input/event2.

    In this case don't use ts_env.sh-waveshare but instead ts_env.sh-sample and copy it to ts_env.sh. Inside change line TOUCHSCREEN_NAME which needs to be

    Code
    TOUCHSCREEN_NAME="BYZHYYZHY By ZH851"


    As you can see BYZHYYZHY By ZH851 is device name from evtest.

    Also don't use ts.conf-waveshare file but instead ts.conf-generic and copy it to ts.conf.

    Maybe after reboot calibration from kodi will just work. And everything else.

    Edited once, last by vpeter (January 23, 2017 at 7:04 PM).

  • Hi vpeter, I use the following shortened (because of #133) Version of post #11.

    Can you please check, if I have shortened to much, because tslib ist not working anymore. And tslib plugin is not availabe in addons.

    Thank you!



    A) Preparing for Cross-Compiling:

    - Open a 'Terminal'

    Code
    git clone https://github.com/LibreELEC/LibreELEC.tv.git

    Now the source code files were copied to your home folder

    - Move into the source code directory

    Code
    [code]
    cd ~/LibreELEC.tv


    [/code]

    - Choose the version (Branch/Tag) of LibreELEC to Cross-Compile

    Code
    git checkout 7.95.1

    -> The possible versions of LibreELEC you can checkout are available on Github --> here
    I chose the latest stable version 7.95.1


    B) Cross-Compile a clean build to check possible errors:

    Code
    PROJECT=RPi2 ARCH=arm make image

    C) In this step we intergate the 'tslib' from vpeter into LibreELEC to get egalax touchscreen support:

    -> Open the file http://LibreELEC.tv/packages/linux/package.mk

    - Change the line:

    Code
    PKG_DEPENDS_TARGET="toolchain cpio:host kmod:host pciutils xz:host wireless-regdb keyutils"

    to

    Code
    PKG_DEPENDS_TARGET="toolchain cpio:host kmod:host pciutils xz:host wireless-regdb keyutils tslib"

    -> Safe the file and exit

    D) Changing kernel configuration (linux.arm.conf) to enable egalax touch support.

    - Open the file http://LibreELEC.tv/projects/RPi2/linux/linux.arm.conf
    - To enable egalax touchscreen support to your kernel you have to uncomment and set to yes the following lines:

    Code
    CONFIG_INPUT_TOUCHSCREEN=y
    CONFIG_TOUCHSCREEN_USB_COMPOSITE=y
    CONFIG_TOUCHSCREEN_USB_EGALAX=y
    CONFIG_TOUCHSCREEN_USB_GENERAL_TOUCH=y
    CONFIG_HID_MULTITOUCH=y

    -> Safe the file and exit


    E) Cross-Compiling LibreELEC for Raspberry PI 2/3 with tslib integration and egalax touchscreen support from kernel:

    - Go to LibreELEC.tv folder and delete the 'target' folder from the test building process before.
    - Open a 'Terminal'

    Code
    cd ~/LibreELEC.tv
    Code
    PROJECT=RPi2 ARCH=arm make image


    -> This second Cross-Compiling process should just take ca 10-15 minutes
    -> Now you can find your image with egalax touchscreen support in the target folder --> http://LibreELEC.tv/target

  • Step B is not need to execute - final image will be build at the end.
    Step C is not needed - touchscreen addon is available from Libreelec kodi repository.
    Some parts in step D) are already enabled.

    Maybe official image would work just fine with touchcreens and no need to build it manually? Only addon must be installed.

  • Hi,

    With beta 1 one my Waveshare touchscreen (5inch HDMI LCD - Waveshare Wiki) connected to a RPI3 was working out of the box with the touchscreen add-on.

    With beta 2 the touchscreen does not work any longer

    Testing the touchscreen with evtest show no reaction.

    Any ideas what has changed with beta 2 compared to beta 1 (after downgrading to beta1 the touchscreen works again)?

    Thank you in advance!

  • kwm, I don't see anything related between versions.
    When you tested with evtest did you close kodi and touch daemon?

    Code
    systemctl stop kodi
    systemctl stop service.touchscreen