Touch screen calibration
#1
Question 
Hey everyone,
I've been browsing the internet back and forth for the last week to find an answer to my question, but so far I could not find one that really solved my problem.
I installed Raspbian with Kodi 14.1 on my Raspberry PI B+ (ver 1) and it works well, unless when I want to use my touch screen. The touch screen (Sainsmart 7 inch) works well in Raspbian, but as soon as I start Kodi the calibration is off and the y-axis is inverted.
I saw that other people had similar issues, but none of them was able to get a comprehensive answer.

Appreciate any feedback. Thanks.
Reply
#2
Hi Mustangguy

Did you get this fixed in the end, as I have been battling with this for the last few days.

Same/similar setup as yours, Sainsmart 7" with eGalaxy touch controller.

I have touch calibrated perfectly for X, but Kodi no.

Y was inverted, and I hacked this by swapping wires in the resistive connection cable.

X & Y both offset and scaling are out.

Have tried Kodi touch calibration plugin, but it does not work properly, actually at all.

Have manually created a touchscreen_axes_calib file, but it does not have effect no matter what values I plug in. I suspect this has been dropped or replaced with another config file?

My setup:
Raspbian wheezy
Kodi, 14.2

Any thoughts comments much appreciated.
Reply
#3
Hi blacq,
after some time, I was finally able to figure it out. I followed the steps below, let me know if that works for you.

###################################################################
Initial setup
###################################################################
Write image to SD card
Booting up with LAN attached
Going through initial raspi config
- Expanding File system
- Changing password
- boot into GUI
- Change Locale to en_US
- Change Timezone to EST
- Change keyboard layout to English US
- Change hostname
- Enable SSH
- Change Audio to use 3.5
- Update raspi-config tool

Running apt-get update
Running apt-get upgrade
Running rpi-update
Reboot


###################################################################
Fix inverted Y axis:
###################################################################
/usr/share/X11/xorg.conf.d/10-evdev.conf
add Option "InvertY" "true"

Section "InputClass"
Identifier "evdev touchscreen catchall"
MatchIsTouchscreen "on"
MatchDevicePath "/dev/input/event*"
Driver "evdev"
Option "InvertY" "true"
EndSection

###################################################################
Calibrate screen:
###################################################################
Use apt installer to download and install the “evtest” package.

2. Run evtest.

3. Evtest will list the attached input devices. Select the number of the device

4. Evtest will show some configuration data then pause, waiting for input.

5. Using your finger or a stylus, touch the very top left corner of the touch screen. You will see the evtest scrolling a series of data output with both ABS_X and ABS_Y lines, followed by numeric values:

Event: time 1374175747.420998, type 3 (EV_ABS), code 0 (ABS_X), value 484
Event: time 1374175747.421011, type 3 (EV_ABS), code 1 (ABS_Y), value 3364
6. Of these values, write down the lowest observed ABS_X value and the highest observed ABS_Y value.

7. Now repeat the process, but this time touch the lower right hand corner of the screen and write down the highest ABS_X value and the lowest ABS_Y.

8. Now open the 10-evdev.conf file we used in the last step and add the following to the previously created section: Option “Calibration” “minX maxX minY maxY”, substituting minX, etc., for the observed values from above. The resulting final text of this section should look like this (but of course with the values from your test):

Section "InputClass"
Identifier "elo touchscreen catchall"
MatchVendor "EloTouchSystems_Inc"
MatchDevicePath "/dev/input/event*"
Driver "evdev"
Option "InvertY" "true"
Option "Calibration" "449 3562 575 3412"
EndSection
9. Save the file, reboot, and now your cursor should follow your finger very closely.

###################################################################
Install Kodi
###################################################################
apt-get install kodi

###################################################################
Configuring touchscreen for Kodi
###################################################################

http://markamc.traki-iski.co.uk/raspberr...uchscreen/

exec ./input-read.py "/dev/input/event2" -D | ./input-create.py "configs/touchscreen.py"



Hope that helps.
Reply
#4
Hi Mustangguy

I too had ended up using the later part of your previous post to get touch calibration working for Kodi. For X things where pretty easy using xinput to apply calibration to X.

I did have a challenge finding a version of uinput_mapper that had a working touchscreen.py. I found this version to be valid, and applied the transform needed:
wget --no-check -O uimapper.tar.gz "https://docs.google.com/uc?export=download&id=0B4lrG9aRe-8Malg2VkM0YW1CT28"

At the moment touch calibration is working, albeit very sluggish using uimapper (I assume mostly down to sluggish python).

With confluence skin for Kodi, it is working ok, but for CarPC.skin it is not quiet right. I expect I will need to fiddle with Kodi's keyboard/mouse mapping to make it behave acceptably.

Once I have the mapping sorted, I might rewrite the uimapper in C to hopefully improve the responsiveness.
Reply
#5
Hi Mustangguy and blacq.
Help me please to solve this problem. I'm noob in unix. But I could install and configure Raspbian 2015-05-05 RetroPie and Kodi. The last thing to do is to solve the touch screen problem in Kodi (touch perfectly works in X configuring xorg.conf). Tried to follow http://markamc.traki-iski.co.uk/raspberr...uchscreen/, but i can't even install tslib (libts-0.0-0:armhf conflicts with tslib).
Could you please write steps and commands?

Thank you.

----------------------------------------------------------
Deleted libts. Installed ts_lib.... Tried uimapper package from http://markamc.traki-iski.co.uk/raspberr...uchscreen/ and package provided by blacq. Getting errors while exec(
Code:
FAIL MUCH?
Failed to open uinput
Traceback (most recent call last):
  File "./input-create.py", line 59, in <module>
    d = UInputDevice()
  File "/scripts/uinput-mapper/uinputmapper/cinput.py", line 194, in __init__
    raise OSError
OSError
Exception TypeError: 'argument must be an int, or have a fileno() method.' in <bound method UInputDevice.__del__ of <uinputmapper.cinput.UInputDevice object at 0x76ab7c50>> ignored

----------------------------------------------------------
Never mind. Compiled Kodi 14.2 on Raspbian 2015-05-05 following this tutorial http://arendwierks.blogspot.nl/p/touchsc...-kodi.html
God, bless the author of instruction.
Reply
#6
One more solution: http://forum.kodi.tv/showthread.php?tid=162608
Reply
 
Thread Rating:
  • 0 Vote(s) - 0 Average



Logout Mark Read Team Forum Stats Members Help
Touch screen calibration00