Touchsupport

  • So, the waveshare thing is working.

    Next challenge in this story: do the same with the adafruit pitft 2.8" resistive touchscreen. It's GPIO connected instead of HDMI.

    Any suggestions where I do start on this?

  • Hi,

    I do not know what went wrong yesterday night but I suppose that /dev/input/event.... (BYZHYYZHY By ZH851) did change.

    Did the upgrade once again tonight and now the touch screen works again.

    Sorry for the inconvenience.


  • What kind of driver does it need? Any example/tutorial how to set it up on some other distro?

    It's a widely used PiTFT plus version. The drivers are build in in the latest raspbian version.

    But for some reason Kodi always forces to HDMI display. I already got the display at work for various other applications but can't figure out how to get Kodi forced to use this display.

    Here's the procedure for installing the drivers if not yet in the package.
    Overview | Adafruit PiTFT - 2.8" Touchscreen Display for Raspberry Pi | Adafruit Learning System

    Edited once, last by WimAdriaens (February 7, 2017 at 8:05 AM).

  • It's a widely used PiTFT plus version. The drivers are build in in the latest raspbian version.

    But for some reason Kodi always forces to HDMI display. I already got the display at work for various other applications but can't figure out how to get Kodi forced to use this display.

    Here's the procedure for installing the drivers if not yet in the package.
    Overview | Adafruit PiTFT - 2.8" Touchscreen Display for Raspberry Pi | Adafruit Learning System

    Seems extra work to get it running - got this response from one dev. Seems you are out of luck with easy solution.

    Quote


    To get kodi UI or video you need something like fbcp (GitHub - tasanakorn/rpi-fbcp: Raspberry Pi utility. Used for mirror primary framebuffer to secondary framebuffer.) running which copies pixels to display. Due to the copies and limited speed of SPI the update rate is limited (probably about 10 fps) so it's not very useful for Kodi.

  • Hi vpeter,
    Thanks for all the work you and others are putting into this area. For me, touch is a must have as I hate keyboards lol.

    I have touch working via the installation of your addon from the repo, done the manual file editing/creation, and have configured it via the configuration addon it provides.
    The issue I'm having is that the touch position is correct in the top left but the closer I get to the bottom right it is out as in thinks I'm touching further down and to the right, significantly.
    I am think that its because the configurator is not reading the correct resolution.
    I use a res of 1920x1200 (16:10)
    The configurator detects it as follows:
    resolution : 1728x1080
    skin : 1280x720

    I think if I could override these values on the configurator screen, it would be fine. Thoughts?


  • I use a res of 1920x1200 (16:10)
    The configurator detects it as follows:
    resolution : 1728x1080
    skin : 1280x720

    In this case open file ts_env.sh and uncomment lines TSLIB_RES_X/Y and fill correct value. I think this should help.

    Code
    export TSLIB_RES_X=1920
    export TSLIB_RES_Y=1200
  • In this case open file ts_env.sh and uncomment lines TSLIB_RES_X/Y and fill correct value. I think this should help.

    Code
    export TSLIB_RES_X=1920
    export TSLIB_RES_Y=1200

    Thank you for the reply.

    I have already tried that to no avail. From what I can tell, self.getwidth() and height respectively are not returning the correct values or they are be manipulated to show the wrong result.... I'm working through it but 4 eyes are better than 2 :)

    Ps. I have a basic background in coding so I'm happy to fiddle so long as you happy for me to..... Just thought that you knowing the code, you might think of something on the spot.....

  • Ok. I will try it again and post results.
    [hr]
    ok

    Changed values for x and y resolutions and made sure they were uncommented.
    Still showing up in touchscreen add on as 1728x1080 with same result from calibration.

    I will look further into this.... even if its manually setting the pointercal file...lol
    [hr]
    Ok, got it sorted for the moment by changing the res to what is displayed by the calibrator.....
    Still not 100% but close enough to fiddle....

    Edited once, last by DonCorleon (February 9, 2017 at 10:48 AM).

  • Hello, I would love to buy me a touchscreen and run it with kodi. I'm thinking of an "23 or "27 by Hannspree. After reading the forum I understand this: Touchscreen support is possible, but it's a bit tricky. It is supported by Kodi Krypton but it must be supported by the OS in the first place. So there is touchscreen support if you have tslib installed. What I don't know is if tslib is by now a library that comes with every linux distribution. Or do I have to install it?

    I've taken a look at vPeters application, but I don't know how to compile things. If I can't compile this app will I still be able to successfully plug a touchscreen screen to a RPi 3 running LibreELEC?

    Edited once, last by qwert (February 19, 2017 at 12:47 PM).

  • Hi DonCorleon / Vpeter
    First i say thanks for the georgeous work that you have do.

    I have the same problem.
    Set up my Rpi B + with a LibreElec 17 (8.0.1). I have added all the necessary services and finally I made the plugin work ... but I have the same problem of you ... my resolution is 848x480, but the skin shows 1280x720, I do not know why ... I really appreciate if you can explain me, how i can configure the pointercal file, i think that is the solution, because i uncomment the lines in the ts_env.sh file and doesn't work for me
    Thanks any help you can give me ...

    Edited once, last by hengemann (March 30, 2017 at 6:20 PM).

  • I newer wrote pointercal manually. Setting TSLIB_RES_X/Y should help even if kodi doesn't show correct resolution.

    One other option is to calibrate in console with command

    Code
    ts_calibrate.sh


    It closes kodi and shows calibration screen from tslib library.

  • This work with comand

    Code
    ts_calibrate


    this stop kodi and give the option to calibrate the screen, i select the values for top left, top right, bottom right and bottom left, finally center and show me this value

    but without results in kodi....
    i try modified this values that i think as saved in the pointercal file

    i really appreciate if do you have any idea... thanks a lot for your work

    Edited once, last by hengemann (March 29, 2017 at 10:05 PM).

  • Sorry but if this doesn't work I'm out of ideas. I have only one touchscreen and didn't have such problems.

    You can stop kodi and use evtest on ts_uinput_touch device to see what data you get. This is what kodi sees it.

    Code
    systemctl stop kodi
    evtest

    Edited once, last by vpeter (March 30, 2017 at 8:06 AM).

  • I finally did THIS!!!.... i really excited, because it was a lot of work... but this worked!!

    finally, i installed the plugin touchscreen that i understand is the same that you do Vpeter but this is official...
    i do this worked and generate the file pointercal, the plugin saved this file in this path

    Code
    .storage/.kodi/usserdata/addons/service.touchscreen/pointercal

    in this file save the parameters for the touchscreen in this order

    Code
    xscale --> is the "size" where the touch is moving in the x axe
    xymix --> i don't know for what is usefull this value
    xoffset --> is when far is the cursor for the touch in the x axe
    yxix --> i don't know for what is usefull this value
    yscale --> is the "size" where the touch is moving in the y axe
    yoffset -->is when far is the cursor for the touch in the y axe
    scaler --> is a factor 65536, dont change this value
    xt --> resolution x, in my case 848
    yt --> resolution y, in my case 480


    how tip, in this file the values are factors... for this reason are values with sense. i suggest change for increment o decrement notorius for can you see a tendence and adjust this...

    Edited once, last by hengemann (April 2, 2017 at 3:20 AM).

  • You could also use kodi's build-in touchscreen calibration functionality if you had so much problems with mine addon. And yes, now that there is available I don't build it anymore.

    Edited once, last by vpeter (April 2, 2017 at 7:04 AM).