Forum

Full Version: eGalax touchscreen calibration
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
I was thinking of a window's 8 style skin, perfect for touchscreens =)
I have emailed Merlijn, creator of uinput-mapper, he is adding some changes to the code and advising the best way to create a 'config file' including the changes I have made for the egalax TS.

I now read the data from the ts_calibrate 'pointercal' file, just need to clean a few things up, with help from Merlijn and then can provide details of my solution

cheers

mark
Aka, no more messing with swapping values orso?
You read ts_calibrate output, and then create a config file by yourself?
Because my values where not on the given point.


Italic is your position of the config values, bold are mine

Center : X = 1002 Y = 1025
-76.956787 0.700770 0.000343
-55.800903 -0.012320 0.420659
Those are the values dumped on screen, and not the values inside etc/pointercal file. The ones in the file are different
file contents looks like this

42243 -174 -1212176 -45 25869 -4009392 65536 1280 720

values and equations are

xscale xymix xoffset yxmix yscale yoffset scaler

Xs = (Xt*xscale + Yt*xymix + xoffset)/scaler
Ys = (Xt*yxmix + Yt*yscale + yoffset)/scaler
FEEDBACK: It's late I know....for me anyway

I have made a .deb file for ts_calibrate with some mods....
tslib_1-1_armhf.deb (63 KB)
https://mega.co.nz/#!jY8inK5I!bPop2Da3NqXVVrniElhL_3ArVv8V24oAvnbPJTUEcGs

typing....
Terminal
sudo dpkg -i tslib_1-1_armhf.deb

should install ok....

Next download the bash script ts_calib.sh and edit /dev/input/event# number to the touchscreen device on your system ...hence

Terminal
nano ts_calib.sh

Terminal

#!/bin/bash
export LD_LIBRARY_PATH=/usr/local/lib
export TSLIB_CONSOLEDEVICE=none
export TSLIB_FBDEVICE=/dev/fb0
export TSLIB_TSDEVICE=/dev/input/event2 <-----------*********CHANGE
export TSLIB_CALIBFILE=/etc/pointercal
export TSLIB_CONFFILE=/usr/local/etc/ts.conf
export TSLIB_PLUGINDIR=/usr/local/lib/ts
ts_calibrate

Now run the script..

Terminal
sudo sh ts_calib.sh

Hopefully now you have a pointercal file in /etc which will be necessary for the next part....

TBC
(1st Jul, 2013 07:18 PM)Markamc Wrote: [ -> ]Tutorial: Screen calibration and addition features for Xbian1.0Beta1

You're the number 1 Big Grin
Hi!

I am the author for the eGalax fixes and I have made some new patches for XBMC12.2(download link). It was tested with the following scenarios:
1. Raspbian OS(2.Feb.2013), custom kernel 3.6.11(with eGalax module), XBMC 12.2
2. XBian 1.0 Beta 1
In both cases touch screen was working fine, which means:
- good calibration
- click with a single tap
- drag(scrollbars)
To achieve this you will have to build XBMC either on Raspbian or on XBIAN systems. I will try to make an image and post it and also a video.
Information about the build process can be found at:
http://www.engineering-diy.blogspot.ro/2013/02/raspberry-pi-raspbian-xbmc-and-egalax-7.html
Koenkk, can you please add this fix to XBIAN?

Regards,
Andrei
This is good news, although hard-coding a solutions can have side-effects on other device functionality, please correct me if I'm wrong?

I understand it applies the calibrations to the pointer position (if egalax or calib file exists), but will the 'patch' change the click and drag functionality? even when using mouse, or my alternative method? not sure it will suit all, unless you have the option to enable/disable

cheers

mark
(8th Jul, 2013 06:56 PM)Markamc Wrote: [ -> ]This is good news, although hard-coding a solutions can have side-effects on other device functionality, please correct me if I'm wrong?

I understand it applies the calibrations to the pointer position (if egalax or calib file exists), but will the 'patch' change the click and drag functionality? even when using mouse, or my alternative method? not sure it will suit all, unless you have the option to enable/disable

cheers

mark

If we want it buildin in xbian then we have to make such an enable/disable touchscreen module.
(8th Jul, 2013 06:56 PM)Markamc Wrote: [ -> ]This is good news, although hard-coding a solutions can have side-effects on other device functionality, please correct me if I'm wrong?

I understand it applies the calibrations to the pointer position (if egalax or calib file exists), but will the 'patch' change the click and drag functionality? even when using mouse, or my alternative method? not sure it will suit all, unless you have the option to enable/disable

cheers

mark
The fix applies calibration whether the file exists or not.
calibration:
It affects just absolute touches(ABS_X and ABS_Y), which are generated by a touchscreen device. Mouse generates relative events (REL_X, REL_Y) which are not affected.
click vs drag:
I don't think this will be affected, because what this patch does is when user issues a press event(and XBMC will get alot of events for a single tap/click) the first touch is being ignored and when the second touch comes this is not ignored any more and distance from the previous touch is calculated and XBMC decides if it is a click or a drag action.
So I don't think this will affect mouse more than loosing the first press event(but I don't think somebody can click as fast as this can be observed).
More details about this implementation can be read on my blog post,part 5:
http://www.engineering-diy.blogspot.ro/2013/02/raspberry-pi-raspbian-xbmc-and-egalax-7.html

Regards
Ok Andrei, I must test it again, since the 'click' didn't work for me originally (MOUSEDRAG issue). Maybe if you post an *.img file I can check.

Originally, your calibration patch worked but the the 'click' function wouldn't at all, hence why I removed it and used the calibration only with the modified patch, I then looked for a more automatic calibration solution (ts_calibrate) to provide a calib file, BTN_RIGHT and 'single press' functionality at input-event level outside XBMC.

If your new 'patch' is permanently added then my solution will not work since you will affect my touchscreen behavior internally in XBMC. I think it might be better to give the 'user' a choice somehow whether or not to use the hard-coded solution, if it is to be permanently patched.
(8th Jul, 2013 10:41 PM)Markamc Wrote: [ -> ]Ok Andrei, I must test it again, since the 'click' didn't work for me originally (MOUSEDRAG issue). Maybe if you post an *.img file I can check.

Originally, your calibration patch worked but the the 'click' function wouldn't at all, hence why I removed it and used the calibration only with the modified patch, I then looked for a more automatic calibration solution (ts_calibrate) to provide a calib file, BTN_RIGHT and 'single press' functionality at input-event level outside XBMC.

If your new 'patch' is permanently added then my solution will not work since you will affect my touchscreen behavior internally in XBMC. I think it might be better to give the 'user' a choice somehow whether or not to use the hard-coded solution, if it is to be permanently patched.
Mark, this would be a nice feature to have in XBMC, but at this moment I don't know how to interact from the code with the settings from XBMC.
I will try to upload my image as soon as I go home(in about 3 hours).

Best Regards,
Andrei
Maybe you can set a value in your calib file and only use your code if this condition is set? Then there is a choice for the user.

I would still like to use my solution at the moment, it gives me the control I need, I can change code easily without touching XBMC and it doesn't affect anything for anyone else. Plus it will work for future releases of XBMC, version 13 being round-the-corner.
(8th Jul, 2013 11:05 PM)Markamc Wrote: [ -> ]Maybe you can set a value in your calib file and only use your code if this condition is set? Then there is a choice for the user.

I would still like to use my solution at the moment, it gives me the control I need, I can change code easily without touching XBMC and it doesn't affect anything for anyone else. Plus it will work for future releases of XBMC, version 13 being round-the-corner.

I just installed your method, although calibration was done, there is a small offset to the left.
Everything else works! Right click, normal click. So where can i change the calibx value?
Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
Reference URL's