Forum
eGalax touchscreen calibration - Printable Version

+- Forum (http://forum.xbian.org)
+-- Forum: Software (/forum-6.html)
+--- Forum: Configuration (/forum-17.html)
+--- Thread: eGalax touchscreen calibration (/thread-832.html)

Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15


RE: eGalax touchscreen calibration - Markamc - 9th Jul, 2013 02:21 AM

ts_calibrate generates the following file: /etc/pointercal

the order of the values generated depends on whether swap is active or not i.e. the end value is 1 or 0 for swap or no swap

For swap order is:-
xscale xymix xoffset yxmix yscale yoffset scaler Xres Yres swap

For no-swap order is:-
xymix xscale xoffset yscale yxmix yoffset scaler Xres Yres swap

At the moment I ignore the xymix and yxmix values, these account for misalignment of touchscreen, which is maybe what you can see? The swap value is automatically generated when it detects the situation.

If you need to change the xoffset/yoffset values. The values are large integers, the software divides by the scaler constant of 65536. So if you know the offset value you used to have the equation (old_offset * 65536) should give you the correct setting.

Not sure why you have a different offset, I was trying to get it to work automatically, maybe if I include the skew values it will work better for you.


RE: eGalax touchscreen calibration - brantje - 9th Jul, 2013 02:57 AM

Old config was this:
Code:
Center : X = 1002 Y = 1025
-76.956787 0.700770 0.000343
-55.800903 -0.012320 0.420659

touchscreen_axis_calib backup file
Quote:calib_x_d=1358;calib_x_fact=-0.700770;calib_y_d=775;calib_y_fact=-0.420659;swap_axes=0;

My pointercal file:
Quote:47419 111 -9640392 -260 27323 -3837576 65536 1240 720 0



RE: eGalax touchscreen calibration - Markamc - 9th Jul, 2013 04:46 AM

Think you have overscan on when running ts_calibrate 'xres=1240', this may give you the offset problem. anyhow,you can change the values in pointecal as follows:

Sorry about the formatting I can send spreadsheet if you like. You can try the final line as new pointercal file., if inverted axis just change the sign of the corresponding xscale / yscale values.
Code:
POINTERCAL                                    
xscale    xymix    xoffset    yxmix    yscale    yoffset        scaler    xres    yres    swap
47419    111    -9640392    -260    27323    -3837576    65536    1240    720        0
values/scaler                                    
0.724    0.0017    -147.10    -0.004    0.417    -58.557            
                                    
OLD CALIB FILE                                    
calib_x_d=1358;calib_x_fact=-0.700770;calib_y_d=775;calib_y_fact=-0.420659;swap_axes=0;                                    
xscale        xoffset    yscale        yoffset
-0.70077    -78        -0.420659    -55                
old calib * scaler                                    
-45925.66272        -5111808        -27568.30822    -3604480                
new pointercal                                    
xscale    xymix    xoffset        yxmix    yscale    yoffset        scaler    xres    yres    swap


-45926    111        -5111808    -260    -27569    -3604480    65536    1240    720        0



RE: eGalax touchscreen calibration - brantje - 9th Jul, 2013 05:09 AM

Ty that worked!.
The y is abit (about 4-8 pixels) down, bit i can live with that.
Bug to squeeze: Dragging scrollbars causes a go back (aka right click)
So maybe a min_presstime and a max_press time?


RE: eGalax touchscreen calibration - Markamc - 9th Jul, 2013 05:21 AM

old file
47419 111 -9640392 -260 27323 -3837576 65536 1240 720 0

new file
-45926 111 -5111808 -260 -27569 -3604480 65536 1240 720 0

if you need to, check the signs the scale values, they're not that different, you can see the 'x-offset' is....like I said the clue is when ts_calibrate was executed the resolution was 1240 x 720

you can change the press-time for right click (<=0.5secs), there is a time check and a range check so if no-move it will right_click on release

If you want to play with the values, check the file end of the file input-create.py in /scripts/uinput-mapper/
Code:
sudo nano  /scripts/uinput-mapper/input-create.py
you can see the value of 0.5 in the check at the end.

or if to sensitive then change the range check value in the same place:

Code:
if inrange <= 400:
            if holdtime > 0.20 and holdtime <= 0.50:
...
...
...
...
            if holdtime > 0.50:


NB. it's python, so code spacing is important!

then you need to restart uimapper by re-plugging usb or

Code:
stop xbmc
stop uimapper
start uimapper
start xbmc



RE: eGalax touchscreen calibration - brantje - 9th Jul, 2013 05:44 AM

Yea, that where the 4px.
I didn't need the - sign i removed them.

Also modified the input-create.py abit to squeeze the bug i mentioned.

Code:
if inrange <= 400:
            if holdtime > 0.20 and holdtime <= 0.50:
                rev.code = BTN_TOUCH
                rev.value = 1
                d.fire_event(rev)
                rev.value = 0
                d.fire_event(rev)
            if holdtime > 0.50 and holdtime <= 1.50:
                rev.code = BTN_RIGHT
                rev.value = 1
                d.fire_event(rev)
                rev.value = 0
                d.fire_event(rev)
            if holdtime > 1.5:
                rev.code = BTN_TOUCH
                rev.value = 1
                d.fire_event(rev)
                rev.value = 0
                d.fire_event(rev)
This prevents going back when in a list using the scrollbar


RE: eGalax touchscreen calibration - Markamc - 9th Jul, 2013 05:56 AM

cool, not noticed the problem but good work.. I'll update the code online also.


RE: eGalax touchscreen calibration - brantje - 9th Jul, 2013 06:01 AM

Maybe an github is an idea?


RE: eGalax touchscreen calibration - Markamc - 9th Jul, 2013 06:18 AM

Never done one before, It's all new to me!..

it's based on uinput-mapper from Merlijn git as mentioned on my tutorial, he is still changing his code with a view to injecting events; this a solution until he can add the extra functionality to the config file. (a proof in principle)

If it's a little laggy, you can change the 'nice' value in the /etc/init/uimapper.conf file the more negative the higher the prority


RE: eGalax touchscreen calibration - brantje - 9th Jul, 2013 06:21 AM

Well, a github is quite handy in this case, since more then 2 people are working on it.
Maybe this can help you with github.
If you want, i can setup an github.


RE: eGalax touchscreen calibration - Markamc - 9th Jul, 2013 06:43 AM

I'm happy if you want to, I've been playing with it for ages and soon may need to refit the car radio , or buy another touchscreen!

I think Merlijn, will be ok also.


RE: eGalax touchscreen calibration - brantje - 9th Jul, 2013 07:03 AM

(9th Jul, 2013 06:43 AM)Markamc Wrote:  I'm happy if you want to, I've been playing with it for ages and soon may need to refit the car radio , or buy another touchscreen!

I think Merlijn, will be ok also.
All files at your site are up to date? (includes my 'patch')
Then i will make an xbian-touch git


RE: eGalax touchscreen calibration - Markamc - 9th Jul, 2013 07:04 AM

give me a minute....just updating, think there was a problem with the holdtime = 0 spacing...bloody windows


RE: eGalax touchscreen calibration - brantje - 9th Jul, 2013 07:15 AM

(9th Jul, 2013 07:04 AM)Markamc Wrote:  give me a minute....just updating, think there was a problem with the holdtime = 0 spacing...bloody windows
Why use windows if linux has doors?
Oh.. indeed holdtime has tabs instead of spaces


RE: eGalax touchscreen calibration - Markamc - 9th Jul, 2013 07:29 AM

yup, fixed it and added your changes...i am trying to changeover to linux but,atm I need CADCAM etc for my work...