Tuesday, February 26, 2013

Raspberry PI, Raspbian, XBMC and eGalax 7 inch touchscreen

Hello!

I have spent some time lately trying to find a solution to get my 7 inch eGalax touchscreen to work with  Raspbian(Debian Wheezy) in XBMC 12 Frodo and finally got it working as I wanted.

My Setup
  • Raspberry PI model B: ~30$
  • 7 inch display with touchscreen for car rear view camera, from eBay(touchscreen is connected to one USB port): 80$
  • HDMI male to HDMI male connector(from eBay): <2$
  • 4GB SDHC class 4 card
  • 12V(500mA) AC to DC adapter for powering the display
  • 5V(1A) microUSB AC to DC converter for powering the PI
  • USB keyboard


Edit:  Download the latest image from the top right corner of this blog(username: pi, password: a).

Here is what you need to do in order to have a system with Raspberry PI, Raspbian OS and XBMC 12 Frodo stable with eGalax touchscreen working correctly(which means axes calibrated and click working with just one tap&release action):


1. Get latest Raspbian image from here and flash it to an SD card.

2. Build your own kernel with eGalax touchscreen support, like in this post(you will only need to replace kernel.img file and /lib/modules and /lib/firmware folders on the SD card).

3. Build XBMC 12 on Raspberry PI using this tutorial.
Note: After downloading XBMC archive, get this archive and unpack it anywhere.
Apply patches to xbmc files:
cd <patches_folder>
patch -p1 <path_to_xbmc>/xbmc/input/linux/LinuxInputDevices.cpp < LinuxInputDevices_cpp.patch
patch -p1 <path_to_xbmc>/xbmc/input/MouseStat.cpp < MouseStat_cpp.patch
patch -p1 <path_to_xbmc>/xbmc/input/MouseStat.h < MouseStat_h.patch
4. Touchscreen calibration.
Copy the eGalaxCalibration folder from the archive(downloaded above) to /usr/share/ on Raspberry PI. Here, you should have the file touchscreen_axes_calib. It contains four values for the axes calibration and one value for swapping axes.
The simplest way to swap axes is to switch the four wires cable plug's orientation which comes from the touchscreen to the touch controller.

Here is how the calibration was done.

the original behavior(no calibration)

In the picture above, we see that "touch panel values frame" differs from "touch panel physical size frame". When we are pressing the touch we are moving in the "touch panel physical size frame" but when the touch screen is not calibrated the arrow from XBMC is in another place.
  • "touch panel physical size frame" is the screen starting from (0,0) on the left top corner and going to (width, height) in the right bottom corner.
  • "touch panel values frame" is the frame which contains all the number the touch controller is giving.
We see that these frames differs a lot. Our main scope is to overlap the "touch panel values frame" to the "touch panel physical size frame".

In order to do this we need to do three steps(the third one is done in software):
a. Scale the value read from the touch driver x and y) in order to fit 0->width range and respectively 0->height range of the "touch panel physical size frame" the scale value for x axis is:
                       "touch panel physical size frame" width
calib_x_fact = -------------------------------------------------
                            "touch panel values frame" width


                       "touch panel physical size frame" height
calib_y_fact = -------------------------------------------------
                            "touch panel values frame" height

"touch panel values frame" width and height are coming from your XBMC resolution(I have width=1280 and height=720).
"touch panel physical size frame" width and height are a little more trickier to find but nothing hard. In step 2 above, you have calibrated the touchscreen in XFCE. You got some values returned by xinput_calibrator, something like:
Section "InputClass"
    Identifier   "calibration"
    MatchProduct    "eGalax Inc. USB TouchController"
    Option    "Calibration"    "1977 32 1893 131"
EndSection
In my case,
"touch panel physical size frame" width is 1977 - 32 = 1945
"touch panel physical size frame" height is 1893 - 131 = 1762
Now, compute the values and put them in /usr/share/eGalaxCalibration/touchscreen_axes_calib file

b. Translate the "touch panel values frame" to the left and up, to match "touch panel physical size frame".
I didn't find a logical method to do this, because we don't know exactly "where is" the "touch panel values frame", so, in order to find calib_x_d and calib_y_d you have to first set them both to zero and then start XBMC. Now, put some sharp pointer on the screen and observe the distances between the cursor on the screen and your pointer's position. Try to approximate these x and y deviations(measured in pixels) and put them in the /usr/share/eGalaxCalibration/touchscreen_axes_calib file.

c. Revert direction of axes. This is done in the software(from patches).

5. Math behind.
To accomplish these transformations the following formula was implemented in the file
xbmc/input/linux/LinuxInputDevices.cpp
pointer.x = screen_width - value_read.x * calib_x_fact - calib_x_d;
pointer.y = screen_height - value_read.y * calib_y_fact - calib_y_d;

After I have successfully calibrated the touchscreen I have discovered that single click was not possible from the touchscreen, just double click. After digging through the code, I have found that this was caused by drag action which was triggered because the previous values of the touch were far(more than 5 pixels) from a new press. For example, at the start of the program, cursor is set at 0,0 coordinates; if user is trying to press a button, let's say at 100, 300, the program(XBMC) will calculate the distance between these two points and will find out that this is greater than 5.
Pythagorean theory:
(100-0)x(100-0) + (300 - 0)x(300-0) is greater than 5x5 XBMC will treat this as a drag event.
This drag issue is not caused when you double click, because the previous point in the second click action is very close to the second click point. This also works for mouses, because the previous value of the pointer is always very close to the new value of the pointer(because mouse's pointer drags on the screen and it doesn't jump - so each new value is very close to the previous one).

I have developed an algorithm to avoid this issue:
When the user is pressing the screen(x,y), the touch values are being set to (screen_width+1, screen_height+1 -> outside of the visible screen) just at the first event read(which is BTN_TOUCH PRESS).
After this event, the program will receive multiple X and Y absolute values events. The first two events, one for X and one for Y are used to set the previous X value, respectively previous Y value to the current X respective current Y values. And from now on distance is measured and this is preventing no unwanted drag action.
The user's finger/pointer will not stay at a single point, because the touchscreen's lack of precision, so it will move around 5-6 pixels in x and y directions.
I have also set the click distance to 7. You can change this by changing click_confines value in xbmc/input/MouseStat.h. Originally it was set to 5, but this is not very good for touch screens(I had to click with a sharp pointer and with my nail always, but with a value of 7 I can click with my finger with a slight touch -> really nice).

Enjoy!

173 comments:

  1. Very nice! I'd love to be able to implement this in Raspbmc, would be curious if the same can be applied to building an install of it.

    ReplyDelete
    Replies
    1. This should work with Raspbmc as well, because, in my understanding, Raspbmc is Debian with no X server and XBMC.

      Delete
  2. Is the screen capacitive or resistive?

    ReplyDelete
    Replies
    1. The touch screen is rezistive, but the response is very good with my patches.
      You don't have to use your nail or some pen.

      Delete
  3. I recently attempted this and got it to run well in lxde, but not xbmc. Does this work in xbmc standalone?

    ReplyDelete
    Replies
    1. Yes, this is working with xbmc standalone. You don't need X server for this. My patches are affecting XBMC's source code and XBMC on Raspberry PI runs in the framebuffer so it is not related to X server. It receives the events directly from the kernel.

      Delete
  4. What was the exact ebay listing that you purchased the screen from? I can't seem to find eGalaxy.. Thanks!

    ReplyDelete
    Replies
    1. Here is the display + display controller + touchscreen + touchscreen controller for 80$:
      http://www.ebay.com/itm/HDMI-VGA-2AV-Driver-board-7inch-800-480-AT070TN92-V-5-Lcd-with-touch-panel-/170937641798?pt=LH_DefaultDomain_0&hash=item27ccad6b46

      If the item is not available any more, you can find it by searching for
      HDMI+VGA+2AV Driver board
      You have to look in the item's description to see if it has touchscreen and touchscreen controller. You won't find eGalax name, but almost all cheap touchscreen controllers on eBay are eGalax, but if they are not you certainly have drivers implemented in the linux kernel, you just have to activate them.

      Delete
  5. Chalkboard Electronics sells whole bundle with everything included: http://www.chalk-elec.com/?page_id=1280#!/~/category/id=3094861
    Got it working right out of the box.

    ReplyDelete
    Replies
    1. It is working out of the box on Xserver and also on XBMC, but they cannot be calibrated, unless you put my patches.

      Delete
    2. Hey i got that one from chalc elec, and tried with raspbian(touch worked)-> xbmc (touch didnt work) then with openelec xbmc and raspbmc where the touch didnt work. Would your patch make the touch work on the xbmc? sorry if its a dumb question im new to this.

      Delete
    3. Yes, my patches should work with any touch screen in XBMC. You just have to be sure that the kernel module for your touch screen is loaded(and it should be because you said that it worked on Raspbian).
      I suggest you to download my latest image and play with the calibration.

      Delete
  6. Would this work with Android on the Raspi? This would be great for a roll your own car head unit based on Android.

    ReplyDelete
    Replies
    1. I don't know about Android's kernel, but it should work, but also, in my knowledge, Android is not a very good build for Raspberry PI, at least at this moment.

      Delete
  7. Thanks so much for these postings, without them I was totally stuck.

    I am having a problem with my XBMC calibration:
    This is my working Xorg config:

    Section "InputClass"
    Identifier "calibration"
    MatchProduct "eGalax Inc. USB TouchController"
    Option "Calibration" "1818 80 246 1831"
    Option "SwapAxes" "1"
    EndSection

    Section "InputClass"
    Identifier "calibration"
    MatchProduct "eGalax Inc. USB TouchController"
    Option "Calibration" "72 1816 1808 244"
    EndSection

    My XBMC resolution is: 1440x900

    As you can see I need to have 2 sections in my Xorg config (strange?), so I am not sure which numbers to use for calib_x_fact and calib_y_fact

    Can you help me at all?

    ReplyDelete
    Replies
    1. As I see from your xorg config,
      calib_x_fact = 1440 / (1818 - 80) = 0.82853855 or 1440 / (1816 - 72) = 0.825688073
      calib_y_fact = 900 / (1831 - 246) = ... or 900 / (1808 - 244) = ...
      You can play with these numbers after you build XBMC.
      Can you please post the result of xinput_calibrator? Also, can you please try to swap axes by swapping the cable which comes from the display into touch screen controller?

      Andrei

      Delete
  8. hi,

    thanks for the response :) .. this is the output from xinput_calibrator:

    Calibrating EVDEV driver for "eGalax Inc. USB TouchController" id=8
    current calibration values (from XInput): min_x=1976, max_x=224 and min_y=232, max_y=1812

    Doing dynamic recalibration:
    Setting new calibration data: 1979, 227, 242, 1798


    --> Making the calibration permanent <--
    copy the snippet below into '/etc/X11/xorg.conf.d/99-calibration.conf'
    Section "InputClass"
    Identifier "calibration"
    MatchProduct "eGalax Inc. USB TouchController"
    Option "Calibration" "1979 227 242 1798"
    EndSection



    I swapped the cable around for the touchscreen, now I only need 1 section in my Xorg (as above) .. that also helped to make it clear which numbers to use in my /usr/share/eGalaxCalibration/touchscreen_axes_calib

    In XBMC the X axis is pretty much correct now, but the Y axis seems to be swapped around, so now when I move my finger up the XBMC screen, the pointer goes down and visa versa ... do you know what might be the problem?

    Here is my /usr/share/eGalaxCalibration/touchscreen_axes_calib:

    calib_x_d=-200;calib_x_fact=0.821917808;calib_y_d=-300;calib_y_fact=0.57840617;swap_axes=0;


    I have played with 'calib_y_d' abit but it does not seem to effect it :(


    Thanks again .. you are a legend!

    ReplyDelete
    Replies
    1. In order to swap Y direction you have to use calib_y_fact=-0.57840617.
      You can take a look at the formula below:
      pointer.y = screen_height - value_read.y * calib_y_fact - calib_y_d;
      value_read.y is the value got by XBMC, so in order to revert it's direction you have to multiply it with -1.
      You should start with calib_y_d from 900, by doing this, pointer won't go from screen_height to 0 but from 0 to screen_height.
      Good luck!
      I am glad that you have succeeded.

      Regards,
      Andrei

      Delete
    2. Many thanks Andrei, I have been trying for some time to achieve this. I followed your instructions, compiled kernel and successfully calibrated for Raspian. Next I compiled xbmc using the xbian guide with your recommendations (mem/swapfile) and your patches. Everything worked great, calibrated touchscreen for the first time in xbmc (xbian). I have one problem though, I cannot 'action' via touchscreen, i can 'select' but not 'action' either with 'single tap' or 'double tap' . I recompiled changing the 'click_confines' value but that did not work, would really appreciate your help and advice.

      kind regards,

      mark

      Delete
    3. Hi Mark!

      I am glad you got it working. For clicks problem, I would like to ask you to enable debug logging in xbmc(via a keyboard or mouse) in System->Settings->Debugging->Enable debug logging and then try some clicks on the touch screen.
      After this , please investigate the log file(/home/pi/.xbmc/temp/xbmc.log) and also email it to me so I can take a look.

      Regards,
      Andrei

      Delete
    4. Hi Andrei!

      First off I'd like to thank you for the great tutorials. They helped me a lot!
      I have the same hardware like you and did everything described in your instructions.
      The touchscreen works perfectly under Raspbian and is also calibrated in XBMC.

      I just have 2 problems:
      -the touchscreen doenst "click" in XBMC, debug-log is telling that a "drag action" is performed.
      -HDMI-output is fine in Raspbian at 1280x720 resolution. As soon as XBMC is started there is no HDMI signal. I already tried different resolutions, still no signal. Therefore I use analoge video output at the moment.

      I would really appreciate your help and advice.

      Regards,
      Michael


      Delete
    5. Hi Mark,

      I'm experiencing the same click-issue. Provided Andrei with the log already.

      HDMI was problematic, but I managed to solve that by using a different
      cable. Withe the old cable I was not able to read the EDID data from the monitor.
      Now, using the new cable, "tvservice -s test | edidparser test" shows the desired info.

      So, what happens when you do a "tvservice -s test"?

      /pieter

      Delete
    6. Hi Andrei,

      Sorry for the delay, I can confirm the same result as Michael, no other touch action other than processmouse; trying action mousedrag. I can force a left click by changing the mouse.xml file as described here.. http://forum.xbmc.org/showthread.php?tid=137852 . For some reason it is only seeing a mousedrag. I have tried evtest and can see the supported events and get the following for a touch action

      Event: time 1363763794.912240, type 4 (EV_MSC), code 4 (MSC_SCAN), value d0042
      Event: time 1363763794.912249, type 1 (EV_KEY), code 330 (BTN_TOUCH), value 1
      Event: time 1363763794.912256, type 3 (EV_ABS), code 0 (ABS_X), value 1151
      Event: time 1363763794.912262, type 3 (EV_ABS), code 1 (ABS_Y), value 857
      Event: time 1363763794.912266, -------------- SYN_REPORT ------------
      Event: time 1363763794.952239, type 4 (EV_MSC), code 4 (MSC_SCAN), value d0042
      Event: time 1363763794.952248, type 1 (EV_KEY), code 330 (BTN_TOUCH), value 0
      Event: time 1363763794.952261, -------------- SYN_REPORT ------------

      i can email more tests or info if it helps, have been test compiling code with little success it seems like the result is always mousedrag or nothing.

      too close to give up yet!

      again many thanks for your hard work

      mark

      p.s. /pieter, i have no hdmi problems, i get the correct info from the tvservice command

      Delete
    7. Oops,

      It was Michael instead of Mark...

      Delete
    8. Hey,

      inverting the Axes didn't work with making the calib_*_fact negative, because this doesn't invert the
      "pointer.y = screen_height - value_read.y * calib_y_fact - calib_y_d;" equaluation.

      Instead deleting "screen_height-" in the sourcecode does just that.

      Short: If you Axes are inverted change
      pointer.y = screen_height - value_read.y * calib_y_fact - calib_y_d;
      in "xbmc/input/linux/LinuxInputDevices.cpp" to
      pointer.y = value_read.y * calib_y_fact - calib_y_d; .
      Then do the same for x-value and recompile xbmc. --> Done


      PS: the lines in the sourcecode are slightly different, search for "calib_" and you will find 2 lines that look quite similar.

      Delete
    9. Do the math.

      You don't need to alter source code.

      If you put a - calib_y_fact you get
      eg. pointer.y = screen_height - value_read.y * calib_y_fact - calib_y_d
      pointer.y = 1280 - ( 200 * -0.332 ) - calib_y_d
      pointer.y = 1280 - ( -66.4 ) - calib_y_d
      pointer.y = 1280 + 66.4 - calib_y_d
      So you can see you end up with the screen width PLUS the correction, which puts it off the side of the screen.
      So all you have to do is set calib_y_d to the same as you screen width.

      eg. pointer.y = 1280 + 66.4 - 1280
      pointer.y = 66.4

      Then you can tweak calib_y_d so pointer is exactly under your finger!

      Exactly the same applies for the other axis.

      Thx

      Delete
  9. Andrei,

    Thanks for the work you've done on this, it's the only fix I've been able to find to allow touchscreen XBMC on the pi. I have an Elo touchscreen working on my pi using your patches but i have a few questions.

    I notice the farther i slide my finger from the center of the screen the more the cursor comes out of alignment. Not a huge amount, perhaps only a centimeter or two, but I wonder if you know what might be causing this.

    Also, I'd love for this to be implemented into Raspbmc or another tweaked rPi distro that just does XBMC. Would it be as simple as copying the xbmc i compiled from raspbian to Raspbmc?

    Thanks again for your work and tutorial,

    tim

    ReplyDelete
    Replies
    1. Hi Tim!

      I am glad that my work is useful :)
      You have to tweak calib_x_fact and calib_y_fact to reduce this offset.
      Can you please post what was the xinput_calibrator output?

      Regards,
      Andrei

      Delete
    2. Andrei,

      This is my xinput_calibrator output:

      Section "InputClass"
      Identifier "calibration"
      MatchProduct "EloTouchSystems,Inc Elo TouchSystems 2216 AccuTouch® USB Touchmonitor Interface"
      Option "Calibration" "426 3516 3523 686"
      EndSection

      The math i used was 1024/(426-3516) = -0.331391586 and 768/(3523-686) = 0.270708495 for my calib x and y fact values.

      calib_x_d=1138;calib_x_fact=-0.331391586;calib_y_d=-179;calib_y_fact=0.270708495;swap_axes=0;

      Through trial and error these were the calib_d values I came up with. They work perfect when centering the cursor but the alignment comes off as the cursor travels farther along the x and y axis. (my x axis is reversed on this monitor thus the negaive calib value obviously)

      thanks for the help!

      -tim


      Delete
    3. Hi Tim!

      All I can say is that you have to tweak these numbers, in a mater of fractional part.
      It seems that the numbers obtained from xinput_calibrator are not perfectly fit for my formula, so that's way you have to tweak them a bit.

      Regards
      Andrei

      Delete
  10. Hi Andrei,

    I'm almost there...

    Same screen/touchcontroler as you have.

    Got XBMC running, touch working. So far so good.

    Only having dificulties setting best resolution.

    Have been playing with /boot/config.txt.

    No better than 640x480 yet.

    Is it possible to drive the display with 800x480?

    Thanks for all the work, and the excelent tutorial.

    /pieter

    ReplyDelete
    Replies
    1. Hi Pieter!

      Glad that you got it working :)
      My display works fine with 1280X720 out of the box. I haven't modified /boot/config.txt.

      Regards,
      Andrei

      Delete
  11. It was the HDMI-cable... Tried another one: bingo!

    But now I have this silly problem:

    The small connector that connects to the 4-wire ribbon did fall appart....
    Anyone can tell me the position of the four coloured wires? (or is it the same sequence as the opposite connector)

    btw this is the calibrator output:

    Calibrating EVDEV driver for "eGalax Inc. USB TouchController" id=6
    current calibration values (from XInput): min_x=1923, max_x=127 and min_y=1728, max_y=335

    Doing dynamic recalibration:
    Setting new calibration data: 129, 1922, 326, 1726


    --> Making the calibration permanent <--
    copy the snippet below into '/etc/X11/xorg.conf.d/99-calibration.conf'
    Section "InputClass"
    Identifier "calibration"
    MatchProduct "eGalax Inc. USB TouchController"
    Option "Calibration" "129 1922 326 1726"
    EndSection

    /pieter

    ReplyDelete
    Replies
    1. Hi Pieter!

      I'm glad it is working. You can take a look at my picture from the beginning of the post to see how you should connect your cables.

      Andrei

      Delete
    2. I will. Thanks again.

      Next I have to find a suitable donor-casing (7" portable DVD-player with defect) and start building a "In Car Entertainment System". Then add a small audio-amp and a suitable power-supply (like: Sound Logic XT Portable 5600 mAh)


      /pieter

      Delete
  12. Hi Andrei

    I have the screen from chalkboard electronics and want to do the exact thing you have. Just to clarify. Did you say your patches would work for me even though our screens are different?

    ReplyDelete
    Replies
    1. Hi!

      I haven't tested with other touchscreens but it should work. I will be glad to help you if you encounter any issues.
      Maybe you will have to comment or remove the following line in xbmc/input/linux/LinuxInputDevices.cpp
      if(strstr(m_deviceName, "eGalax") || strstr(m_deviceName, "Touch"))

      Andrei

      Delete
    2. Cool Thanks! Ill give it a try sometime soon hopefully and let you know.

      Delete
    3. Touchscreen from chalkboard electronics is working fine out of the box (@andrei thanks for your work) Calibration is a little bit tricky. it seems that 0,0 of the touch screen is on the right downside corner. so you have to work with negative values. For me the following are working:
      xinput_calibration -15 9585 -22 7213
      for x used -0.133333333 as factor and 1230 as offset
      for y used -0.110573601 as factor and 750 as offset
      alignment is a little bit off at the corners, will fix it later. Only still problems with drag and click :-(

      Could someone copy that.

      Thanks

      Delete
  13. hi all, what solution for mouse click? i can only get drag..

    ReplyDelete
  14. Hi all!

    If you are encountering mouse drag instead of click(but you have applied my patches correctly, for all files), please send me an email with your xbmc.log file with log level set to 2(look at http://wiki.xbmc.org/index.php?title=Log_file).
    Also, please send me your patched files(from the build folder):
    /xbmc/input/linux/LinuxInputDevices.cpp
    /xbmc/input/MouseStat.cpp
    /xbmc/input/MouseStat.h
    I will investigate them and try to answer as quick as possible.

    ReplyDelete
  15. Hi,

    have the same mouse- click problem. But where do i find your mail- address to provide logs ?

    ReplyDelete
    Replies
    1. Hi,

      My email address can be found at my profile.
      It is andrei.istodorescu@gmail.com
      I will try to create new patches with some debug log, as soon as I will have time.

      Delete
  16. Thanks for these very helpful guides.

    I have 2 problems (which seem common)

    1. XBMC does not register clicks from touch screen.
    2. Calibration within XBMC is off (numbers dont work for me)

    I will continue to play with XBMC calibration numbers to get it to work.. and I will keep coming back here to see if there are any updates on the click situation.

    I do not have to same screen as you, so no wonder I am having these problems.

    Regardless of the issues, you have done a great job with the guide and getting the Pi to work with eGalax screen... thanks alot

    ReplyDelete
    Replies
    1. Hi,
      I've Sent an email to Andrei; I've managed to get it working on my setup, although i need to double-click. I recompiled xbmc with the original MouseStat.cpp file (i.e. no patches) and a slightly modified patched version of LinuxInputDevices.cpp file. Basically removed the following lines....then re-'make' etc..

      m_mouseX =_graphicsContext.GetWidth() + 1;
      m_mouseY = g_graphicsContext.GetHeight() + 1;

      this way I can use the touchscreen with the pointer and doubleclick. I had to play with the scale and offset values in the calib file too, to adjust the pointer position to finger location across the screen.

      hope it works for you too

      cheers,

      Mark

      Delete
    2. Awesome!.. with Mark's tip-bit, clicks are now working in XBMC!! :)
      Only got the calibration to play with now :)
      Thanks all :_

      Delete
  17. NICE BLOG!!! Education is the process of bringing desirable change into the behavior of human beings. It can also be defined as the “Process of imparting or acquiring knowledge or habits through instruction or study”. Thanks for sharing a nice information.
    jammu university distance education

    ReplyDelete
  18. After running the utility to calibration the touch screen I am unable to find the file or directory that it advises that you edit to make the change permanent, I can get into X11 but cannot find folder xorg.conf.d or file.

    --> Making the calibration permanent <--
    copy the snippet below into '/etc/X11/xorg.conf.d/99-calibration.conf'

    ReplyDelete
    Replies
    1. Hi Simon!

      You have to put the file in
      /usr/share/X11/xorg.conf.d/99-calibration.conf

      Andrei

      Delete
  19. Hi! I'm trying this procedure in raspbmc, I have changed the kernel and the /lib folders with yours. But i can't find the file to patch in my system...in the folder of xbmc there aren't there directories! Any idea?
    Thanks

    ReplyDelete
    Replies
    1. Hi Luca!

      I am sorry but Raspbmc has precompiled XBMC, so you cannot apply the patches.
      You have to take a fresh Raspbian image and the source code from XBMC and compile it by yourself(you can find on this blog all the information about this).
      I think that XBIAN has my patches in their latest build, but I haven't tested:
      https://github.com/xbianonpi/xbian-patches/blob/master/xbmc/eGalaxTouchScreen.patch

      Andrei

      Delete
    2. Thanks for the support!
      I try with your solution. I have a touchscreen that in the lsusb details don't figure with "eGalax" but the driver that I have for it are for eGalax, give to me by the seller. I hope it works!

      Delete
    3. I have tested the lastest build of xbian, but the touchscreen doesn't work...how to apply your patch to this distro?
      In these days i will try to follow your guides :)

      Delete
    4. You have to apply the patches to the source files and then compile xbmc.
      You just have to follow the steps described in this post.

      Delete
    5. I see that you have released an img which have all done, is this should done with my setup? I should change the name that i see in "lsusb" with your "D-WAV Scientific Co., Ltd eGalax TouchScreen" somewhere?
      Thanks for your help!

      Delete
    6. You don't have to change anything, just play with axes calibration file.
      My build has a check enabled, so, if your device name does not contain "eGalax" or "Touch" string it won't load the calibration file, so you have to build everything by yourself and remove this line in the code.

      Andrei

      Delete
    7. In this page i've seen that there are drivers of eGalax that run without xserver for arm too (http://home.eeti.com.tw/web20/eGalaxTouchDriver/linuxDriver.htm). Is this should work with raspbmc in your opinion?
      I will try although your installation from source this week end :)

      Delete
    8. I don't think they would work, at least with XBMC 12.0. Maybe calibration will work but click will not work unless you double click(this is an issue with XBMC, fixed with my patches).
      I have tried to install these drivers as well some time ago but had no luck with them. After this, I have modified XBMC by myself to make it work.

      Regards,
      Andrei

      Delete
    9. Xbian now recnognize touch! but how can i calibrate it?
      Thanks!!

      Delete
    10. hi,

      actually it works with raspbmc. once you have got it working with raspbian and this tutorial you just have to save the config-files from this tutorial. the good thing is, that you can cross-compile xbmc, so everything is done in just a couple of minutes (of course with a pretty new notebook/pc). so before you reinstall your pi with raspbmc, save the files
      - the kernel stuff and all compiled folders from this tutorial
      - the touchscreen_axes_calib-file

      then you can install the latest raspbmc. once you have done this your pi should have got installed frodo 12.2 with all necessary updates.
      - then put your sd card in your notebook/pc and copy the kernel stuff, folders and touchscreen_axes_calib like it is described in this tutorial
      - download the xbmc-12.2 sources from here: http://mirrors.xbmc.org/releases/source/xbmc-12.2.tar.gz
      - get the archive with the path-files from this tutorial
      - set up your notebook/pc like it is described here: http://www.raspbmc.com/wiki/technical/build-filesystem/
      - before you chroot, you should copy the downloaded xbmc-sources and all path-files into the new rootfs-folder. then you chroot
      - building xbmc for raspbmc is described here: http://www.raspbmc.com/wiki/technical/building-xbmc/
      - after you have patched the sources and BEFORE you compile you should apply the patches described in this tutorial
      - actually the patch for mousestat_cpp will fail and a ...rej file will be created. just open the destination-file and from the rej-file you can easily change the destination-file by yourself (add all lines with "+" and remove all lines with "-". of course afterwards you have to remove the "+" from all the lines)
      - then you continue the steps described in the building-xbmc-tutorial
      - yes, you install xbmc in the chrooted-directory
      - the file xbmc-rbp*.tar.gz will be available in /opt
      - copy this file on your sdcard, start raspbmc and connect to your pi via ssh
      - then you execute the following commands on your pi
      sudo initctl stop xbmc
      sudo tar -xzf xbmc-rbp*.tar.gz -C /opt
      sudo initctl start xbmc

      it works for me directly. but only because of this great described tutorial. so many thanks to that. i face only two things, which is a bit annoying but i bet there will be a fix in the next month:
      - music and crossfade is not working. actually one track is stopping, then there is a short break and the next songs start. seems to be a firmware-problem
      - i have to modify the mouse.xml and have to change the mousedrag-command to leftclick

      best regards,

      max

      Delete
    11. Hi Max!

      Thank you so much for sharing this! This is a great completion for my tutorial. As for the click issue it seems that I have did a mistake and the patches provided are not the correct ones for click/drag fix. On my RPI this is working fine for about five months and I can click and also drag(as it can be seen in the video). I will try to upload the correct patches as soon as I get some time.
      My very big problem is that I XBMC12.2 is starting with a blank screen on my 7inch display(see here http://forum.stmlabs.com/showthread.php?tid=8924)

      Thank you again!

      Delete
    12. hi,

      once i had the same issue. please don't ask me why, but first try to swap the hdmi-connections. if this does not work just try a different cable.

      for me solution one worked.

      good luck,

      max

      Delete
  20. Hello Andrei,

    Well, it all goes well until calibrating xbmc.
    I don't get it, like nothing happens when I change any of values.
    You mentioned something like patching before running make comand.
    And what does it mean Revert direction of axes. This is done in the software(from patches)
    Which software?

    Jasmin

    ReplyDelete
    Replies
    1. Hi Jasmin!

      Sorry for not answering earlier.
      If you're still interested in this issue the process is like this:
      get xbmc sources -> apply the patch(change some source files) -> build xbmc(run ./configure... make and sudo make install commands like pointed in this post).
      By 'the software' I meant xbmc sources(from the xbmc archive).
      "And what does it mean Revert direction of axes. This is done in the software(from patches)" - This means that I have inverted x direction and y direction from the modified code.

      Regards!

      Delete
  21. What resolution are you outputting from the Pi to the screen?

    ReplyDelete
  22. Hello Andrei,

    I installed your Image, everything is great, calibration in x-Session works. But in XBMC i have switches Axes left is right and up is down. Where can i change this? Also is the cursor not at the point where i touch. But i don't find where i can recalibrat my cursor in XBMC

    ReplyDelete
    Replies
    1. Hi!

      In order to change axes orientation, for x you ave the formula:
      pointer.x = screen_width - value_read.x * calib_x_fact - calib_x_d;
      You have to set calib_x_d = screen_width(or screen_width +/- an offset) and you have to put a negative calib_x_fact value.

      Delete
    2. Have same issue ...
      ... but cannot find on your distribution any /input/ folder in any /xbmc/ folder
      to adapt formula

      Delete
    3. Hi!

      You can find the calibration file in
      /usr/share/eGalaxCalibration /touch_screen_axes_calib.

      Delete
  23. Compiling your own Wheezy just for the Touch Support? This is really complicated. There is an much easier way.

    ReplyDelete
    Replies
    1. Hi!

      When I did this there was no way that you could use the click and also the drag in XBMC, at least for Raspberry PI, because, every click which comes from the touch screen is treated like a drag action and you have to double click to make it work.
      If you have found another solution please share it.

      Delete
  24. Hi Andrei,

    I would like to ask you if this LCD touchscreen (http://bit.ly/13pNeJO) would work with the Raspberry, since I don't see any USB output or output at all for the touch positioning.

    Thank you very much

    ReplyDelete
    Replies
    1. Hi!

      The display should work as any other display, but there is no touchscreen for this one. You have to buy it separately.

      Delete
    2. Hi Andrei,

      Thank you for the reply. I meant this one (http://bit.ly/10FFyp8)

      Delete
    3. Hi!

      The usb controller is the same as mine and the display controller looks similar.
      I think this will work.

      Delete
  25. Hi...
    Is the multitouch working?

    ReplyDelete
    Replies
    1. Hi!
      I don't have any multitouch device to test, so I don't know if it is working

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

    ReplyDelete
  27. Dear Andrei,

    I have loaded to my eGalaxy (probably different touch control board than yours):
    http://www.ebay.com/itm/2DIN-IN-DASH-7-Samsung-HDMI-Touch-Screen-Monitor-Mini-ITX-USB-SD-Raspberry-Pi-/121058156106
    you version of Raspbian+XBMC image (md5sum c59330154143d9e5e43217322bbd92ce).
    If I understand correctly - this is already fixed image - correct?

    Inside X - i have everything correct.
    But in XBMC x&y are still inverted.
    How to switch back this what you have done?
    I cannot find any /input/ folder in any /xbmc/ folder ...
    And going throught sources is something to extreem for me, got lost several times.

    Thanks in advanve for answer!

    ReplyDelete
    Replies
    1. Hi Pawel!

      So, the image provided in this post is the latest build with the patches applied.
      For switching x and y axes you have to play with the touchscreen_axes_calib file, as explained in this post(part 4).
      You don't have to go through the sources. The sources are not in the downloaded image. So, if you have downloaded the image you have to skip to step 4 and play with the calibration file.

      Regards!

      Delete
  28. Thanks for the good work Andrei.

    The patches wont build against the latest xbmc-GIT.
    Is it possible to to provide these patches upstream or fix them to build?

    # patch -p1 MouseStat.cpp < MouseStat_cpp.patch
    patching file MouseStat.cpp
    Hunk #1 FAILED at 22.
    Hunk #2 FAILED at 45.
    Hunk #3 succeeded at 112 (offset 23 lines).

    ReplyDelete
  29. Hi Andrei,

    I've tried a slightly different approach recently. The solution works outside XBMC therefore no compilation is required. I have written a short tutorial which works for XBIAN and RASPBMC.
    I use ts_calibrate to generate the calibration file, including the scale, offset and swap parameters. The a python program 'uinput-mapper' to grab/remap the dev/input/event to a new user-inputevent. With this I can then provide a 'single press' (over 250ms) if in-range and 'BTN_RIGHT' event (over 750ms) if in-range, for a long press. This is useful for context menu and returning to previous screen.

    My short tutorial is here, no need to compile xbian or raspbmc.

    Thanks for you inspiration, Mark

    http://markamc.cybaman.net/?p=50

    ReplyDelete
  30. Hello Andrei,

    i wanted to download the "eGalax_patch_for_XBMC_12.tar.gz" archive to fix my problem with the 7" eGalax-Touchscreen, but it wasn´t there anymore, so I can´t solve my problem without your help. I have everything clear, but my Touchscreen is like you said (Picture to calibrate the touchscreen). Where can I find now without the archive, the Folder with the file to calibrate the axes to calibrate it correctly?
    I use a 7" TFT with composite, not HDMI, is this a Problem or not?
    A quick answer were really good and helpful.

    Thanx

    Mo

    ReplyDelete
  31. Your blog is really helps for my search and amazingly it was on my searching criteria.. Thanks a lot..

    If you are looking for a Car Dvd Player then visit our website: advancetechcentral.com.au. We also provide Car Accessories at reasonable rates.Booking Your DVd Player is so simple, Just log on to our website.

    Car entertainment unit & Holden DVD player

    ReplyDelete
  32. Andrei thanks for the work. But what is the login/password for the provided compiled image. The provided login does not work.

    Many thanks!

    Mark.

    ReplyDelete
    Replies
    1. Hi!

      The login is:
      user: pi
      password: a

      Delete
    2. Hi,

      This is what I tried several times but it did not log me in. I'll try again tonight. Are you absolutely sure it is this?

      Many thanks,

      Mark.

      Delete
    3. Hi!

      The only account I have ever used for RPI was this.
      Please try my latest image: https://drive.google.com/uc?id=0B__Rs5JF53-kTDVHdVk5NWdrdkk&export=download
      It has a lot of new features.

      Andrei

      Delete
  33. Dear Andrei! Greetings from Brazil!
    My friend, using this last image that you posted, how can I remove the AutoStart. Wish XBMC is an option in the menu of the IP.
    I appreciate if you can help me! Hugs! Marcos

    ReplyDelete
    Replies
    1. Hi Marcos!

      After LXDE starts, there is a file /etc/xdg/lxsession/LXDE/autostart which calls this:
      cd /home/pi
      ./navigation_startup
      You can edit the file navigation_startup and comment the lines not needed.

      Best regards,
      Andrei

      Delete
  34. Andrei,
    please help me with patches.
    2 out of 5 hunks FAILED -- saving rejects to file /xbmc-12.1/xbmc/input/linux/LinuxInputDevices.cpp.rej
    This is the output when applying patch.

    Calibrating of xbmc is so hard.
    Thank you

    ReplyDelete
    Replies
    1. Jasmin,

      The patches should be used for the corresponding xbmc source files.
      xbmc 12.0 patches -> http://mirrors.xbmc.org/releases/source/xbmc-12.0.tar.gz
      xbmc 12.2 patches -> http://mirrors.xbmc.org/releases/source/xbmc-12.2.tar.gz

      I haven't tested them on other sources.

      Delete
    2. Andrei,
      I have build xbmc-12.1
      Do you have a link for xbmc 12.1 patches

      Delete
    3. Hi Jasmin!

      Sorry but I don't have any patches for xbmc 12.1
      If you really need this, I advice you to use the patches and see the code changes and add them in your 12.1 sources Mousestat.h, Mousestat.cpp and LinuxInputDevices.cpp

      Delete
  35. This is exactly what I was looking for. Thanks a bunch for sharing this.


    Car entertainment unit & Toyota car DVD player

    ReplyDelete
  36. Great project! Could you take a look at your touch controller and identify the component "D2" for me? I got a controller that's missing that component. (See a picture here:
    http://i911.photobucket.com/albums/ac318/2009Prius/touchscreen_controller/DSC04789_.jpg
    )
    Thank you!

    ReplyDelete
    Replies
    1. PS. It looks like a diode next to the white connector - just in case you can't see the picture. Thanks!

      Delete
    2. Hi!

      I took a picture for the touch controller and saw that there is a diode that you are missing. I don't know if there is some text on the diode, because it is barely visible.
      I have uploaded the picture at:
      https://docs.google.com/file/d/0B__Rs5JF53-kU1YwdWNOYl95Y0k/edit

      Delete
    3. Thanks! Looking at the board it looked like the diode was for over-voltage protection. So I guess as long as the USB port of the netbook that I run it from does not go crazy the diode could be omitted. Crossing my fingers...

      Delete
  37. Hey Andrei
    I still strugle, I downladed latest image. Maybe the problem is I use composite video so the resolution in raspian is little cut on the edge. But xbmc opens fullscreen. I really dont know anymore. Well I had to recalibrate screen in xinput_calibrator (that is why I needed to shut down xbmc and navit) So values that work really perfect are these:
    Section "InputClass"
    Identifier "calibration"
    MatchProduct "eGalax Inc. USB TouchController"
    Option "Calibration" "1856 189 256 1888"
    Option "SwapAxes" "1"
    Option "InvertX" "0"
    Option "InvertY" "0"
    EndSection

    Then when this is workin perfect I load xbmc and compute the values. Then I have no response in xbmc. With your values in touchscreen_axes_calib file i have response but not calibrated. What do you think the values are that I need to write.
    Now it's like this:
    calib_x_d=-21;calib_x_fact=0.767846;calib_y_d=-50;calib_y_fact=-0.441176;swap_axes=1;click_confines=8

    Thanks again friend - honestly

    ReplyDelete
    Replies
    1. Hi Jasmin!

      I suggest you to read part 4 in the post:
      http://www.engineering-diy.blogspot.ro/2013/02/raspberry-pi-raspbian-xbmc-and-egalax-7.html
      This will help you understand how to get these values.

      Delete
    2. I did everything just like you wrote. No luck.
      I'm reading tutorial for 100 time.
      Could it be a problem since I use composite video, not hdmi?
      When I look at your values, you divided values_frame/physical_frame not other way around like you writen in tutorial. I'm really confused now. How to invert axes not swap them?
      Thanks

      Delete
    3. Jasmin, my output from xinput_calibrator was like this:
      Section "InputClass"
      Identifier "calibration"
      MatchProduct "eGalax Inc. USB TouchController"
      Option "Calibration" "1977 32 1893 131"
      EndSection
      My Screen width is 1280, so, my calib_x_fact is like this:
      1280/(1977-32)=0.658097686
      Maybe you have a different resolution on composite video. Check out the XBMC display settings page.
      Given the equation:
      pointer.x = screen_width - value_read.x * calib_x_fact - calib_x_d;
      In order to change x orientation you have to set calib_x_fact = -1 and calib_y_d = screen_width. The equation will become:
      pointer.x = value_read.x
      Please set it like this and move the finger across screen to see how the values were changed.
      After this step is complete, change calib_x_fact as calculated(keeping the negative value).

      Good luck!

      Delete
    4. Thank you very much
      I'm doing it now, so we will see how it will turn out.
      How can I show pointer since it is hidden I cant see where it is?
      Jasmin

      Delete
    5. To show the pointer you have to edit the file /home/pi/.xbmc/addons/skin.CarPC-touch/16x9/Pointer.xml and remove the xml comment tags.
      Xml comment tags are at the end of the comment.

      Delete
    6. I think I got it. Now it is question of couple pixels.
      Friend you really helped me a lot. If you will ever need anything that I am able to help you with, just ask.
      If you ever go to Croatia, email me.

      Delete
    7. Great!

      I am glad that I could help.
      Sorry for the last sentence at the previous email. I had put the xml tags in the text and the result is that the text was truncated by Blogger.

      If you ever come to Romania please mail me as well.

      Good luck with your project.

      Best Regards,
      Andrei

      Delete
  38. Hi, I am really struggling with this, i have downloaded your latest image but i can't calibrate the screen so when i touch the screen it is no where near,i have no idea where the files are that i need to change the values in........could you tell me where i can find them.

    Thanks
    Josh

    ReplyDelete
    Replies
    1. abit more info, i have now managed to find all the files but i cannot edit any of them it says i only have read permission, the y axis seems to be correct however the x axis is inverted so left is right and right is left there is also a very big offset on the x axis........any help would be great as this is going to form part of my university dissertation.
      thanks
      josh

      Delete
    2. Hi!

      Please don't use the OpenELEC image because it is just a demo image with my touch calibration and OpenELEC filesystem is read only.
      As for the other images(based on Raspbian) you have to use sudo to edit the calibration file.
      sudo nano /usr/share/eGalaxCalibration/touchscreen_axes_calib

      Delete
  39. Hello Andrei

    really great tutorial. I am trying to follow up your tutorial but when it comes to downloading the patches for XMBC, google says: it's not there anymore. can you please provide a new working link? many thanks in advance.

    cheers Chris

    ReplyDelete
  40. I've found the patch file https://andrei-development.googlecode.com/files/eGalaxPatch.diff
    cheers

    ReplyDelete
  41. I absolutely love your site.. Very nice colors & theme.
    Did you create this website yourself? Please reply back as I'm planning to create
    my own blog and want to learn where you got
    this from or what the theme is named. Cheers!

    Feel free to surf to my weblog ... sharecash downloader 2012

    ReplyDelete
  42. Hi Andrei
    I have downloaded your image with XBMC 12 and it is working well for 7 inch touch screen. But for 8 inch touch screen the calibration is lost after reboot. I am using 8 inch HDMI monitor with USB touch (make - FEEL WORLD). please help me to fix this issue

    Seenivas

    ReplyDelete
  43. Hi
    Thanks for the effort.
    I download the image file and now my touch panel works
    I am getting an OpenGL error when I try launch XBMC do have any idea why

    Many thanks
    John

    ReplyDelete
    Replies
    1. Hi!
      You have to start xbmc by calling
      /usr/local/lib/xbmc/xbmc.bin

      Delete
  44. Touch screen is inverted ONLY in XBMC
    on the desk top it is normal and the calibration is successful
    Any ideas
    Thanks
    Jman

    ReplyDelete
    Replies
    1. Hi Jman!
      You have to change the values in /usr/share/eGalaxCalibration/touchscreen_axes_calib.
      Please have a look at the post:
      http://engineering-diy.blogspot.ro/2013/02/raspberry-pi-raspbian-xbmc-and-egalax-7.html
      on chapters 4 and 5

      Delete
  45. How did you go about mounting the touch screen? I bought the same screen and I'm attempting to make a touch screen remote.

    ReplyDelete
    Replies
    1. Hi!

      I have created a custom frame using EPS and double adhesive band.
      This was build to fit a 2DIN frame from Metra: METRA 95-9306B

      Regards,
      Andrei

      Delete
  46. Hey Andrei,
    It's me again, I can't leave you alone :)
    My HDMI to VGA converter just came from ebay. It works great, I have normal resolution at last.
    So I copy image, insert SD card run xinput calibrator.
    Values are 95 1930 1794 166
    Values are saved and working without any inverting. Starting xbmc, pointer is moved to the right and Y axis inverted and higher then finger position.
    Now I hit touchscreen_axes_calib, resolution in xbmc is set to 1024x768 by default
    calib_x_d=-1; - like you said
    calib_x_fact=-0.5580381471; - calculated value 1024/(1930-95) keeping the negative value like you said
    calib_y_d=768; - screen width like you said
    calib_y_fact=0.471744471744; - calculated value 768/(1794-166)
    swap_axes=0;

    When values are like this, I don't have any response.
    I'm open to advice once again

    P.S. I wasn't able to make it work over composite video so I bought this converter.
    At least resolution is good.

    ReplyDelete
    Replies
    1. Hi Jasmin!

      Nice to speak tou you again :)
      You said that your pointer is moved to the right, but from the values I see that you are trying to change X orientation. To move the pointer to the left you have to increase/decrease calib_x_d value.
      To change Y orientation, your settings should be good. Also, for moving pointer up or down you have to tweak calib_y_d value (increase/ decrease couple of pixels from 768).

      Now, you have set calib_x_d as -1. Let's see what this means in the equation:
      pointer.x = 1024 - value_read.x * calib_x_fact + 1;
      This means that for each x value we add 1025. This will definitely move the pointer outside of the window and that's why it is not working.

      Regards,
      Andrei

      Delete
    2. Hey Andrei,
      please tell me if I'm anoying to you, I will stop asking. I would like to make it work. But it just won't.
      When I only set calib_x_d to -1 it appears like nothing happened. It still reads your values after restart, which would be almost good because X axis is inverted. When moved left it moves to the right. Y axis is OK with your values. I tried to put (-) in front of your calib_x_fact value, then it goes off the screen.
      I would like to know what am I doing wrong.

      Delete
    3. Hey Jasmin!

      You are not annoying me, but I don't have much time and maybe my replies will be delayed.
      It is good that your Y is ok.
      Now, for the X axis, please contact me on Google talk and I will try to help you more :)

      Delete
    4. Andrei, I am having the same exact issue as Jasmin, Y is perfect with your values but X is inverted, what was your solution?

      Delete
    5. Hi!
      If you have X axis inverted you have to set calib_x_fact to a negative value and calib_x_d equal to your X resolution.
      Please read the post at step 4.

      Delete
    6. Duh! I read that and for some reason it didn't process correctly in my head. It's working now. Thanks!

      Delete
  47. Awesome post.

    Here is my weblog ... mw3 aimbot

    ReplyDelete
  48. Maybe you can help me with this; I didn't need xbmc, so I downloaded a fresh copy of Raspbian, applied the kernel.img file and /lib/modules and /lib/firmware folders & I copied the eGalaxCalibration folder from your img, but its nowhere near precise when I select things, and when a window is maximized (or at least from top of the screen down), the cursor doesnt go that high (unless I use a physical mouse)

    ReplyDelete
    Replies
    1. Hi!
      If you don't need xbmc you should use xinput-calibrator to calibrate your touch in Raspbian.
      eGalaxCalibration folder is only for modified version of XBMC.

      Delete
    2. I gave that a try, and for some reason axis are still inverted (up moves down, down moves up), and touch is still unbelievably inaccurate, almost to the point where it's unusable.

      Delete
  49. Hello Andrei,

    we are still trying to use your image. We have a Touchscreen from Faytech and the Raspberry Pi with 512MB. We bring the Image on the SD Card an than we will start it. It starts but the X and the Y Axis are mirrored. In XBMC and outside XBMC. We tried to change the swap_axis to 1 and we changed the X and Y calib_.._fact with * -1.

    We don't know how to fix it. Can you pleas help us?

    ReplyDelete
    Replies
    1. Hi!

      Please add me to GTalk or Skype(andrei.istodorescu) or YM(bboyandru).

      Delete
    2. Finaly i used your files and now, it's ok. Thank you :)
      What values did you put for the overscan (left, top, bottom, right) in your /boot/config.txt to fill correctly the screen ?

      Delete
    3. Hi!

      I have't modified the overscan values.
      I have disable_overscan=1

      Delete
  50. Hello, i have downloaded your image(Pre-Loaded)and mounted on the SD Card. Now how do i go to calibration mode and store the new values after calibrating as per my size? 10.1 size touchscreen egalax.

    Thanks in advance.

    Best Regards,

    ReplyDelete
  51. Hi Andre,

    I ahve used image provided by you but my raspberrypi does not boot and just PWR LED is glowing. Can you please suggest anything...?

    ReplyDelete
    Replies
    1. Hi!

      I suspect there is an issue with the firmware that I am using, which is about 1 year old. On my RPI Model B 512 is working very fine, but I heard that there are issues with newer boards. The issue is that on the newest firmware(which works on all RPIs) there is a black screen behind XBMC, so Navit can't be seen.
      I need to investigate this but I am sorry that I do not have time at this moment.

      Delete
  52. My axes are really messed up. When I tap the upper left corner, the cursor is placed In the upper right. Tapping upper right puts it in the lower right, tapping lower right puts it in the lower left. And tapping the lower left puts it in the upper left.

    ReplyDelete
  53. Hi,

    Many thanks for sharing your work :) im trying to put the touch to work on xbmc ( im using november carpc image from you) i get the cal fille Calibrating EVDEV driver for "eGalax Inc." id=9
    current calibration values (from XInput): min_x=0, max_x=2047 and min_y=0, max_y=2047

    Doing dynamic recalibration:
    Setting new calibration data: 1958, 69, 82, 1901


    --> Making the calibration permanent <--
    copy the snippet below into '/etc/X11/xorg.conf.d/99-calibration.conf'
    Section "InputClass"
    Identifier "calibration"
    MatchProduct "eGalax Inc."
    Option "Calibration" "1958 69 82 1901"
    EndSection

    my xbmc resuloction 1280x1024 i have made so many calculactions and then put /usr/share/eGalaxCalibration/touchscreen_axes_calib but cant get it to work. Please give me a hellp im getting creazy... thanks

    ReplyDelete
    Replies
    1. Hi!

      Sorry for the delay, please add me on Gtalk.

      Delete
  54. Hi,

    first of all thanks for your tutorial.

    I have a little problem with the usb cable. My cat played with it and cut through 2 of the cables.
    Do you know how the white plug to the usb connector for the touchscreen is called, the one from raspberry usb port to the touchscreen control panel.

    Many thanks and sorry for the bad english, I hope you can understand what I am talking about. :)

    ReplyDelete
  55. Hey man tanks a lot for share !!! i have load your image successfully :)

    ReplyDelete
  56. Will this tutorial work on this touch panel?

    http://www.ebay.com/itm/HDMI-input-LCD-controller-board-7inch-800x480-AT070TN92-lcd-with-touch-panel/360811533124?_trksid=p2047675.c100011.m1850&_trkparms=aid%3D222006%26algo%3DSIC.FITP%26ao%3D1%26asc%3D19852%26meid%3D4741517119939926677%26pid%3D100011%26prg%3D8938%26rk%3D1%26rkt%3D10%26sd%3D170937641798

    ReplyDelete
  57. I used your image and it works fine, but my problem now is that my wipi dongle wont work anymore with your image. I know it's now related but I just need help on how to install the driver for my driver with compatability to your given image. Thanks in advance.

    ReplyDelete
    Replies
    1. Please tell me the exact model of your wifi dongle, or what kernel module you need for it.

      Delete
  58. Hello Andrei,

    I tried your XMBC image (https://docs.google.com/file/d/0B__Rs5JF53-kckJyak1BVnBtTEE/edit) for the 7"
    Touch Screen. I flashed the image on to the SD card using ApplePi-Baker. The image copied well with no errors.
    However, when i boot my RaspberryPi it shows a KDB error. Entering kdb (current=oxc7848c80, pid 1) due to
    Keyboard Entry
    kdb >

    Is it because the SD Card was not flashed properly? Your help will be appreciated.

    ReplyDelete
    Replies
    1. Hi!

      Maybe you haven't flashed properly. Please use sync to be sure that the copy operation is finished(if you are using dd on linux).
      Also, please use the latest image from here(https://drive.google.com/folderview?id=0B__Rs5JF53-kWV9SYlIwcnZZY28&usp=sharing&tid=0B__Rs5JF53-kVk03SGQ5OWY4Z0k#list)
      All images were tested.

      Delete
  59. Thank You Andrei. Let me try re-flashing. One more help. I tried the OpenElec image as well, i get this error
    ** Error in prepare_sysroot: mount-common: could not mount /flash/SYSTEM ***
    Are there any new images for OpenElec?

    ReplyDelete
    Replies
    1. I don't have other OpenELEC images and also haven't used mine more than once.

      Delete
  60. Hi Andrei,

    I tried your new image (https://drive.google.com/folderview?id=0B__Rs5JF53-kWV9SYlIwcnZZY28&
    usp=sharing&tid=0B__Rs5JF53-kVk03SGQ5OWY4Z0k#list) and it works fine. Just one thing i am not getting
    right is the axes. They get swapped. I tried swapping cables as well. How do i set it right ? I read some of the
    previous posts. Can you give me few quick steps to calibrate the files under (nano /usr/share/eGalaxCalibration
    /touchscreen_axes_calib) ?

    Thanks in advance.



    ReplyDelete
  61. Hi,
    very nice project !
    I would like to know if you image with included driver works with this item : http://cgi.ebay.fr/ws/eBayISAPI.dll?ViewItem&item=301021802646&ssPageName=STRK:MEWNX:IT&_trksid=p3984.m1497.l2649

    thanks a lot

    ReplyDelete
    Replies
    1. Hi,
      Please ask the seller which type of controller does this board has on it.
      I know that eGalax are working and I am sure that there are a lot of controllers supported by the linux kernel.

      Andrei

      Delete
    2. Hi,
      thanks for your repsonse, the manufacturer told me like you and hi gives me the link to download the egalax driver!
      other thing I'm looking for and I don't find it :
      how do you connect ACC to 12v to have automaticaly switch to AV2 for a reverse camera?
      have you a pic for an example?
      thank you !

      Delete
    3. Hi,
      Great, so it will work out of the box.
      Here is a schematic:
      ACC pin(on board) -> 100mA fuse(for safety) -> 12V+ from reverse light bulb

      Delete
    4. I have to configure that because I have a 5 inch screen, not a 7 inch as you.

      I will try with reverse light bulb but can I use thE 12V pin on J3 (power supply input connector)?

      Delete
    5. You need to link the reverse light bulb to the ACC pin to be sure that when you put the car into reverse the display will switch to AV2.
      As for powering the display controller, you can also use that pin.

      Delete
    6. Hi,

      ok, I will try tomorrow, next step : install linux driver eGalax and mount (try!) your xbmc image!

      Delete
  62. Could you just upload a img file from your sd card so we can download that and it works?

    Thanks,
    Harry

    ReplyDelete
    Replies
    1. You can get my images from the downloads link in the top right of this blog
      openCarPC Downloads link

      Delete
  63. Hi There Andrei,

    I love this project that you have put so much work into. I'm currently using this same touchscreen display and I have tried all 3 .img files using Win32DiskImager and Fedora Remix Installer. After it writes the image into the correct partitions on my SD card I plug it in. When it attempts to boot I get no video and just a single green flash from the ACT LED while the power LED remains lit and no other activity. I read from multiple sources that this could be from having a 512MB model instead of the 256MB model. Is this potentially the problem? Any help would be greatly appreciated.

    Thanks,

    Steve

    ReplyDelete
    Replies
    1. Actually I did get the beta from March 24th to boot. I am modifying some of the system right now since I personally don't have a GPS device for the Navit system. It's running great so far. I have not tried the touchscreen yet but I'm sure I'll get to that within the next two days. Thank you for this wonderful software!

      Delete
  64. I am trying to set the calibration to be permanent but i cannot find the file xorg.conf.d/99-calibration.conf, can you tell me how to make the calibration permanent i have used the image you've already made......thanks

    ReplyDelete
    Replies
    1. sudo nano /usr/share/X11/xorg.conf.d/01-input.conf

      Delete
  65. Hi There,

    Thank you for your info on this matter, I would really like to know how to calibrate the touchscreen for XBMC, I have a Raspbian+XBMC setup with a Newly compiled XBMC that I have installed, the touch screen works great within Raspbian, but now when I run xbmc one axle are swapped (Up=down, Down=UP, and it's not calibrated right, I have tried every google search I've found but nothing works, I have changed the values in eGalaxCalibration folder to see if it makes any difference but not even a bit. I have also done the following #if(strstr(m_deviceName, "eGalax") || strstr(m_deviceName, "Touch")) I added a # to this line if this is right to the comment in readme file, Excuse me but I'm not a linux user but are learning.. I have done the patch after I have compiled & installed XBMC. Any info will be appreciated.

    ReplyDelete
    Replies
    1. Hi !
      I have the same problem. have you found a solution?

      Delete
    2. Hi,
      Please use my latest image from June 2014, you can find it in the Downloads page in the top right corner of this blog. You need to go to the confluence skin and then use a keyboard to go to the programs, calibration plugin. After this the steps are straight forward. Yo can see more details in my latest post (http://www.engineering-diy.blogspot.ro/2014/04/raspberry-pi-carpc-april-2014-updates.html)

      Delete
  66. Hey !
    Thanks you for your tutorial Andrei
    But I'm stuck in the second step. I can not find the path to XBMC?
    Can you help me please ?

    ReplyDelete
    Replies
    1. XBMC source code can be obtained from their downlaods page or from xbmc git. Please have a look at my latest image from the downloads page, as I have the source files of XBMC Gotham 13.1 in the home folder.

      Delete
    2. Andrei thank you, I could not find the directory because I had just installed xbmc with "apt-get install xbmc".
      Thank you again

      Delete