This file documents Gunzets, support software for Gunze touch panels under Linux and XFree86.
The package supports Gunze touch panels under Linux and XFree86. Supported panels are the serial, PS/2, and USB devices. The serial and PS/2 devices are supported by means of an X module, xf86Gunze. Support for USB comes as a kernel module that emulates the PS/2 protocol, so you still need the xf86Gunze module.
The latest version of this driver can be downloaded from:
The latest source tree can be accessed from my CVS server, instructions
are available at http://ar.linux.it/software/#cvs .
The package name to use is
gunzets. The latest CVS snapshot
can also be downloaded from ftp://ar.linux.it/pub/gunzets .
The following bugs are currently known:
To run the serial or PS/2 devices you only need the information in this section. To run the USB device you also need to load the kernel module, described under See Usb Driver, later in this file.
Support for all three device flavors is implemented by means of
xf86Gunze.c, a module for XFree86.
The driver has been used under XFree86 version 3.3.6 and version 4.0.1.
In order to use the touch screen in X, you should install in your system the "xf86Gunze" module, part of this distribution.
The compiled module (
xf86Gunze.so for XFree86 3.3 or
gunze_drv.o for XFree86 4.0) should go in the module
directory of your X server, usually
XFree86 3.3 or
/usr/X11R6/lib/modules/input for XFree86 4.0.
When the file is in place, a proper
XF86Config will arrange for
In order to compile the module for different version of the XFree86 systems you need access the source tree and compile using there commands:
make XFREE33SOURCE=<location-of-source> xf86Gunze.so make XFREE40SOURCE=<location-of-source> gunze_drv.o
The "location of source" above should be the full path name to the directory called "xc" after you uncompress the source tar file.
XFREE40SOURCE can be defined
in your environment. Also, calling
make without arguments will
compile both modules.
To compile gunzets you'll most likely need to compile X first
make World and waiting a huge lot of time). A freshly
uncompressed source tree lacks the proper header files for compilation
to succeed; since one of the errors happens inside an X header, you
can only fix it by compiling X first).
In order to use a Gunze device with XFree 3.3 you need to add the
following two sections to your
XF86Config (the example below shows
all the options available for the module, but most of them are
optional, see below for details):
Section "module" Load "xf86Gunze.so" EndSection Section "Xinput" Subsection "GunzeTS" DeviceName "touchscreen" Port "/dev/ttyS0" DeviceType Serial Speed 9600 CalibrationFile "/etc/gunzets.calib" Smoothness 9 TappingDelay 0 DebugLevel 0 #Res12Bit AlwaysCore EndSubSection EndSection
The meaning of the individual options is the following:
/dev/psaux) or the USB entry point (
/etc/gunzets.calibas shown. The format of the calibration file is specified later in this documents.
In order to use a Gunze device with XFree 4.0 you need to add an
section to your
XF86Config. The following example shows
how it looks like. The options that are shown commented are not
implemented in this version of the module, and are ignored
Section "InputDevice" Identifier "Touchscreen0" Driver "gunze" Option "Device" "/dev/ttyS0" #Option "DeviceType" "serial" Option "BaudRate" "9600" #Option "CalibrationFile" "/etc/gunzets.calib" Option "Smoothness" "9" Option "TappingDelay" "0" Option "JitterDelay" "50" Option "DebugLevel" "0" Option "Res12Bit" "False" Option "SendCoreEvents" EndSection
Moreover, you need to add an
InputDevice line in the
ServerLayout section. After the addition,
the section will most likely look like this:
Section "ServerLayout" Identifier "Simple Layout" Screen "Screen 1" InputDevice "Mouse1" "CorePointer" InputDevice "Keyboard1" "CoreKeyboard" InputDevice "Touchscreen0" EndSection
Note that if your system has no mouse device, you can remove
InputDevice "Mouse1" line and add
to the touch screen line.
The meaning of individual options is as follows:
InputDevicedirective within the
ServerLayoutsection that is usually found at the end of the configuration file.
Option "Device" "/dev/ttyS0"
Option "DeviceType" "serial"
Option "BaudRate" "9600"
Option "CalibrationFile" "/etc/gunzets.calib"
Option "Smoothness" "9"
Option "TappingDelay" "0"
Option "JitterDelay" "50"
Option "DebugLevel" "0"
Option "Res12Bit" "False"
Please note that with both version 3.3 and 4.0 of XFree you can still use a normal mouse together with the touch panel. While XFree 4.0 can use the touch screen as its only pointer device, version 3.3 of the X server can't do that. If you have no other pointer and don't want X to choke on the configuration file, you can use a trick like this one:
Section "Pointer" Protocol "MouseSystems" Device "/dev/fifo" EndSection
/dev/fifo is just a plain unused fifo ("mknod /dev/fifo p")
If, when calling
startx, it fails with a message of
Invalid Subsection Name, please check the previous error
lines, as they explain what is wrong. They usually look like:
(--) no ModulePath specified using default: /usr/X11R6/lib/modules xf86Gunze.so: Unknown error loading module
The messages are pretty clear, if your are careful in reading them (I am not that careful, and lose half an hour in trying to figure out what was wrong).
Use of the touch screen on the text console is not supported, and I don't think it ever will (although I made it work under gpm some time ago, I no longer maintain gpm).
To calibrate the touch panel, run the
gunzets_calib script, under X.
It has been tested with both XFree86 version 3.3.6 and version 4.0.
To calibrate pass the device name on the command line of the program:
gunzets_calib /dev/ttyS0 (serial device) gunzets_calib /dev/psaux (PS/2 device) gunzets_calib /dev/gunzets (USB device)
The program needs to find gunzets_control in the command search path (it uses the control program to turn off the touchscreen in X, so the calibrator can read input data).
In order to calibrate you'll need to move the mouse pointer first. You
can do that with the
warp command (see below) if no other pointer
is available on the system. While I could use the touch panel to this
aim, and delay turning it off, I didn't think of it and don't want to
re-test it all. The next release will be better in this respect (too).
The package includes two tools that work by connecting with the X server:
infoas argument. It turns the touchscreen off, turns it on, or reports information about active input devices. The program needs to connect to an X server.
This driver has been developed and tested with Linux-2.4.0 and works with Linux-2.2.18 as well.
Input data is made available through an entry point in /dev (using devfs if available) (FIXME: devfs support is not yet implemented) or through the input engine (the input.o module) (FIXME: input support is not yet implemented). By default it uses its own /dev entry point, dynamically allocated from the misc device driver.
If all of your modules are in place, you can just invoke
and read the section about X support, above.
If you want to use the input mechanism (currently unimplemented), add
use_input=1 to the gunzets_load command line.
In order to successfully load the module you need to have the following facilities compiled in your kernel or loaded as modules:
To compile the driver just
make. If your 2.4 or 2.2 kernel headers
are not available from
/usr/src/linux/include then specify KERNELDIR
to point to your kernel source directory, either on the make command
line or in the environment. For example:
To load the driver, use insmod:
To use the input mechanism, specify it on the command line:
insmod ./gunzets.o use_input=1
To automatically create the entry point in
/dev (needed if you are not
using the input mechanism) run the gunzets_load script instead:
You can unload the module only after disconnecting the touch panel, otherwise the rmmod program will return "Device Busy" even if no application is using the pane, because the USB mechanism is using it.
To install the module to the proper places you can run
install. You may also wish to copy
and create a proper symbolic link for automatic load at boot.
Data read from the touch screen is available as raw data returned
in PS/2 format in the file
/dev/gunzets. You can use the same
XFree driver described above for serial and PS/2 devices with
To calibrate the touch panel, run the "gunzets_calib" script, under X. See Calibration.