Tuesday, February 26, 2013

Raspberry PI, Raspbian, XBMC and eGalax 7 inch touchscreen

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):

4. Touchscreen calibration.
Create a new file /home/pi/touchscreen_axes_calib on Raspberry PI. It will contain 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 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:

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 /home/pi/touchscreen_axes_calib file.

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

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).

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.

If the item is not available any more, you can find it by searching forHDMI+VGA+2AV Driver boardYou 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.

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.

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.

As I see from your xorg config,calib_x_fact = 1440 / (1818 - 80) = 0.82853855 or 1440 / (1816 - 72) = 0.825688073calib_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?

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?

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.

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.

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.

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'm experiencing the same click-issue. Provided Andrei with the log already.

HDMI was problematic, but I managed to solve that by using a differentcable. 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.

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

If you put a - calib_y_fact you geteg. 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_dSo 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.

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?

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)

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.

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)

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.cppif(strstr(m_deviceName, "eGalax") || strstr(m_deviceName, "Touch"))

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 7213for x used -0.133333333 as factor and 1230 as offsetfor y used -0.110573601 as factor and 750 as offsetalignment is a little bit off at the corners, will fix it later. Only still problems with drag and click :-(

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.hI will investigate them and try to answer as quick as possible.

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

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.

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

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'

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

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

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!

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!

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.

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 :)

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.

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 pisudo initctl stop xbmcsudo tar -xzf xbmc-rbp*.tar.gz -C /optsudo 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

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)

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?

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.

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

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.

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.

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-/121058156106you 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.

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.

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.

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.

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.

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

Sorry but I don't have any patches for xbmc 12.1If 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

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!

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

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

Hey AndreiI 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

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

Jasmin, my output from xinput_calibrator was like this:Section "InputClass" Identifier "calibration" MatchProduct "eGalax Inc. USB TouchController" Option "Calibration" "1977 32 1893 131"EndSectionMy Screen width is 1280, so, my calib_x_fact is like this:1280/(1977-32)=0.658097686Maybe 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.xPlease 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).

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.

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.thanksjosh

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

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.

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!

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

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.htmlon chapters 4 and 5

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 166Values 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 defaultcalib_x_d=-1; - like you saidcalib_x_fact=-0.5580381471; - calculated value 1024/(1930-95) keeping the negative value like you saidcalib_y_d=768; - screen width like you saidcalib_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.

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.

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.

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 :)

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)

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.

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.

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.

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

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

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. :)

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.

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

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

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.

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?

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) ?

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

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 !

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.

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.

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!

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

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.

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)

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.

I'm unable to change around the cables for my monitor because they're directly wired into the back of it. Is there a software-only way of changing the axis around? I'm currently running the latest xbmc.Many thanks

Hi Andreivery very nice description. Everything runs perfect. I got only two little questions. I´d like to change the resolution of the loading video. Can you describe me where i can do it.Second question. I don´t need the navigation system. Can you describe mewhere i can take it out the autostart?I´d like to thank you for your tutorials.

The video size is 1280x720. If you need another resolution please speak to idorel@gmail.com, as he create it.To disable Navigation please edit the file /home/pi/StartCarPC and remove the lines with navit word. Also you can remove the navit folder in /home/pi

I installed your image and works fine, but I can not calibrate the screen, the lower margins are not. If I change the resolution to 1280x720, the lower margins appear, but when it finishes calibrating the screen, does not work well. Have any other image that might work for me? Thank you very much.

Nice work, but in my case the y-axis is mirrored. For example: if I touch the Radio-button, xbmc opens the Video Menu. Is there a point to change this issue in the "/home/pi/touchscreen_axes_calib"-file?

I have been fighting this for a week. Still cant get pi to accept input from the touch screen. Tried your kernel, and compiling my own. also tried your complete image, and your updates. when I try to install from your update as you said in another post, carpi install.sh it crashes. I once got it to boot to xbmc although I had no input. I tried your complete image and it won't boot.

I would like to thank you for the efforts you have made in writing this post and the download links you just provided. I am hoping the same best work from you in the future as well. Really the blogging is spreading its wings rapidly.CIVIL ENGINEERING BOOKS | free engineering books

Hi, i have an issue with eGalax touchscreen and navigationits only left click which is working but not draggingthough in debug log i see it differentiate click and dragginghave somebody dragging working in navigation?

i'm using image from http://raspicarprojekt.de/showthread.php?tid=736its jessie and kodi 15.2. using 7ways as navigation.

Come si attivano/installano, o bisogna ancora ricompilare il kernel?--------------------------------------------------------------I have the distro Raspbian Pixel when I read that there are drivers for eGalax display.How do you activate / install, or you have yet to rebuild the kernel?