Saturday, August 31, 2013

OpenElec with support for eGalax touch screen

Hi!

Lately I have tested OpenElec for Raspberry PI and found out that it is very very fast, very very small and also it has some great addons(wifi, bluetooth and more).
Speed/size features on an 512MB RaspberryPI:
  - a complete boot is less than 25 seconds
  - cpu is around 30% load
  - memory used is 32%
  - total system size is less than 300MB

Edit. You can download my build from here(contains eGalax module and XBMC patches).
Username is root and password is openelec. The touch screen calibration file should be put in /storage/touchscreen_axes_calib.

Next, I will guide you through the instructions for building(cross compile) latest OpenElec  for Raspberry PI with touch screen support.
For this tutorial let's assume that you have a Linux machine where you will work.

1. Get the latest OpenElec.
git clone git://github.com/OpenELEC/OpenELEC.tv.git

2. Add kernel touch screen module support.
Open the file OpenELEC.tv/projects/RPI/linux/linux.arm.conf and search for "CONFIG_INPUT_TOUCHSCREEN". Replace the whole text line with the following lines:
CONFIG_INPUT_TOUCHSCREEN=y
CONFIG_TOUCHSCREEN_USB_COMPOSITE=y
CONFIG_TOUCHSCREEN_USB_EGALAX=y
3. Fix ppl version in OpenElec.
Open the file OpenELEC.tv/packages/toolchain/math/ppl/meta and change PKG_VERSION from "1.1pre9" to "1.1pre10"

4. Put touch screen calibration file into the system.
Navigate to folder OpenELEC.tv/projects/RPI/ and create the file usr/share/eGalaxCalibration/touchscreen_axes_calib. This file should have the following contents:
calib_x_d=-21;calib_x_fact=0.658097686;calib_y_d=-50;calib_y_fact=0.408626561;swap_axes=0;click_confines=8
To set up these values please visit this post(at section 4).
This step is not needed any more, because you can use the calibration addon to calibrate your screen.
Get the calibration addon from my Downloads folder and put it in /storage/.xbmc/addons/

5. Put XBMC 12.3 patch.
Get my latest patches from here and put them in the folder OpenELEC.tv/packages/mediacenter/xbmc/patches/

6. Build OpenElec.
Navigate to OpenElec folder and type:
PROJECT=RPi ARCH=arm make -j3
-j3 option is to use parallel build(if you have more than one cpu's set this number as nb_cpus+1). This option will speed up the build process.
The build process will take couple of hours, but you have to come back once(in the first 10 minutes) and press ENTER for the kernel touch screen modifications to be approved.

7. Install or Update your OpenElec card.
Go to OpenElec build instructions page for RPI and follow the "Install instructions" chapter.

Have fun!

90 comments:

  1. Since I got your other image working. I have to try to compile this and see what it can do. Love your work!

    ReplyDelete
  2. Hi Andrei, i tried to follow your lines, but i have an error Make *** Error 129 ...
    Is it possible to publish the sompiled source ?
    Regards and nice jobs ;)

    ReplyDelete
    Replies
    1. Hi!

      I have uploaded the full image. Please give me your full error messages, maybe I can help you.
      The compiled sources are pretty big.

      Delete
  3. Hi Andrei, thanks for sharing this.

    I have a problem but it is not quite related with this tutorial.
    I bought one Lilliput 7" screen that has an eGalax touch. With raspbian, it worked out of the box, except that the touchscreen is not calibrated. Then, following one other tutorial of you, I installed the xinput_calibrator but it can't calibrate because my axes are inverted, so it always "misclick". Then, I tried to put some values manually and ended up getting close but not good yet. The values I set on my xinput file are:
    Section "InputClass"
    Identifier "calibration"
    MatchProduct "eGalax Inc. USB TouchController"
    Option "Calibration" "121 1917 317 1741"
    Option "SwapAxes" "1"
    EndSection

    But this is still not good. Although the axes are not inverted, the point is not even close from where I put my finger. I have no idea how to solve this.

    So, my questions are the following:
    1. Do I need to install other driver for eGalax? (since I didn't install anything, Raspbian recognized it)
    2. Is there another way to calibrate it? (I'm not gonna use it with XBMC)

    Please help me, I'm already getting crazy with this!

    Thank you very much and best regards,

    Sergio Soares (Brazil)

    ReplyDelete
    Replies
    1. Hi Andrei,

      I managed to make it work well (not ideal yet). I followed the instructions provided by "aragats" in this forum post: http://www.raspberrypi.org/phpBB3/viewtopic.php?f=41&t=8983&sid=3aa519227d00f0f9d7537e6b9fc7e300&start=25

      First I changed my resolution to 720x480, then I changed my xinput_calibrator file with values similar to these ones:
      Section "InputClass"
      Identifier "calibration"
      MatchProduct "eGalax Inc. USB TouchController"
      Option "Calibration" "79 4012 3895 262"
      Option "SwapAxes" "1"
      EndSection

      Now everything is fine! Thanks.

      Sergio Soares.

      Delete
  4. What is the password, thank you.

    ReplyDelete
    Replies
    1. username: root
      password: openelec

      Delete
    2. Sorry, I see it just above the text. Besides, I can not einlogen me anyway. It just does not work.

      I have the Pi rev. 2 with 512 RAM, why openelec shows only 119MB RAM?

      Delete
    3. Hi!

      Please try to build your own image on your PC. and send me the logs if there are any errors.

      Delete
  5. This is awesome! So I'm really new to all this would I just build this in Linux, if so what distro are you using? You have done exactly what I want to do with my raspberry Pi... I'm also looking to get into developing for it, do you have any pointers on where to start? I know quite a a bit of programming just never really know where to start.

    ReplyDelete
    Replies
    1. Hi!

      I am using Ubuntu for cross compilation and Raspbian Wheezy for Raspberry PI.
      If you want to get into development, I would suggest you to start with some simple C tutorials and also makefile tutorials. You can run them into Raspberry PI. After getting familiar with how things are connecting, ou should start thinking of a complex program and start working on it.
      Good luck!

      Delete
  6. hi. awesome post. how can i use those lines for other brands of touch screen? which model of egalax touch screen are you using? thanks.

    ReplyDelete
    Replies
    1. I don't understand what do you mean by "those lines".
      This eGalax controller I am using, from eBay, should work for every resistive 4 wire touch screen film.

      Delete
  7. Hello. your posted build is working fine like a charm. But i have one big problem, due to the read-only system. I CAN NOT CHANGE THE "eGalaxCalibration/touchscreen_axes_calib" file.

    I have a 8 inch touchscreen and now the x/y is off. i followed the next link about the mathematics. but there is a big initial problem: I CAN NOT CHANGE THE "eGalaxCalibration/touchscreen_axes_calib" file.

    CAN YOU RECOMPILE THIS IMAGE FOR MY 8 inch LCD. Touch working fine so far.... only x/y are offset.
    I HAVE NO LINUX MASCHINE AVAILABLE AND I AM A LINUX NOOB.

    My LCD Data:
    Resolution 1024x768
    Physical: 1620 mm x 1220 mm

    With a big help shout

    Stefan

    ReplyDelete
    Replies
    1. Can you @ least do this build with Write enabled so i can fix the values myself???

      Delete
    2. Hi Stefan!

      The problem is that the squash filesystem is read only.
      Only the home folder can be written by the user. I will recompile my image and change the eGalax folder to be in the home folder, so you can change it as you like.

      Best Regards,
      Andrei

      Delete
    3. Wow. Perfect!
      Do these changes apply to system? would be useless otherwise.

      BIIIIG thanks :)

      Delete
    4. The system will always be read only. Only /storage can be written. I have compiled it last night but when I tried to run it on a RPI 512MB I got a kernel panic error. I will try to change the settings in the kernel and recompile it.

      Regards,
      Andrei

      Delete
  8. only a suggestion: isn´t it possible to put the egalax files on /storage. and leaving a "link" in the kernel that promotes the new path of the egalax files (/storage)? sorry i am not that advanced with unix, just a thought.

    Anyways, thanks for your effort and i am really looking forward to get this working in my car. all pasrts are here :)

    Peace and Love!

    Stefan

    ReplyDelete
    Replies
    1. Hi!

      I have rebuild OpenElec last night with eGalax patch. I changed the touch screen calibration path to /storage/touchscreen_axes_calib which is a user writable location. I have updated the download link from the begining of the post.

      Regards,
      Andrei

      Delete
  9. Hello out there!

    i had the same problems as you too, Stefan. My eGalax wasnt calibrated in the right way. But with a short search on google I found a very interesting post. Maybe this will help you, as it did to me. :-)

    I like the fact, that the filesystem is readonly, u cant destroy it as easy as usual... :-) with this little trick, I can do my changes and everything works fine and save! HTH.

    https://sites.google.com/site/andreierdei/openelec-addons/squashfs-howto

    @Andrei, I love the fact, that the Airplay works just great with your lastet openelec build! With the older Image from August I had my Problems, but your choice to switch to openelec was the right one, well at least for me! :-) I promised you that I will tell you about the airplay-function some weeks ago: And now, the Airplay works great and not quite a bit laggy with iTunes on Windows, on my iPad-Mini and my iPhone 5. :-)

    Greetings,
    Knut

    ReplyDelete
    Replies
    1. Whops, i made a little mistake here... The documentation u need is the following:

      http://wiki.openelec.tv/index.php?title=Mksquashfs_Add-on_how-to

      There is the descritption on how the addon "should" work. But unfortunately it doesnt! Not out of the box...
      MY steps where the following:
      * Download the zip.file that inherits the addon for openELEC:
      http://addons.anxer.ro/2.1/RPi/arm/shell.squashfs-tools.mksquashfs/shell.squashfs-tools.mksquashfs-2.1.1.zip
      * Next, just use the openELEC onboard-script to install this, e.g. from a local NAS, like I did (over SMB, was the easiest way...)
      * After reboot you can follow the documentation, until you get to the point where it says "Now you can make your changes"... After you did your changes, you need to fix the addon itself, otherwise you wont be able to run the pack_SYSTEM-script.
      * First: Fix the config-Path in "/storage/.xbmc/addons/shell.squashfs-tools.mksquashfs/bin/mksquashfs" The path there doesnt point to the path as I just mentioned. It shows:
      "shell.squashfs-tools/mksquashfs"
      but it used to show
      "shell.squashfs-tools.mksquashfs"
      * After that u have to replace the old, broken lib "liblzma.so.5" with the newer version "...*5.0.4". The 5-ish file is just broken, at least on my download... :-) Luckily both of these libs are in the "/storage/.xbmc/addons/shell.squashfs-tools.mksquashfs/lib/"-directory.
      * Last but not least you have to "mkdir /storage/update" so that the script works properly!

      With these small fixes i was able to run the pack_SYSTEM-script. But that took so long... >.<

      HTH2 :-)

      Greetz,
      Knut

      Delete
    2. Hi Knut!

      Thanks for the great information. I have also did a new build with the latest OpenElec and changeed the path for touchscreen_axes_calib file which is now in /storage/.

      Regards,
      Andrei

      Delete
    3. Ok, so far so well.

      It is working. And it is really a fun way now, to manipulate the values and having it tested. Really nice work and i am really thankfull!!!

      But there is a new problem: THE AXES ARE INVERTED (not swapped) and i have a problem to fix this in the egalax config file.
      as far as i know you can swap the axes but not invert them. (i read the posts above)

      may i ask of this small fix and everything is perfect!
      (my lcd does support axe-mirroring so i can still use inverted axes, but i have to display the lcd upside/down.... that´s a bit nasty)
      Thank you for your great effort, its priceless and i honor you :)

      Delete
    4. Hi!

      Great. By tweaking the values from the calibration file you can obtain any behaviour for the pointer movement regarding your finger. Now, to invert X axis, for example you have to multiply calib_x_fact with -1 and set calib_x_d equal to the screen width - some experimental displacement.
      For example, in my case I have calib_x_d=-21;calib_x_fact=0.658097686 in my calib file and a width of the screen equal to 1280. So if I want to invert X movement I have to set following values:
      calib_x_d=1301;calib_x_fact=-0.658097686
      calib_x_d = 1280 - (-21)
      For Y you have to do the same as for X.

      Regards,
      Andrei

      Delete
    5. OK, i used your exact values for testing purpose.

      it did not invert my axes, even if i place a minus before the axes, or the factor. tried both.

      what is the next solution?
      any more suggestions?

      Delete
    6. You meant that you placed a minus in front of the axes, but, as I said in the previous post, you also have to set calib_x_d to a new value (in my case I have to put 1301 instead of -21).
      Add me on Gtalk, YM or Skype please.

      Delete
  10. What about fm radio ? How to add channels and stuff. Not really fuased about navit but being able to create a wifi ap and have fmvia a fm isb dongle

    ReplyDelete
    Replies
    1. Chris, I have made some tests with ADS Instant FM usb radio based on si470x but the sound via usb is not good at all on RPI(on Ubuntu works great).
      So, I have ordered a si470x i2c device wih external audio output and I am planning to create an XBMC addon to control the radio module and to display info about Channel, freq, song name.
      I am waiting to receive the package.
      I will post as soon as I will have this ready.

      Delete
    2. Kool would a usn sound card produce a better quality or is that just as bad. I been thinking about doing this with xbmc as well but stopped when I wasn't sure of fm hardware. Maybe we could modify the built in muaic s,ection of xbmc to tthe radio app.
      Cool project and progress by the way

      Delete
  11. I found the si470x i2c module looks kool. Can this be hooked directly to the pis gpio pins for commands instead of the optional joystick

    ReplyDelete
    Replies
    1. This radio module should be connected directly to the RPI GPIO's: two for I2C one for ground and the other for power +.

      Delete
  12. hi andrei,

    i am using ur build, with my calibration file, all is working fine, except the wlan.
    i got an IP, but the ping isnt successfull, neither the ssh over wlan.
    a wired connection is successfull.

    the crazy thing: it discovers the upnp of fritzbox, but not my raspi-server dlna server or smb shares...

    over wired connection all is fine.

    why i cant ssh over wlan?
    why the pinging doesnt work?

    there must be a problem with wlan.

    adapter is edimax nano

    ReplyDelete
    Replies
    1. Hi!

      Please use my latest image, if you haven't done yet. I don't know what to say more than this, I also have Edimax dongle and wifi is working and also airplay and ssh(I just have to set up /etc/network/interfaces with my SSID and password).

      Delete
    2. hi again,

      i used the openelec menu to set up the wlan.
      i wonder because, it got an ip but i cant ping and ssh.

      the folder /etc/network/interfaces isnt there.


      OpenELEC:~ # cd /etc/
      OpenELEC:/etc # ls
      LCDd.conf ld.so.preload rc_keymaps
      arch lirc rc_maps.cfg
      avahi localtime release
      build machine-id resolv.conf
      connman mke2fs.conf rpc
      dbus-1 modprobe.d samba
      distribution modules sensors3.conf
      eventlircd.d modules-load.d services
      fonts moduli shadow
      fstab motd ssh_config
      gai.conf mtab sshd_config
      gitrev netconfig suspend-modules.conf
      group nsswitch.conf sysctl.d
      host.conf openelec-release systemd
      hostname passwd tmpfiles.d
      hosts pki udev
      httpd.conf profile udevil
      inputrc profile.d version
      issue protocols xdg

      Delete
    3. i reinstalled your image from 15. october and nothing changed, i still get an ip, but no ping, no ssh, no real connection but the connection manager of openelec says connected ....

      Delete
    4. when i put the cable in, then i can ping both ip adresses, the wlan0 and the eth0 adress.

      without wire same problem like above

      Delete
    5. Hi!

      Ok, so you are talking about the OpenElec image. I haven't tested wifi on it.
      It seems that there is a bug with this, but I haven't modified anything, just added touch support.
      Maybe some kernel modules are missing?!
      You can install a working OpenElec from their website and then get the kernel configuration using: zcat /proc/config.gz > config. After this, you can use meld to see the difference between this config file and the one from OpenElec.tv git: OpenElec.tv/projects/RPI/linux/linux.arm.conf and update it with the new modules. After this you will have to build OpenElec on your PC.

      Regards,
      Andrei

      Delete
  13. Hi Andrei:
    Thanks for sharing ! I've installed your latest image but I have the inverted axis on XBMC. The problem is that XBMC starts automatically and I'm unable to exit to the application. Ctl-Alt-Bkspace won't do the trick. The exit button in XBMC reboots the box. There's any shortcut to kill Xbmc and return to the X desktop ? Thanks , Helio.

    ReplyDelete
    Replies
    1. Hi Helio!

      You can use ssh to connect to it from your computer.
      You can also switch to the Confluence skin and press Exit in the Home screen.

      Delete
  14. It didn't create the folder: usr/share/eGalaxCalibration/touchscreen_axes_calib
    And I can't create it, everytime I try to mkdir I got read-only file system....

    Can you help me please?

    ReplyDelete
    Replies
    1. Hi!

      The filesystem for OpenElec is read only. The user partition, /storage is writable. I have changed the calibration file to /storage/touchscreen_axes_calib for the OpenElec build.

      Delete
  15. hi!
    how can i add egalax touchscreen support to my intel x64 build?
    Linux HTPC 3.10.20 #1 SMP Tue Nov 26 15:29:40 CET 2013 x86_64 GNU/Linux
    OpenELEC (official) - Version: 3.2.4
    Bus 003 Device 008: ID 0eef:0001 D-WAV Scientific Co., Ltd eGalax TouchScreen

    ReplyDelete
  16. Hi Andrei,

    Thanks for your post, very helpful.
    I write after read a lot of comment's without success.

    I use your compiled Openelec/Xbmc because i don't have any ubuntu VM to compile !
    Xbmc work's fine, the Touchscreen too.

    But the Touch ... Arrrrrrrrggg !
    Without any configuration, the touch work, but not with good calibration.
    So i create a touchscreen_axes_calib under /storage.
    But when i have no file i can move the mouse with my finger, with bad calibration
    And with the file, i can't find anymore my mouse.

    I have try your raspbian to get the "touch panel physical size frame" and configure the touchscreen_axes_calib but i can't make it works fine.

    So :
    Can i find anywhere the default touchscreen_axes_calib configuration ?
    Did you put any log writing on your code to follow the touch/mouse position ?

    Thanks for your help.
    Matt

    ReplyDelete
    Replies
    1. Hi Matt!

      I am glad I can help a bit:)
      Now, In the image downloaded from this post, the touchscreen_axes_calib file should already be in /storage/ if I remember corectly(I haven't used it in couple of months).
      If it is not, then putting the same file from a wheezy working xbmc version will work as well.
      Now, if you want to put the default values, you need to know your xbmc screen width and height. After this, you have to set the file like this:
      calib_x_d=, calib_y_d=, calib_x_fact=calib_y_fact=1
      I suggest you to use the formulas from the step 4 in the folowing post:
      http://www.engineering-diy.blogspot.ro/2013/02/raspberry-pi-raspbian-xbmc-and-egalax-7.html
      If you don't succeed please contact me directly on Gtalk, Skype or YM.

      Andrei

      Delete
  17. hi,

    can i build the latest git version with this tutorial?

    thx

    ReplyDelete
    Replies
    1. ill get this:

      patching file xbmc/windows/GUIWindowSystemInfo.cpp
      APPLY PATCH (common) /home/dev/test/OpenELEC.tv/packages/mediacenter/xbmc/patches/xbmc-300-eGalaxPatch.patch
      patching file xbmc/input/linux/LinuxInputDevices.cpp
      Hunk #1 succeeded at 274 (offset -43 lines).
      Hunk #2 succeeded at 498 (offset -47 lines).
      Hunk #3 succeeded at 655 (offset -43 lines).
      patching file xbmc/input/MouseStat.cpp
      Hunk #1 FAILED at 20.
      Hunk #2 succeeded at 49 (offset 11 lines).
      Hunk #3 succeeded at 149 (offset 11 lines).
      1 out of 3 hunks FAILED -- saving rejects to file xbmc/input/MouseStat.cpp.rej
      patching file xbmc/input/MouseStat.h
      Hunk #1 succeeded at 125 (offset 2 lines).
      make: *** [system] Fehler 1

      Delete
    2. I think the latest openelec code has xbmc 12.3. My patches are obly for 12.0 and 12.2. I will try to build 12.3 and update the patches. Until then, you can put the code manually.

      Delete
  18. Great project Andrei, I am trying to follow it. I have got the above working fairly easily, how do I add navit and your new features? I am completely new to openelec, but know linux well.

    ReplyDelete
  19. Hi, is it possible to acces gpio as output to control relays from openelec?
    Also is it possible to run webiopi from openelec?

    ReplyDelete
  20. This comment has been removed by the author.

    ReplyDelete
  21. Hello,

    I would like to know how to invert the x axe (not swap axes) because I have add or delete the - in front of the calib_x_d value but it does not change anything

    Thnaks per advance for your answer

    ReplyDelete
    Replies
    1. The answer of your question you can find above at October 17 / 18. Look at the dialogue between schanze 1 and Andrei. Because I'm 'not good' in math I'd to do many tries and errors. But step by step I got it: now the pointer is there where my finger is. Wonderful!

      Delete
  22. Have you rebuilt your patch file for the newest version of OpenELEC? I am trying to get the touchscreen working but I am also getting an error when I add the patch file.

    patching file xbmc/windows/GUIWindowSystemInfo.cpp
    APPLY PATCH (common) /home/dev/test/OpenELEC.tv/packages/mediacenter/xbmc/patches/xbmc-300-eGalaxPatch.patch
    patching file xbmc/input/linux/LinuxInputDevices.cpp
    Hunk #1 succeeded at 274 (offset -43 lines).
    Hunk #2 succeeded at 498 (offset -47 lines).
    Hunk #3 succeeded at 655 (offset -43 lines).
    patching file xbmc/input/MouseStat.cpp
    Hunk #1 FAILED at 20.
    Hunk #2 succeeded at 49 (offset 11 lines).
    Hunk #3 succeeded at 149 (offset 11 lines).
    1 out of 3 hunks FAILED -- saving rejects to file xbmc/input/MouseStat.cpp.rej
    patching file xbmc/input/MouseStat.h
    Hunk #1 succeeded at 125 (offset 2 lines).
    make: *** [system] Fehler 1

    I've never manually added patches before, so I was hoping you had the patch completed. Thanks.

    ReplyDelete
  23. Okay, I applied the changes myself, but now I am getting this error when I build:

    MouseStat.cpp: In member function 'void CMouseStat::HandleEvent(XBMC_Event&)':
    MouseStat.cpp:232:31: error: qualified-id in declaration before '(' token
    void CMouseStat::SetResolution(int maxX, int maxY, float speedX, float speedY)
    ^
    MouseStat.cpp:242:27: error: qualified-id in declaration before '(' token
    void CMouseStat::SetActive(bool active /*=true*/)
    ^
    MouseStat.cpp:254:26: error: qualified-id in declaration before '(' token
    bool CMouseStat::IsActive()
    ^
    MouseStat.cpp:261:28: error: qualified-id in declaration before '(' token
    void CMouseStat::SetEnabled(bool enabled)
    ^
    MouseStat.cpp:268:27: error: qualified-id in declaration before '(' token
    bool CMouseStat::IsEnabled() const
    ^
    MouseStat.cpp:273:36: error: qualified-id in declaration before '(' token
    bool CMouseStat::MovedPastThreshold() const
    ^
    MouseStat.cpp:278:31: error: qualified-id in declaration before '(' token
    uint32_t CMouseStat::GetAction() const
    ^
    MouseStat.cpp:283:24: error: qualified-id in declaration before '(' token
    int CMouseStat::GetHold(int ButtonID) const
    ^
    MouseStat.cpp:373:1: error: expected '}' at end of input
    }
    ^
    ../../Makefile.include:95: recipe for target 'MouseStat.o' failed
    make[2]: *** [MouseStat.o] Error 1
    make[2]: Leaving directory '/home/roberts/rpi-images/OpenELEC/OpenELEC.tv/build.OpenELEC-RPi.arm-devel/xbmc-13-84725b0/xbmc/input'
    Makefile:507: recipe for target 'xbmc/input/input.a' failed
    make[1]: *** [xbmc/input/input.a] Error 2
    make[1]: *** Waiting for unfinished jobs....

    Here is my MouseStat.cpp (http://pastebin.com/UPPvezk2)

    ReplyDelete
    Replies
    1. Hi William,
      Have you used my latest patches from 10 June?(please have a look at my Downloads page in the top right of this blog).
      It seems that there is an extra '{' at line 91 in your MouseStat.cpp, but it doesn't look like my latest code.

      Regards,
      Andrei

      Delete
  24. Hello Andrei,

    i do all the things that you wrote in your HOW TO.
    I use the last version of the patches in der top right of this blog
    But when i start i have a problem with the xbmc-300-eGalaxPatch.patch
    I think it is a version problem.
    Here is the output from my terminal:

    APPLY PATCH (common) /home/steffen/OpenELEC.tv/packages/mediacenter/xbmc/patches/xbmc-300-eGalaxPatch.patch
    patching file xbmc/input/linux/LinuxInputDevices.cpp
    Hunk #1 succeeded at 293 with fuzz 2 (offset -24 lines).
    Hunk #2 succeeded at 570 with fuzz 2 (offset 25 lines).
    Hunk #3 FAILED at 698.
    1 out of 3 hunks FAILED -- saving rejects to file xbmc/input/linux/LinuxInputDevices.cpp.rej
    patching file xbmc/input/MouseStat.cpp
    Hunk #1 FAILED at 20.
    Hunk #2 FAILED at 38.
    Hunk #3 FAILED at 101.
    3 out of 3 hunks FAILED -- saving rejects to file xbmc/input/MouseStat.cpp.rej
    patching file xbmc/input/MouseStat.h
    Reversed (or previously applied) patch detected! Assume -R? [n]


    What can i do?

    ReplyDelete
  25. For everyone else who is struggling. Enabling all kernel modules caused a kernel panic for me. I've just added following lines and denied everelse propose touch driver during building.

    CONFIG_INPUT_TOUCHSCREEN=y
    CONFIG_TOUCHSCREEN_USB_COMPOSITE=y
    CONFIG_TOUCHSCREEN_USB_EGALAX=y

    If you have a non egalax comaptible touch screen you should find out which driver is needed.

    ReplyDelete
  26. Hello Netzmacht,

    thanks for your information. But it dose not work for me.
    I will explain what i do step by step:
    1. git clone git://github.com/OpenELEC/OpenELEC.tv.git -> This is 13.2 Alpha

    2. Insert
    CONFIG_INPUT_TOUCHSCREEN=y
    CONFIG_TOUCHSCREEN_USB_COMPOSITE=y
    CONFIG_TOUCHSCREEN_USB_EGALAX=y
    in OpenELEC.tv/projects/RPI/linux/linux.arm.conf

    3. Navigate to folder OpenELEC.tv/projects/RPI/ and create the file usr/share/eGalaxCalibration/touchscreen_axes_calib. This file should have the following contents:
    calib_x_d=-21;calib_x_fact=0.658097686;calib_y_d=-50;calib_y_fact=0.408626561;swap_axes=0;click_confines=8
    -> but after build there is no file touchscreen_axes_calib

    4. Put the patch from you into , rename it to OpenELEC.tv/packages/mediacenter/xbmc/patches/ and rename it intoxbmc-300-eGalaxPatch.patch

    5. Navigate to OpenElec folder and type:
    PROJECT=RPi ARCH=arm make -j3

    After install OpenELEC it starts, but the calibration is wrong and the is no touchscreen_axes_calib file on the sd card. Whats wrong?

    Thank for you support!
    Steffen

    ReplyDelete
    Replies
    1. Hi Steffen,
      Please get my latest patch from my downloads page. This patch loads touchscreen_axes_calib file from /home/pi. You need to edit it and rename this to /storage/touchscreen_axes_calib. After this you can use my calibration plugin(also in the downloads page).

      Delete
  27. Hello, thanks for doing this. I have been trying to get my touch screen to work with different operating systems. I downloaded your build of it and followed the openelec's wiki instructions you linked to. I tried to boot my pi but only the pwr light came on. I currently have these files on the sd card.
    System >
    bootcode.bin
    cmdline.txt
    kernel.img
    README
    start.elf
    SYSTEM
    Storage >
    touchscreen_axes_calib

    thanks in advance

    ReplyDelete
    Replies
    1. Im also very new to linux so it would help If you told me step by step

      Delete
    2. Hi,

      Sorry but I don't have time for guide you step by step. First, please try to write the image again, maybe the write process wasn't successful. Please add me on gtalk or ym to avoid filling this page with comments.

      Delete
  28. Hello,
    I would like to do what you describe above but I don't know where to find the good version of Openelec source code.
    Or does it work whith the latest version?

    ReplyDelete
    Replies
    1. Hi,
      I haven't tried with latest version but it should work. You just need to take my patches and update them for latest xbmc(if there are not working).

      Delete
    2. Hello Andrei

      I have seen that you have updated the patches.
      Maybe you can upload a new image of OpenELEC. I'm stuck here.

      That would be nice.
      Steffen

      Delete
    3. Hi Steffen,

      I am sorry but I don't have time for this as I am working on couple new features for the CarPC. Please try to follow my tutorial and if you get stuck somewhere please contacte me via gtalk or yahoo messenger.

      Regards,
      Andrei

      Delete
  29. This comment has been removed by the author.

    ReplyDelete
  30. Hello Andrei,

    I`ve compiled the latest Version of OpenELEC with your patches,
    but when i install it on SDcard and try to start, i always get an Kernel panic error...
    Is it possible, the patches are not compatible to new OpenELEC 5 or with Kodi instead of XBMC?
    Which version was the latest who work with your patches?

    Regards Michael

    ReplyDelete
    Replies
    1. I was able to compile Openelec 5. Copying the patches to the patches directory didn't work for me. I manually patched the sourcefiles and copied them by script during the build process at the moment they exist. Not nice, but working. Maybe to fix this or I did something wrong. Also during building, you will be prompted for your touch-device. I have choosen only the USB_Generic. Touchscreen is working, did calibration manualy by editing the touchscreen_axes_calib.

      Delete
    2. Henk if you are reading this, is it possible that you could to upload the compiled image somewhere?

      Delete
    3. I prefer Andrei put it on his download site, but for the time being here it is :https://drive.google.com/folderview?id=0Bw2cMiMAzihhfnVsejZPTG1GcXNOSm5qXy1QaUltRk9uU1NKZnltSFVrbjJnSTJId1N3S2s&usp=sharing

      Delete
    4. Could you compile OE 5.08 too?

      Delete
  31. i cannot get the precompiled one it says no longer authorized and that would be great if you could update the link :D thanks

    ReplyDelete
  32. Andrei! Can you prepare IMG file of Openelec with EGalax and other add-ons support for raspberry PI2 ? I need it for car. I will pay you for that. I bought Icarus software, but I do not like interface. May be you have anything better? I,m not developer and only I can it is install IMG file on SD. Thank you. You can repond to Arsen@omegaauto.com

    ReplyDelete
  33. Also, is that possible to connect ipod by USB to PI2 with control from PI?

    ReplyDelete
  34. Could you re-upload the add-on please?

    ReplyDelete
  35. Anyone who wants 5.08 precompiled with the patches: https://mega.co.nz/#F!2QRVXY4B!kWNdm7sZ7FmngARbCXYCAw

    And if you want the patches and add-on yourself, the files are there as well.

    BTW, the add-on doesn't work for me. First of all you have to change the directory in the sourcecode where the touch_calibration file is placed. And second, the resolution isn't used right in this add-on. I finally managed by doing manual calibration.

    ReplyDelete
  36. I've been trying your image. I'm not able to calibrate correctly. I end up keeping asking Touch the bottom left point and then press enter without a cross being displayed

    ReplyDelete
    Replies
    1. You should change the python file of the addon. Located somewhere /storage/.kodi/addons/calibration-addon (not the precise directory obviously, just find it yourself) there is a .py file. Edit it with a text editor. Change /home/pi/ to /storage/ in that file (two instances). Then the addon should function. But for me the resolution was off apparantly so I had to manually calibrate.

      Delete
    2. this worked. I'm still getting an offset in X direction now. Y direction seems fine. The cursor seems to be
      about 100 pixels offset compared to my touch. Anywhere i can change these values manually?
      Thanks

      Delete
    3. Yep, the touchscreen_axes_calib file in /storage/ contains 4 values: offset for x and y and proportions for both x and y. I did some trial and error and have the values to my satisfaction right now.

      Delete
  37. Hi Andrei.

    I'm trying to get your build, but it's giving me an error.
    Could you send me a link that works, please?

    Thank you.

    ReplyDelete
  38. Hello Andrei,

    The files are missing.

    Thanks

    ReplyDelete
  39. Hello Andrei,

    The files are missing.

    Thanks

    ReplyDelete
  40. Hi Andrei.

    I'm trying to get your build, but it's giving me an error.
    Could you send me a link that works, please?

    ReplyDelete
  41. hi great work, can you upload video related this article.

    ReplyDelete
  42. I really like the dear information you offer in your articles. I’m able to bookmark your site and show the kids check out up here generally. Im fairly positive theyre likely to be informed a great deal of new stuff here than anyone
    CIVIL ENGINEERING BOOKS | free engineering books

    ReplyDelete
  43. I am running the RPi3+ with a 52Pi 7 inch display. It works great with Stretch but Kodi does not detect the touch screen. Anyone know of a way to compile Kodi with touch functionality?

    ReplyDelete