I am running a SLES 9.0 guest on Centos Stream through Qemu/KVM.
Before going into the details: there is no possibility for me to upgrade the guest. It is running a dedicated hardware which only supports this kernel version (2.4.21).
SLES 9.0 sadly has no built-in support for the EvTouch USB tablet provided through Qemu. I googled a bit and found an open-source evtouch driver from Kenan Esau (http://www.stz-softwaretechnik.de/~ke/touchscreen/evtouch.html or http://www.conan.de/touchscreen/evtouch.html used to be one source...). The webpages are down, but the internet archive has copies of the first url which still contain the tarballs. This way I managed to get the precompiled and src packages of all versions except v0.87 for which I only found the sources.
I am trying to get the driver to work to support absolute pointing in the guest, which I need when connecting to the host via VNC. Without the table driver I cannot use the mouse in the guest over VNC (actually xrdp, but that doesn't matter).
---------------- UPDATE---------------
What have I've tried:
Originally SLES 9.0 came with XFree4.3.0.1. Installing the driver via xmkmf -a was missing XFree source files, so I was forced to get sources. The sources for 4.3.0 however did not contain all files that the driver tried to include.
Of the precompiled drivers I only managed to load the v0.8 version, however it wasn't working as the cursor remained stuck. There was no error in /var/log/XF86Free.0.log.
Hence I decided to upgrade XFree from the binaries of the Xfree ftp server (there were no respective packages for SLES 9). This worked wonderfully and now I have XFree 4.4.0.
Also, I now downloaded the 4.4.0 sources and tried to compile the driver myself.
After adding some additional include paths and copying 3 .def files and /usr/bin/revpath to the paths where make expected them I was in fact able to compile v0.8.0!!
XFree86.0.log now correctly mentions the driver being loaded and also that it was compiled for XFree4.4.0. The behavior however is the same as for the pre-compiled v0.8.0 - no error message, mouse not moving.
Interestingly, by copying the Imake-file I to the v0.8.8 sources and adding one further include (+ adapting the list of .c files), I even managed to compile the newest version for my device, but: SAME.
Skimming through the INSTALl file, I saw that I can also compile using DEBUG=y and LOG=y.
I did this and now I got at least some info in the /var/log/XFree86.0.log.
The relevant parts of the file are below:
(II) Module evtouch: vendor="Kenan Esau"
compiled for 4.4.0, module version = 0.8.8
Module class: XFree86 XInput Driver
ABI class: XFree86 XInput driver, version 0.4
EVTouch: EVTouchPreInit
State: S_UNTOUCHED Action: No Action Button: 0
State: S_TOUCHED Action: No Action Button: 0
State: S_LONGTOUCHED Action: down Button: 1
State: S_MOVING Action: No Action Button: 0
State: S_MAYBETAPPED Action: click Button: 1
State: S_ONEANDAHALFTAP Action: down Button: 3
(**) Option "MinX" "0"
(**) Option "MaxX" "32767"
(**) Option "MinY" "0"
(**) Option "MaxY" "32767"
(**) Option "Emulate3Buttons"
(**) Option "Emulate3Timeout" "50"
(diff/diff)=(0/0)
(diff/diff)=(0/0)
(diff/diff)=(0/0)
(diff/diff)=(0/0)
(diff/diff)=(0/0)
(diff/diff)=(0/0)
(diff/diff)=(0/0)
(diff/diff)=(0/0)
(diff/diff)=(0/0)
(**) Option "DeviceName" "touchscreen"
(**) Option "SendCoreEvents"
(**) touchscreen: always reports core events
(**) Option "CorePointer"
(**) touchscreen: Core Pointer
(**) Option "Protocol" "imps/2"
(**) Mouse: Device: "/dev/mouse"
(**) Mouse: Protocol: "imps/2"
(**) Option "CorePointer" "False"
(**) Option "Device" "/dev/mouse"
(**) Option "Buttons" "5"
(**) Mouse: Emulate3Buttons, Emulate3Timeout: 50
(**) Option "ZAxisMapping" "4 5"
(**) Mouse: ZAxisMapping: buttons 4 and 5
(**) Mouse: Buttons: 5
(II) XINPUT: Adding extended input device "Mouse" (type: MOUSE)
(II) XINPUT: Adding extended input device "touchscreen" (type: TOUCHSCREEN)
EVTouch: DeviceInit
EVTouch: Display X,Y: 1920 910
EVTouch: Virtual X,Y: 1920 910
EVTouch: DriverName, Rev.: vmware 657922
EVTouch: Viewport X0,Y0: 0 0
EVTouch: Viewport X1,Y1: 1919 909
EVTouch: MaxValue H,V: 0 0
EVTouch: DeviceInit btn_count=5
EVTouch: DeviceInit btn_count=5
(**) Option "Device" "/dev/input/event0"
EVTouch: DeviceOn
EVTouch: QueryHardware
(EE) touchscreen: Unable to grab device (Invalid argument).
EVTouch: DeviceOff
Changes to Imakefile
XFREE_TOP = /home/kmf/Desktop/xc
#INCLUDES = -I. -I$(XF86COMSRC) -I$(XF86SRC)/loader -I/home/kmf/Desktop/xc/programs/Xserver/hw/xfree86 \
# -I$(SERVERSRC)/include -I$(SERVERSRC) -I$(XINCLUDESRC) -I$(EXTINCSRC) -I/home/kmf/Desktop/xc/include
INCLUDES = -I. -I$(XFREE_TOP)/programs/Xserver/hw/xfree86/common \
-I$(XFREE_TOP)/programs/Xserver/hw/xfree86/loader \
-I$(XFREE_TOP)/programs/Xserver/hw/xfree86/os-support \
-I$(XFREE_TOP)/programs/Xserver/hw/xfree86/os-support/bus \
-I$(XFREE_TOP)/programs/Xserver/hw/xfree86/xf86cfg \
-I$(XFREE_TOP)/programs/Xserver/randr \
-I$(XFREE_TOP)/include \
-I$(XFREE_TOP)/programs/Xserver/include \
-I$(XFREE_TOP)/programs/Xserver/hw/xfree86 \
-I$(XFREE_TOP)/exports/include/X11 -I$(XFREE_TOP)/include/extensions \
-I/usr/X11R6/include
for 0.8.8 to compile also:
SRCS1 = evtouch.c libtouch.c
OBJS1 = evtouch.o libtouch.o
The make output is:
rm -f ev_calibrate.o
gcc -m32 -O2 -fno-strength-reduce -fno-strict-aliasing -ansi -pedantic -Wall -Wpointer-arith -Wundef -fno-merge-constants -I. -I/home/kmf/Desktop/xc/programs/Xserver/hw/xfree86/common -I/home/kmf/Desktop/xc/programs/Xserver/hw/xfree86/loader -I/home/kmf/Desktop/xc/programs/Xserver/hw/xfree86/os-support -I/home/kmf/Desktop/xc/programs/Xserver/hw/xfree86/os-support/bus -I/home/kmf/Desktop/xc/programs/Xserver/hw/xfree86/xf86cfg -I/home/kmf/Desktop/xc/programs/Xserver/randr -I/home/kmf/Desktop/xc/include -I/home/kmf/Desktop/xc/programs/Xserver/include -I/home/kmf/Desktop/xc/programs/Xserver/hw/xfree86 -I/home/kmf/Desktop/xc/exports/include/X11 -I/home/kmf/Desktop/xc/include/extensions -I/usr/X11R6/include -I/home/kmf/Desktop/xc -I/home/kmf/Desktop/xc/exports/include -Dlinux -D__i386__ -D_POSIX_C_SOURCE=199309L -D_POSIX_SOURCE -D_XOPEN_SOURCE -D_BSD_SOURCE -D_SVID_SOURCE -D_GNU_SOURCE -DSHAPE -DXINPUT -DXKB -DLBX -DXAPPGROUP -DXCSECURITY -DTOGCUP -DXF86BIGFONT -DDPMSExtension -DPIXPRIV -DPANORAMIX -DRENDER -DRANDR -DGCCUSESGAS -DAVOID_GLYPHBLT -DPIXPRIV -DSINGLEDEPTH -DXFreeXDGA -DXvExtension -DXFree86LOADER -DXFree86Server -DXF86VIDMODE -DXvMCExtension -DSMART_SCHEDULE -DBUILDDEBUG -DXResExtension -DX_BYTE_ORDER=X_LITTLE_ENDIAN -DNDEBUG -DFUNCPROTO=15 -DNARROWPROTO -DIN_MODULE -DXFree86Module -ggdb -DEVDBG -c ev_calibrate.c
ev_calibrate.c: In function `main':
ev_calibrate.c:185: warning: ISO C90 forbids variable-size array `xy_ring_buf'
ev_calibrate.c:357: warning: ordered comparison of pointer with integer zero
ev_calibrate.c:401: warning: ISO C forbids passing arg 3 of pthread_create' between function pointer and
void *'
ev_calibrate.c:181: warning: unused variable `p_mtx_attr'
rm -f ev_calibrate
gcc -m32 -o ev_calibrate -O2 -fno-strength-reduce -fno-strict-aliasing -ansi -pedantic -Wall -Wpointer-arith -Wundef -L/home/kmf/Desktop/xc/exports/lib ev_calibrate.o -lXaw -lXmu -lXt -lSM -lICE -lXpm -lXext -lX11 -lpthread -L/usr/X11R6/lib -Wl,-rpath-link,/home/kmf/Desktop/xc/exports/lib
rm -f evtouch.o
gcc -m32 -O2 -fno-strength-reduce -fno-strict-aliasing -ansi -pedantic -Wall -Wpointer-arith -Wundef -fno-merge-constants -I. -I/home/kmf/Desktop/xc/programs/Xserver/hw/xfree86/common -I/home/kmf/Desktop/xc/programs/Xserver/hw/xfree86/loader -I/home/kmf/Desktop/xc/programs/Xserver/hw/xfree86/os-support -I/home/kmf/Desktop/xc/programs/Xserver/hw/xfree86/os-support/bus -I/home/kmf/Desktop/xc/programs/Xserver/hw/xfree86/xf86cfg -I/home/kmf/Desktop/xc/programs/Xserver/randr -I/home/kmf/Desktop/xc/include -I/home/kmf/Desktop/xc/programs/Xserver/include -I/home/kmf/Desktop/xc/programs/Xserver/hw/xfree86 -I/home/kmf/Desktop/xc/exports/include/X11 -I/home/kmf/Desktop/xc/include/extensions -I/usr/X11R6/include -I/home/kmf/Desktop/xc -I/home/kmf/Desktop/xc/exports/include -Dlinux -D__i386__ -D_POSIX_C_SOURCE=199309L -D_POSIX_SOURCE -D_XOPEN_SOURCE -D_BSD_SOURCE -D_SVID_SOURCE -D_GNU_SOURCE -DSHAPE -DXINPUT -DXKB -DLBX -DXAPPGROUP -DXCSECURITY -DTOGCUP -DXF86BIGFONT -DDPMSExtension -DPIXPRIV -DPANORAMIX -DRENDER -DRANDR -DGCCUSESGAS -DAVOID_GLYPHBLT -DPIXPRIV -DSINGLEDEPTH -DXFreeXDGA -DXvExtension -DXFree86LOADER -DXFree86Server -DXF86VIDMODE -DXvMCExtension -DSMART_SCHEDULE -DBUILDDEBUG -DXResExtension -DX_BYTE_ORDER=X_LITTLE_ENDIAN -DNDEBUG -DFUNCPROTO=15 -DNARROWPROTO -DIN_MODULE -DXFree86Module -ggdb -DEVDBG -c evtouch.c
evtouch.c:84:1: warning: "DBG" redefined
In file included from evtouch.c:75:
/home/kmf/Desktop/xc/programs/Xserver/hw/xfree86/common/xf86Xinput.h:113:1: warning: this is the location of the previous definition
In file included from evtouch.c:95:
evtouch.h:33:21: warning: anonymous variadic macros were introduced in C99
evtouch.c: In function `emulate3Timer':
evtouch.c:201: warning: ISO C89 forbids mixed declarations and code
evtouch.c: In function `EVTouchProcessRel':
evtouch.c:355: warning: unused variable `dummy'
evtouch.c: In function `DeviceInit':
evtouch.c:590: warning: ISO C89 forbids mixed declarations and code
evtouch.c:605: warning: ISO C89 forbids mixed declarations and code
evtouch.c: In function `ReadInput':
evtouch.c:810: warning: 0' flag ignored with precision and
%x' printf format
evtouch.c:810: warning: 0' flag ignored with precision and
%x' printf format
evtouch.c: In function `ConvertProc':
evtouch.c:923: warning: ISO C89 forbids mixed declarations and code
evtouch.c:937: warning: implicit declaration of function `RRGetRotation'
evtouch.c:1080: warning: ISO C89 forbids mixed declarations and code
/home/kmf/Desktop/xc/programs/Xserver/hw/xfree86/common/compiler.h: At top level:
evtouch.c:753: warning: `EVTouchRead' defined but not used
rm -f libtouch.o
gcc -m32 -O2 -fno-strength-reduce -fno-strict-aliasing -ansi -pedantic -Wall -Wpointer-arith -Wundef -fno-merge-constants -I. -I/home/kmf/Desktop/xc/programs/Xserver/hw/xfree86/common -I/home/kmf/Desktop/xc/programs/Xserver/hw/xfree86/loader -I/home/kmf/Desktop/xc/programs/Xserver/hw/xfree86/os-support -I/home/kmf/Desktop/xc/programs/Xserver/hw/xfree86/os-support/bus -I/home/kmf/Desktop/xc/programs/Xserver/hw/xfree86/xf86cfg -I/home/kmf/Desktop/xc/programs/Xserver/randr -I/home/kmf/Desktop/xc/include -I/home/kmf/Desktop/xc/programs/Xserver/include -I/home/kmf/Desktop/xc/programs/Xserver/hw/xfree86 -I/home/kmf/Desktop/xc/exports/include/X11 -I/home/kmf/Desktop/xc/include/extensions -I/usr/X11R6/include -I/home/kmf/Desktop/xc -I/home/kmf/Desktop/xc/exports/include -Dlinux -D__i386__ -D_POSIX_C_SOURCE=199309L -D_POSIX_SOURCE -D_XOPEN_SOURCE -D_BSD_SOURCE -D_SVID_SOURCE -D_GNU_SOURCE -DSHAPE -DXINPUT -DXKB -DLBX -DXAPPGROUP -DXCSECURITY -DTOGCUP -DXF86BIGFONT -DDPMSExtension -DPIXPRIV -DPANORAMIX -DRENDER -DRANDR -DGCCUSESGAS -DAVOID_GLYPHBLT -DPIXPRIV -DSINGLEDEPTH -DXFreeXDGA -DXvExtension -DXFree86LOADER -DXFree86Server -DXF86VIDMODE -DXvMCExtension -DSMART_SCHEDULE -DBUILDDEBUG -DXResExtension -DX_BYTE_ORDER=X_LITTLE_ENDIAN -DNDEBUG -DFUNCPROTO=15 -DNARROWPROTO -DIN_MODULE -DXFree86Module -ggdb -DEVDBG -c libtouch.c
rm -f evtouch_drv.o
gcc -m32 -nostdlib -r evtouch.o libtouch.o -o evtouch_drv.o
rm -f /home/kmf/Desktop/xc/exports/lib/modules/input/evtouch_drv.o
+ cd /home/kmf/Desktop/xc/exports/lib/modules/input
+ ln -s ../../../..//home/kmf/Desktop/Evtouch/xf86-input-evtouch-0.8.8/evtouch_drv.o .
I should mention that v0.8.8 had a syntax error in its C-code in line 676, which I changed as follows (based on the driver code of v0.8.6):
#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) == 2
xf86InitValuatorAxisStruct(dev, 0, 0, priv->screen_width,
1024,
EV_AXIS_MIN_RES /* min_res */ ,
EV_AXIS_MAX_RES /* max_res */ );
xf86InitValuatorDefaults(dev, 0);
xf86InitValuatorAxisStruct(dev, 1, 0, priv->screen_height,
1024,
EV_AXIS_MIN_RES /* min_res */ ,
EV_AXIS_MAX_RES /* max_res */ );
xf86InitValuatorDefaults(dev, 1);
#else
xf86InitValuatorAxisStruct(dev, 0, priv->min_x, priv->max_x,
1024, //THIS LINE WAS MISSING
EV_AXIS_MIN_RES /* min_res */ , //THIS LINE WAS MISSING
EV_AXIS_MAX_RES /* max_res */ ); //THIS LINE WAS MISSING
xf86InitValuatorDefaults(dev, 0); //THIS LINE WAS MISSING
InitValuatorAxisStruct (dev, 1, priv->min_y, priv->max_y, //THIS LINE WAS MISSING
1024, //THIS LINE WAS MISSING
EV_AXIS_MIN_RES /* min_res */ , //THIS LINE WAS MISSING
EV_AXIS_MAX_RES /* max_res */ ); //THIS LINE WAS MISSING
xf86InitValuatorDefaults(dev, 1);
#endif
dmesg reports at its end:
input: USB HID v0.01 Mouse [QEMU QEMU USB Tablet] on usb1:2.0
hid-core.c: v1.9.1 Andreas Gal, Vojtech Pavlik
hid-core.c: USB HID support drivers
mtrr: type mismatch for fa000000,2000000 old: uncachable new: write-combining
The error message is: (EE) touchscreen: Unable to grab device (Invalid argument). Sadly there is no info about which argument is actually invalid.
Checking the code in evtouch.c, I see that the error is raised at the following instance of the DeviceOn function:
if (ioctl(local->fd, EVIOCGRAB, (void *)1))
xf86Msg(X_ERROR, "%s: Unable to grab device (%s).\n", local->name, strerror(errno));
where EVIOCGRAB is defined as:
#ifndef EVIOCGRAB
#define EVIOCGRAB _IOW('E', 0x90, int)
#endif
This sounds to me like some of the options in local->fd cannot be applied via ioctl. However I am starting to believe that there is some issue with the device presented to the guest, such that it cannot be grabbed properly...
How to get this thing running?
Asked by Elarion
(21 rep)
Oct 11, 2022, 12:10 PM
Last activity: Nov 3, 2022, 10:20 AM
Last activity: Nov 3, 2022, 10:20 AM