Page 1 of 5

Touchscreen HOWTO

Posted: Thu 16 Apr 2009, 08:28
by tempestuous
Touchscreen configuration was tested successfully in an earlier forum thread -
http://www.murga-linux.com/puppy/viewtopic.php?t=16518
But the correct information was spread awkwardly throughout that thread, so I have consolidated all setup information and dotpets here.

You may see touchscreen HOWTO's on the web which refer to the gpm (general purpose mouse) daemon, but I think this is largely deprecated in modern kernels.

In general, touchscreens are supported in modern Linux distributions by a kernel module plus a corresponding Xorg input plugin. The exact kernel module/Xorg plugin is determined by the manufacturer of the particular touchscreen sensor device.
The module/Xorg plugin combinations I understand to be correct for serial touchscreen devices are:
fujitsu_ts / fujitsu
elo / elographics ... or
elo / elo2300
mtouch / microtouch
penmount / penmount

I don't know what is correct for the these serial modules:
gunze
touchright
touchwin

USB touchscreen devices by several different manufacturers are all supported by a common kernel module; usbtouchscreen.
For eGalax Touchkit devices the combination should be:
usbtouchscreen / evtouch

For Gunze AHL61 devices the combination should be:
usbtouchscreen / evdev

For DMC devices the combination should be:
usbtouchscreen / dmc

I don't know what is correct for these USB devices:
eTurboTouch, PanJit TouchSet, 3M MicroTouch USB, IRTOUCHSYSTEMS/UNITOP, IdealTEK, GoTop.

The mk712 kernel module supports the ICS MicroClock device (found in the Hitachi Visionplate).
I think this device is on the ISA bus, and it may be necessary to specify the irq and io values when loading the mk712 module. The combination of kernel module/Xorg plugin should be:
mk712 / evtouch

All of the touchscreen kernel modules mentioned are contained in Puppy4.1/4.2, but need to be installed separately for earlier Puppies.

Posted: Thu 16 Apr 2009, 08:31
by tempestuous
Here are the Xorg7.3 touchscreen input plugins, compatible with Puppy 4.1.x and 4.2.x
EDIT March 2010: also for Puppy 4.3.x

These Puppy versions already contain the necessary kernel modules.

Posted: Thu 16 Apr 2009, 08:35
by tempestuous
Here are the touchscreen modules/Xorg plugins for:
- Puppy 4.0 with kernel 2.6.21.7 and Xorg7.3
- Puppy 3.x with kernel 2.6.21.7 and Xorg7.2

Posted: Thu 16 Apr 2009, 08:43
by tempestuous
Here are the touchscreen modules/Xorg plugins for:
- Puppy 2.17 with kernel 2.6.21.5 and Xorg7.0
- Puppy 2.12-2.16 with kernel 2.6.18.1 and Xorg7.0

Posted: Thu 16 Apr 2009, 08:44
by tempestuous
HOWTO - USB touchscreens

In this example we will refer to the "eGalax Touchkit" touchscreen, for which the correct kernel module is "usbtouchscreen" (as with all USB touchscreen devices) and the Xorg plugin is "evtouch".
Obviously for a different model of USB touchscreen, substitute all references to "evtouch" for the appropriate plugin.

1. Install the appropriate Xorg plugin package, plus kernel modules package if necessary, for your Puppy version.

2a. Load the usbtouchscreen module and evdev module -

Code: Select all

modprobe usbtouchscreen
modprobe evdev  ## (very important!)
2b. Make sure that these modules load at every boot up,
so open /etc/rc.d/rc.local in geany and add these lines -

Code: Select all

modprobe usbtouchscreen
modprobe evdev
3a. Run this command -

Code: Select all

cat /proc/bus/input/devices
and look for what appears to be your touchscreen device,
then look at the handler line. It should be something like
H: Handlers=mouse0 event3
The event3 is important here, it may be different.

3b. Puppy already contains the necessary device nodes /dev/input/event...
but it may be necessary to add this to /etc/modules.conf -

Code: Select all

alias char-major-13-67 evdev
4. Open /etc/X11/xorg.conf in geany. Add two new InputDevice sections -

Code: Select all

Section "InputDevice"
    Identifier "touchscreen"
    Driver "evtouch"
    Option "Device" "/dev/input/event3"
    Option "DeviceName" "touchscreen"
    Option "MinX" "98"
    Option "MinY" "43"
    Option "MaxX" "940"
    Option "MaxY" "925"
    Option "ReportingMode" "Raw"
    Option "Emulate3Buttons"
    Option "Emulate3Timeout" "50"
    Option "SendCoreEvents" "On"
EndSection

Section "InputDevice"
    Identifier "dummy"
    Driver "void"
    Option "Device" "/dev/input/mice"
EndSection
And in Section "ServerLayout" find the line:
InputDevice "Mouse0" "CorePointer"

and below that line add this -

Code: Select all

InputDevice "touchscreen" "CorePointer"
InputDevice "dummy"
5. Restart X, or reboot.
Calibration will now be an issue. I don't know what to suggest, except that the calibration will change the values of
MinX/MinY/MaxX/MaxY in xorg.conf.
Worst case, you could manually change these values until they work. Or Google for someone else's calibration settings.

Posted: Thu 16 Apr 2009, 08:47
by tempestuous
HOWTO - serial touchscreens
The setup of serial touchscreens is similar to that of USB touchscreens, except that the touchscreen events (as defined in xorg.conf as "Option "Device") will be coming from /dev/ttyS0 instead of /dev/input/event3.
In this example we will refer to a Fujitsu P series tablet computers, for which the correct kernel module is "fujitsu-ts" and the correct Xorg plugin is "fujitsu".
We will assume that the touchscreen appears at the first serial port, which is /dev/ttyS0. It may take some diagnosis to determine if this is not the case.

1. Install the appropriate Xorg plugin package, plus kernel modules package if necessary, for your Puppy version.

2a. Load the fujitsu_ts module and evdev module -

Code: Select all

modprobe fujitsu_ts
modprobe evdev  ## (very important!)
2b. Make sure that these modules load at every boot up,
so open /etc/rc.d/rc.local in geany and add these lines -

Code: Select all

modprobe fujitsu_ts
modprobe evdev
3. Puppy already contains the necessary device nodes /dev/input/event...
but it may be necessary to add this to /etc/modules.conf -

Code: Select all

alias char-major-13-67 evdev
4. Open /etc/X11/xorg.conf in geany. Add two new InputDevice sections -

Code: Select all

Section "InputDevice"
    Identifier "touchscreen"
    Driver "fujitsu"
    Option "Device" "/dev/ttyS0"
    Option "DeviceName" "touchscreen"
    Option "MinX" "82"
    Option "MinY" "146"
    Option "MaxX" "4036"
    Option "MaxY" "3999"
    Option "SendCoreEvents" "On"
EndSection

Section "InputDevice"
    Identifier "dummy"
    Driver "void"
    Option "Device" "/dev/input/mice"
EndSection
In Section "ServerLayout" find the line:
InputDevice "Mouse0" "CorePointer"
and below that line add this -

Code: Select all

InputDevice "touchscreen" "CorePointer"
InputDevice "dummy"
5. Now reboot, and there's a fair chance the touchscreen will work. If not, the serial port may need configuration. Add another line to /etc/rc.d/rc.local

Code: Select all

setserial /dev/ttyS0 port 0x0220 irq 4 autoconfig
Now reboot again.

If the touchscreen works, but calibration is wrong, try the xorg.conf values suggested here
http://www.akos.uklinux.net/biblo-linux/#rh.touch

Posted: Thu 16 Apr 2009, 08:49
by tempestuous
PS2 touchscreens
Fujitsu B series tablet computers apparently have a touchscreen which appears as a PS2 interface.
I believe that Puppy's PS2 mouse driver (which is statically compiled into the kernel) does not support touchscreens via the PS2 interface, so unless a different kernel image is compiled then these touchscreens will not work in Puppy.
The relevant kernel configuration is found at:
Device Drivers > Input device support > Mice > eGalax TouchKit PS/2 protocol extension
In Puppy, this option is not enabled.

And the gpm (general purpose mouse) daemon may also be required (??).

Posted: Sat 18 Apr 2009, 03:02
by jakfish
Great work, as always, tempestuous (I just took the plunge with your bluetooth pets/instructions and got my eee 900 connected to GPRS).

Given that there are a certain number of eee users who have installed touchscreens from Hong Kong, I'd be very much interested to see if any of them are running puppy, tried these screen pets, and post here.

Again, congratulations,
Jake

Posted: Sat 18 Apr 2009, 06:16
by Lobster
Wot no video?
Thanks tempestuous for providing this future proofing info :)
Anyone able to provide video of Puppy running on a touchscreen? When touch screens start coming in cheaply from China, new users will be upgrading to this technology . . .

no touchscreen in /proc/bus/input/devices

Posted: Fri 01 May 2009, 03:04
by maddmike
I have a Panasonic Toughbook T5. It has a USB-connected Fujitsu touchscreen.

I installed the touchscreen .pet.

modprobe usbtouchscreen and evdev work OK. I can see both modules in lsmod. But there is no entry for the touchscreen in /proc/bus/input/devices.

Code: Select all

I: Bus=0011 Vendor=0002 Product=0007 Version=0000
N: Name="SynPS/2 Synaptics TouchPad"
P: Phys=isa0060/serio4/input0
S: Sysfs=/class/input/input0
H: Handlers=mouse0 event0 
B: EV=b
B: KEY=6420 0 70000 0 0 0 0 0 0 0 0
B: ABS=11000003

I: Bus=0011 Vendor=0001 Product=0001 Version=ab41
N: Name="AT Translated Set 2 keyboard"
P: Phys=isa0060/serio0/input0
S: Sysfs=/class/input/input1
H: Handlers=kbd event1 
B: EV=120013
B: KEY=4 2000000 3802078 f840d001 feffffdf ffefffff ffffffff fffffffe
B: MSC=10
B: LED=7
in /proc/bus/usb/devices, I can see the touchscreen listed as:

Code: Select all

T:  Bus=02 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#=  3 Spd=1.5 MxCh= 0
D:  Ver= 1.10 Cls=00(>ifc ) Sub=00 Prot=00 MxPS= 8 #Cfgs=  1
P:  Vendor=0430 ProdID=0530 Rev=10.02
S:  Manufacturer=Fujitsu Component
S:  Product=USB Touch Panel
C:* #Ifs= 1 Cfg#= 1 Atr=a0 MxPwr= 20mA
I:* If#= 0 Alt= 0 #EPs= 1 Cls=03(HID  ) Sub=01 Prot=02 Driver=usbhid
E:  Ad=81(I) Atr=03(Int.) MxPS=   8 Ivl=10ms
Am I missing something? Is there another way to point X to the touchscreen if it doesn't show up in /proc/bus/input/devices?

Thanks.

Posted: Mon 04 May 2009, 13:31
by tempestuous
maddmike wrote:P: Vendor=0430 ProdID=0530 Rev=10.02
That device ID is the same as in the Fujitsu Lifebook U810,
so a possible solution is here -
https://bugs.launchpad.net/ubuntu/+sour ... comments/6
Note:
- the bios might need to changed from "Tablet" to "Touch Panel".
- the Option "Device" value is somewhat unconventional. In your case it might be /dev/usb/hiddev0 ??
- the correct Xorg plugin is evtouch.
- make sure that the usbhid module is loaded.

Posted: Fri 08 May 2009, 00:05
by riel
Hello!

I have a cashier-system running puppy. It has an integrated mtouch touchpanel.

I can't see a /dev/ttys0 ! BUT when I tough screen, pointer goes crazy. Even when I hold finger at one place, it flips all over, pointing and clicking everywhere.

I can't seem to find a solution on how to get the panel working... I did the serial-installs.

Posted: Fri 08 May 2009, 14:57
by destr0y
anyone got a Compaq TC1000 tablet running Puppy? I've just installed it, am currently reading into the pen (fpi2002 driver) requirements. Bit of info out there, but none that is puppy-specific.

On a related note - is it possible to create a remaster that has this functionality working out-of-the-box? ie, a TC1000 remaster..? or are those x config changes something that have to be done after the install? Would make a killer project - a lot of these old tablets laying around out there, just begging to be Pup'd.

Posted: Fri 08 May 2009, 15:08
by maddmike
tempestuous wrote: - the bios might need to changed from "Tablet" to "Touch Panel".
- the Option "Device" value is somewhat unconventional. In your case it might be /dev/usb/hiddev0 ??
- the correct Xorg plugin is evtouch.
- make sure that the usbhid module is loaded.
* No options related to touchscreen in my BIOS, so I can't do anything there.
* usbtouchscreen, usbhid, and evdev modules are loaded.
* Yes, the touchscreen device is /dev/usb/hiddev0. I can cat that device to the terminal and see data from the touchscreen.
* I put "/dev/usb/hiddev0" as the Device in Xorg.conf, and "evtouch" as the Driver. But the Xorg.0.log says "can't grab device. (Bad parameter)". What does this mean?

Posted: Sun 10 May 2009, 04:26
by tempestuous
maddmike wrote:the Xorg.0.log says "can't grab device. (Bad parameter)"
I suspect that the various components: Evtouch Xorg plugin / Xorg / kernel module are not playing well together.
I just remembered that forum member tpmoney reported that the full Xorg libraries need to be installed before the plugin will work properly. This library is quite large at 20MB compressed -
http://distro.ibiblio.org/pub/linux/dis ... ri-7.3.pet
If this works, it would be very useful if you could identify exactly which libraries were required; surely the entire 20MB is not necessary.

If still no success after installing these libraries, you could try the older Evtouch plugin under Puppy 4.1/4.2 from here
http://www.murga-linux.com/puppy/viewto ... 668#299668

If still no improvement, go back to Puppy 4.0 (same Xorg7.3, but earlier 2.6.21.7 kernel).

If no still no improvement, go back to Puppy 2.16 or 2.14R (Xorg7.0 + k2.6.18.1) There were several confirmed reports of Evtouch working in Puppy 2.12-2.16.

Posted: Sun 10 May 2009, 20:34
by divisionmd
Hello all,

- Thanks alot for help got it working!

Best regards,
Johan

Posted: Fri 15 May 2009, 09:11
by riel
I found out that my device uses a PS2 touchscreen, on the motherboards Mouseinput.

The mouse driver must be capable of doing this. Anyone knows how? I feel that it is really interfering with my mouse.

Posted: Sat 16 May 2009, 10:46
by tempestuous
riel wrote:I found out that my device uses a PS2 touchscreen ...
The mouse driver must be capable of doing this.
Ah yes, that's a problem. I think that the mouse driver, which is statically built into the Puppy kernel, must be configured to cope with touchscreen functions. The kernel in Puppy 4.1/4.2 does not have this enabled. I attach an image of Puppy's kernel configuration where you can see this.

Maybe you could lobby Barry to enable the Touchkit PS2 setting for uPup?

Posted: Sat 16 May 2009, 15:46
by wosifat
Crazy question get!
I saw somewhere online that would convert a Macbook to a tablet. Can the same be done with PC notebooks? (Somewhat related I guess.)

Posted: Thu 04 Jun 2009, 11:04
by andrewr
tempestuous wrote:
riel wrote:I found out that my device uses a PS2 touchscreen ...
The mouse driver must be capable of doing this.
Ah yes, that's a problem. I think that the mouse driver, which is statically built into the Puppy kernel, must be configured to cope with touchscreen functions. The kernel in Puppy 4.1/4.2 does not have this enabled.
Bugger.

My Panasonic Toughbook CF-29 uses a Fujitsu FJC600 touchscreen via the PS2 port. It sort of works but is not usable (ie where you touch and where the mouse cursor ends up are two different places.)

Ah well.....