Touchscreen HOWTO

How to do things, solutions, recipes, tutorials
Message
Author
tempestuous
Posts: 5464
Joined: Fri 10 Jun 2005, 05:12
Location: Australia

Touchscreen HOWTO

#1 Post 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.

tempestuous
Posts: 5464
Joined: Fri 10 Jun 2005, 05:12
Location: Australia

#2 Post 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.
Attachments
touchscreen-Puppy4.1.pet
(59.96 KiB) Downloaded 4114 times
Last edited by tempestuous on Fri 19 Mar 2010, 05:46, edited 3 times in total.

tempestuous
Posts: 5464
Joined: Fri 10 Jun 2005, 05:12
Location: Australia

#3 Post 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
Attachments
touchscreen-Puppy4.0.pet
(64.31 KiB) Downloaded 2114 times
touchscreen-Puppy3.pet
(58 KiB) Downloaded 1866 times
Last edited by tempestuous on Thu 16 Apr 2009, 09:58, edited 1 time in total.

tempestuous
Posts: 5464
Joined: Fri 10 Jun 2005, 05:12
Location: Australia

#4 Post 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
Attachments
touchscreen-Puppy2.17.pet
(65.41 KiB) Downloaded 1772 times
touchscreen-Puppy2.12-2.16.pet
(59.32 KiB) Downloaded 1823 times
Last edited by tempestuous on Thu 16 Apr 2009, 10:02, edited 1 time in total.

tempestuous
Posts: 5464
Joined: Fri 10 Jun 2005, 05:12
Location: Australia

#5 Post 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.

tempestuous
Posts: 5464
Joined: Fri 10 Jun 2005, 05:12
Location: Australia

#6 Post 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

tempestuous
Posts: 5464
Joined: Fri 10 Jun 2005, 05:12
Location: Australia

#7 Post 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 (??).

jakfish
Posts: 762
Joined: Fri 18 Jul 2008, 19:09

#8 Post 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

User avatar
Lobster
Official Crustacean
Posts: 15522
Joined: Wed 04 May 2005, 06:06
Location: Paradox Realm
Contact:

#9 Post 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 . . .
Puppy Raspup 8.2Final 8)
Puppy Links Page http://www.smokey01.com/bruceb/puppy.html :D

maddmike
Posts: 14
Joined: Tue 17 Jun 2008, 20:03

no touchscreen in /proc/bus/input/devices

#10 Post 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.

tempestuous
Posts: 5464
Joined: Fri 10 Jun 2005, 05:12
Location: Australia

#11 Post 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.

riel
Posts: 2
Joined: Fri 08 May 2009, 00:01

#12 Post 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.

destr0y
Posts: 3
Joined: Fri 08 May 2009, 14:53

#13 Post 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.

maddmike
Posts: 14
Joined: Tue 17 Jun 2008, 20:03

#14 Post 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?

tempestuous
Posts: 5464
Joined: Fri 10 Jun 2005, 05:12
Location: Australia

#15 Post 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.

User avatar
divisionmd
Posts: 606
Joined: Sat 14 Jul 2007, 20:42

#16 Post by divisionmd »

Hello all,

- Thanks alot for help got it working!

Best regards,
Johan

riel
Posts: 2
Joined: Fri 08 May 2009, 00:01

#17 Post 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.

tempestuous
Posts: 5464
Joined: Fri 10 Jun 2005, 05:12
Location: Australia

#18 Post 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?
Attachments
mouse-kernel-config.jpg
(6.65 KiB) Downloaded 5396 times

wosifat
Posts: 104
Joined: Sun 29 Jun 2008, 22:15
Location: Madison Heights, VA
Contact:

#19 Post 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.)

andrewr
Posts: 8
Joined: Tue 21 Apr 2009, 02:13

#20 Post 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.....

Post Reply