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 - ph87 - 16th Aug, 2013 10:12 AM

My evtest:
Code:
/dev/input/event0:      Chicony USB Keyboard
/dev/input/event1:      Chicony USB Keyboard
/dev/input/event2:      N-Trig Pen
/dev/input/event3:      N-Trig MultiTouch
/dev/input/event4:      N-Trig Touchscreen
/dev/input/event5:      uimapper - touchscreen

My /etc/init/uimapper.conf
Code:
env UIMAPPER_DEV="/dev/input/event3"
install.sh
Code:
XBian touch installer by brantje
Already installed... Recalibrating
Listing event devices
lrwxrwxrwx 1 root root 9 Jan  1  1970 usb-Chicony_USB_Keyboard-event-if01 -> ../event1
lrwxrwxrwx 1 root root 9 Jan  1  1970 usb-Chicony_USB_Keyboard-event-kbd -> ../event0
lrwxrwxrwx 1 root root 9 Jan  1  1970 usb-N-trig_DuoSense_11.20.10.53.16-event-if01 -> ../event3
lrwxrwxrwx 1 root root 9 Jan  1  1970 usb-N-trig_DuoSense_11.20.10.53.16-event-mouse -> ../event2
lrwxrwxrwx 1 root root 9 Jan  1  1970 usb-N-trig_DuoSense_11.20.10.53.16-if01-event-mouse -> ../event2
What is the event number of the touchscreen? eg: event0 then you type 0, followed by [ENTER]

calibration does only work with 3 neither with 2 nor 4...
install.sh has still no effect...



When you want some Information please tell!!! Maybe I've confused you and did something wrong...

I thank very very much for your help!!!


RE: eGalax touchscreen calibration - Markamc - 16th Aug, 2013 10:18 AM

when you select event 5 in evtest can you get any output for touchscreen ABS_X and Y?

can you see in evtest which event gives feedback for touchscreen ABS_X & Y, when uimapper is stopped, is it event3?


RE: eGalax touchscreen calibration - ph87 - 16th Aug, 2013 10:22 AM

evtest Output with event5
Code:
Event: time 1376613295.596358, -------------- SYN_REPORT ------------
Event: time 1376613295.605528, type 3 (EV_ABS), code 0 (ABS_X), value 526
Event: time 1376613295.605528, type 3 (EV_ABS), code 1 (ABS_Y), value 314
Event: time 1376613295.605528, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 3983
Event: time 1376613295.605528, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 3127
Event: time 1376613295.605528, type 3 (EV_ABS), code 52 (ABS_MT_ORIENTATION), value 0
Event: time 1376613295.605528, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 635
Event: time 1376613295.605528, type 3 (EV_ABS), code 49 (ABS_MT_TOUCH_MINOR), value 533
Event: time 1376613295.605528, ++++++++++++++ SYN_MT_REPORT ++++++++++++

When I stop uimapper then does only event3 work in evtest

uimapper stopped and evtest with event3
Code:
Event: time 1376612887.937197, -------------- SYN_REPORT ------------
Event: time 1376612887.947203, type 3 (EV_ABS), code 0 (ABS_X), value 3546
Event: time 1376612887.947203, type 3 (EV_ABS), code 1 (ABS_Y), value 3927
Event: time 1376612887.947203, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 3546
Event: time 1376612887.947203, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 3927
Event: time 1376612887.947203, type 3 (EV_ABS), code 52 (ABS_MT_ORIENTATION), value 1
Event: time 1376612887.947203, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 355
Event: time 1376612887.947203, type 3 (EV_ABS), code 49 (ABS_MT_TOUCH_MINOR), value 211
Event: time 1376612887.947203, ++++++++++++++ SYN_MT_REPORT ++++++++++++

Thanky you very much again!!!
But now I've to go to bed! I've to go up early and it's 2:36... Hope I'll have time tomorrow...


RE: eGalax touchscreen calibration - Markamc - 16th Aug, 2013 10:35 AM

Yes, if uimapper is running it grabs 'exclusively' the event you have in uimapper.conf, in your case event3.

Your output from evtest (uimapper event5) seems to change the ABS_X/Y etc, but not the (ABS_MT_POS)

See what the values are for top left and bottom right for the ABS_X/Y, these are the values that uimapper changes and xbmc uses, I still think the problem is that xbmc is grabbing the device and stopping uimapper from applying the calibration


RE: eGalax touchscreen calibration - ph87 - 16th Aug, 2013 10:40 AM

Last post this night...

Top left:
Code:
Event: time 1376613528.965423, -------------- SYN_REPORT ------------
Event: time 1376613528.974655, type 3 (EV_ABS), code 0 (ABS_X), value 16
Event: time 1376613528.974655, type 3 (EV_ABS), code 1 (ABS_Y), value 25
Event: time 1376613528.974655, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 122
Event: time 1376613528.974655, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 170
Event: time 1376613528.974655, type 3 (EV_ABS), code 52 (ABS_MT_ORIENTATION), value 0
Event: time 1376613528.974655, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 423
Event: time 1376613528.974655, type 3 (EV_ABS), code 49 (ABS_MT_TOUCH_MINOR), value 355
Event: time 1376613528.974655, ++++++++++++++ SYN_MT_REPORT ++++++++++++

bottom right:
Code:
Event: time 1376613600.077752, -------------- SYN_REPORT ------------
Event: time 1376613600.086902, type 3 (EV_ABS), code 0 (ABS_X), value 1262
Event: time 1376613600.086902, type 3 (EV_ABS), code 1 (ABS_Y), value 710
Event: time 1376613600.086902, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 9550
Event: time 1376613600.086902, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 7167
Event: time 1376613600.086902, type 3 (EV_ABS), code 52 (ABS_MT_ORIENTATION), value 0
Event: time 1376613600.086902, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 423
Event: time 1376613600.086902, type 3 (EV_ABS), code 49 (ABS_MT_TOUCH_MINOR), value 355
Event: time 1376613600.086902, ++++++++++++++ SYN_MT_REPORT ++++++++++++

Thanky you very much again!!!
But now I've to go to bed! I've to go up early and it's 2:40... Hope I'll have time tomorrow...


RE: eGalax touchscreen calibration - Markamc - 16th Aug, 2013 10:43 AM

Ok, so the values are good and uimapper is generating them, so I think we need to make xbmc grab the device and then maybe all ok

goodnight my friend

---------------------------------------------

PM'd you with something to test


RE: eGalax touchscreen calibration - brantje - 17th Aug, 2013 06:51 PM

I wonder why uimapper isn't starting.

Edit:
marc, if i plug in an usb drive, and remove it, than uimapper is stopped.
Is there an way to keep it running?


RE: eGalax touchscreen calibration - Markamc - 18th Aug, 2013 02:35 AM

(17th Aug, 2013 06:51 PM)brantje Wrote:  I wonder why uimapper isn't starting.

Edit:
marc, if i plug in an usb drive, and remove it, than uimapper is stopped.
Is there an way to keep it running?

Hi Branjte,

Uimapper will respawn and should pick event before xbmc does, i can get reconnected when I unplug and replug. Problem is once xbmc has grabbed a device it needs to lose it so uimapper can get it again. If the event number changes (i.e. with new device added) then this can pose a problem. I have rewritten some code for the conf file that auto-selects the eGalax event number, works for only one entry for eGalax though (sometimes on some distros there are more than one event no. listed for device). Fortunately only one event on xbian though.

See here...
http://markamc.cybaman.net/?p=50#comment-77

If you can see a way to mod the code then it would be good, once the calib is done , it only needs to monitor correct event for device. This latest uimapper.conf works for me atm, I am testing.


RE: eGalax touchscreen calibration - brantje - 20th Aug, 2013 10:28 PM

I'm busy with a nice touch skin: TouchFluence


RE: eGalax touchscreen calibration - raspuca - 26th Aug, 2013 12:10 AM

I like your TouchFluence skin! Good job! Smile


Possible Solution to make it work on N-TRIG Multitouchscreens - ph87 - 27th Aug, 2013 02:05 AM

Hello guys,

finally I've got make it work on my Multitouchscreen (same type as you can get from chalc-elec [10"]). While swiping the pointer is a bit laggy but it works great with a Touch-skin where you don't have to swipe Blush

At first this is not my work!!! Nearly all scripts and hints were made my brantje and Markamc (thank you very much for your very good and fast support!)
-Thank you very much!!!!

So that is what you have to do (this worked for me):

Terminal

wget https://github.com/brantje/xbian-touch/raw/master/install.sh

sudo sh install.sh

stop uimapper
stop xbmc

wget --no-check -O uimapper.tar.gz "https://docs.google.com/uc?export=download&id=0B4lrG9aRe-8MWXUtaktRbWVFdDA"

sudo mkdir -p /scripts && tar -zxvf uimapper.tar.gz -C /scripts

Next step:
Terminal

evtest

No device specified, trying to scan all of /dev/input/event*
Not running as root, no devices may be available.
Available devices:
/dev/input/event0: Chicony USB Keyboard
/dev/input/event1: Chicony USB Keyboard
/dev/input/event2: N-Trig Pen
/dev/input/event3: N-Trig MultiTouch
/dev/input/event4: N-Trig Touchscreen
Select the device event number [0-4]:
And keep the event numbers for Mltitouch and Touchscreen in you mind (for me 3 & 4)

Now open uimapper.conf:
Terminal
sudo nano /etc/init/uimapper.conf
Edit it as shown:
Terminal
#!upstart
description "uimapper"


env UIMAPPER_DEV="/dev/input/event3" <-------- Put in here your event Number for Multitouch
env UIMAPPER_CONF="configs/multitouch.py" <-------- change to multitouch.py
env UIMAPPER_DIR="/scripts/uinput-mapper"

start on (input-device-added SUBSYSTEM=input)

stop on input-device-removed

nice -10

kill timeout 1

expect fork

script
chdir $UIMAPPER_DIR
exec ./input-read.py $UIMAPPER_DEV -D | ./input-create.py $UIMAPPER_CONF &
exec ./input-read.py "/dev/input/event4" -D & <--------Add this line with your event Number for Touchscreen

end script
respawn

Now we have to reduce the tine for the touch-events (it's a capacitive touchscreen so it's more sensitive):
Terminal
nano /scripts/uinput-mapper/input-create.py
and change a value at nearly end of the script:
Terminal
if inrange <= 400:
if holdtime > 0.02 and holdtime <= 0.50:

Okay that must be all...
Now just run:
Terminal
cd ~
sudo sh install.sh

XBian touch installer by brantje
Already installed... Recalibrating
Listing event devices
lrwxrwxrwx 1 root root 9 Jan 1 1970 usb-Chicony_USB_Keyboard-event-if01 -> ../event1
lrwxrwxrwx 1 root root 9 Jan 1 1970 usb-Chicony_USB_Keyboard-event-kbd -> ../event0
lrwxrwxrwx 1 root root 9 Jan 1 1970 usb-N-trig_DuoSense_11.20.10.53.16-event-if01 -> ../event3
lrwxrwxrwx 1 root root 9 Jan 1 1970 usb-N-trig_DuoSense_11.20.10.53.16-event-mouse -> ../event2
lrwxrwxrwx 1 root root 9 Jan 1 1970 usb-N-trig_DuoSense_11.20.10.53.16-if01-event-mouse -> ../event2
What is the event number of the touchscreen? eg: event0 then you type 0, followed by [ENTER]
Type always the event Number of the Multitouch which you have in your mind and follow the instructions on the screen. Sometimes for me the install.sh showed the wrong event Number and also you can't really recognize which one the Multitouch is - don't know why!
Calibrating does only work with the event Number which I've mentioned above...

Hope this works for you ----

Regards,
ph87


RE: eGalax touchscreen calibration - brantje - 27th Aug, 2013 08:55 PM

Marc, the ui-mapper is updated? If so, then i will place a new package on git, or i give you access.

May i prestent: Touchfluence -> Please test it and report back =)


RE: eGalax touchscreen calibration - Markamc - 27th Aug, 2013 09:49 PM

(27th Aug, 2013 08:55 PM)brantje Wrote:  Marc, the ui-mapper is updated? If so, then i will place a new package on git, or i give you access.

May i prestent: Touchfluence -> Please test it and report back =)

Yep, I made updates to uimapper.tar.gz to fix bugs when changing resolution (may have been a conflict with xbmc patch).
It should only be necessary to calibrate once, now scaling the calibration values to suit different screen modes...(again, for me at least!! always a disclaimer!)

Some optional additions to uimapper.conf if you use a Ntrig, or other Multitouch device with many event entries. As explained above by ph87

I'll give it a go later. cheers. mark


AW: eGalax touchscreen calibration - ph87 - 28th Aug, 2013 12:46 AM

It's working for me... but should I still update your scripts? Are there some other improvements regarding speed or handling... whose can be important?


RE: eGalax touchscreen calibration - Markamc - 28th Aug, 2013 02:39 AM

(28th Aug, 2013 12:46 AM)ph87 Wrote:  It's working for me... but should I still update your scripts? Are there some other improvements regarding speed or handling... whose can be important?

I made some changes to touchscreen.py, I have your mutlitouch.py config included in the new uimapper.tar.gz file so if you leave the conf file it should still work ok. I need to compare the two config files to see differences.

It might be laggy since its reading two events from the TS, maybe I can find a way to grab all events but not read, I will look into the 'grab' code?

Your TS is a much higher resolution to, maybe this makes a difference.

No speed improvements atm though, just bugs with resolution changes and calibration. Also been looking into PyPy for speed improvements, a little busy at work so I have less time atm.

I'll keep you posted...

mark