Pages

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:  I have uploaded my image with XBMC 12 build with eGalax touchscreen support(download it from here, with md5sum c59330154143d9e5e43217322bbd92ce). It seems that you need to request permission and I will give you access. The account is pi and 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).

4. 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 will calculate the distance between these two points and will find out that this is greater than 5.
(100-0)x(100-0) + (300 - 0)x(300-0) is greater than 5x5
This works 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).

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!

67 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
  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
  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
  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
  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
  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