PDA

View Full Version : Calibrate a MouseMan touchscreen on Qt4 Embedded



RazZziel
21st February 2012, 20:57
Hi, I'm working with Qt 4.8.0, on a BeagleBoard with Angstrom, with a fullscreen framebuffer app.

I'm using a Zytronic BTC_ZXY100-U-OFF-32-A USB touch panel, which doesn't have official drivers for Linux/ARM, but is recognized as a HID device



[ 1540.102661] usb 1-2.7: new full speed USB device number 12 using ehci-omap
[ 1540.231018] usb 1-2.7: New USB device found, idVendor=14c8, idProduct=0005
[ 1540.242492] usb 1-2.7: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[ 1540.253906] usb 1-2.7: Product: Zytronic Touchscreen Controller
[ 1540.265319] usb 1-2.7: Manufacturer: Zytronic Displays Limited
[ 1540.298248] input: Zytronic Displays Limited Zytronic Touchscreen Controller as /devices/platform/usbhs-omap.0/ehci-omap.0/usb1/1-2/1-2.7/1-2.7:1.0/input/input9
[ 1540.322875] generic-usb 0003:14C8:0005.0008: input: USB HID v1.01 Mouse [Zytronic Displays Limited Zytronic Touchscreen Controller] on usb-ehci-omap.0-2.7/input0

root@beagleboard:~# ls -l /dev/input/by-id
...
lrwxrwxrwx 1 root root 9 Nov 19 11:30 usb-Zytronic_Displays_Limited_Zytronic_Touchscreen_Con troller-event-mouse -> ../event6
lrwxrwxrwx 1 root root 9 Nov 19 11:30 usb-Zytronic_Displays_Limited_Zytronic_Touchscreen_Con troller-mouse -> ../mouse2


When I launch my Qt application, both my touchscreen and my USB mouse work, but the touchscreen is badly miscalibrated. Trying different QWS_MOUSE_PROTO drivers, MouseMan seems the only protocol that works. Does anyone know how to calibrate a MouseMan touchscreen?

I tried to use ts_calibrate, but it says it doesn't understand the APP, and exits right away


root@beagleboard:~# export TSLIB_TSDEVICE=/dev/input/mouse2
root@beagleboard:~# ts_calibrate
xres = 1280, yres = 800
selected device is not a touchscreen I understand
Took 2 samples...
Top left : X = -546217868 Y = -546217749
Took 2 samples...
Top right : X = -546217868 Y = -546217749
Took 2 samples...
Bot right : X = -546217868 Y = -546217749
Took 2 samples...
Bot left : X = -546217868 Y = -546217749
Took 2 samples...
Center : X = -546217868 Y = -546217749
-2.632812 -5.445312 5.429688
-1.445312 -3.398438 3.390625
Calibration constants: -172544 -356864 355840 -94720 -222720 222208 65536


Regarding those "Took 2 samples...", I don't know what samples it's talking about, I can't even touch the screen at all before the program quits.

I tried ts_calibrate because it's the only calibration utility I know for the framebuffer, but tslib doesn't seem to have future for me, because running the application with QWS_MOUSE_PROTO=tslib:/dev/input/mouse2 doesn't recognice any touch at all, while with MouseMan at least it recognizes touch, although it's miscalibrated.

RazZziel
23rd February 2012, 09:08
I'm following the MouseMan route, because the touchscreen is perfectly recognized, but I just can't seem to be able to calibrate it.

I don't know of any utility to calibrate an HID touchscreen, so I followed this example: http://developer.qt.nokia.com/doc/qt-4.8/qws-mousecalibration.html

Does anybody know if there's anything I need to implement in that example to actually make it work? Because it consistently fails to calibrate my touchscreen. I've tried both running the example binary, and integrating the calibration procedure in my program.

schelem
26th February 2012, 22:20
hey RazZziel,

sorry i have currently no answer for you but i have the same product by the usb idvendor/idproduct.
but actually i got no idea which driver i should use for it



[ 1540.298248] input: Zytronic Displays Limited Zytronic Touchscreen Controller as /devices/platform/usbhs-omap.0/ehci-omap.0/usb1/1-2/1-2.7/1-2.7:1.0/input/input9
[ 1540.322875] generic-usb 0003:14C8:0005.0008: input: USB HID v1.01 Mouse [Zytronic Displays Limited Zytronic Touchscreen Controller] on usb-ehci-omap.0-2.7/input0
i dont get these lines, except these which i didnt quote. you know which kernel module is responsible for that ? a grep on idvendor/idproduct on the linux kernel source did nothing for me (except the 0003 product from zytronic in usbtouchscreen.c).
or do you use the drivers from touch-base.com (updd)? how did you get those working on arm ?

RazZziel
27th February 2012, 00:12
hey RazZziel,
i dont get these lines, except these which i didnt quote. you know which kernel module is responsible for that ? a grep on idvendor/idproduct on the linux kernel source did nothing for me (except the 0003 product from zytronic in usbtouchscreen.c).

No idea, but it must be inside my kernel, because today I realized I'm loading a 3.0 uImage in an Angstrom with a 2.6 kernel installed, so modules are not loading. Tomorrow I'll fix it and try to figure it out.


or do you use the drivers from touch-base.com (updd)? how did you get those working on arm ?

They currently don't provide ARM drivers. They will launch a binary for ARM in a few weeks, but only for X11. If I want to compile the driver myself, I must pay 5.000 GBP for the source code :\

I'm still trying to get the qt calibration example working, but no luck so far, looks like qt is ignoring any attempt at calibration :(

RazZziel
2nd March 2012, 00:08
Finally I went X11, where I can calibrate my screen with either xinput_calibrate, or with this driver: http://www.mega-nerd.com/Zytouch/