Multitouch on Android
Recent versions of Android have some support for multitouch gestures such as
pinching. This page gathers the information in our possession about making
your panel work with Android.
How to use ENAC's Android version of hid-multitouch
Android relies on the Linux kernel, so all multitouch drivers available
in a given version of the kernel can be used in Android systems that rely
on this kernel version. This applies in particular to the unified hid-multitouch
driver which currently can manage panels from more than a dozen vendors.
This driver is available in the Linux kernel since version 2.6.38, but has
been backported to several earlier versions.
Unfortunately, Android versions older than 4.0 (Ice cream sandwich)
use a variant of the original multitouch Linux protocol while hid-multitouch
uses the most recent protocol. For this reason, we distribute an Android-specific
version of hid-multitouch. If you can patch and recompile your kernel, the
following steps can get you started. Note: the Android-x86 project already contains
an appropriate version of hid-multitouch.
look up the status of your panel in our
list of multitouch devices
if your panel is supported in hid-multitouch, get the Android version
in the appropriate ...-android branch of the drivers repository from
our git base.
if your panel is only supported in a device-specific driver, report to
"How to add support..." below.
How to test your panel
Some panels on Android tablets have hardware or firmware problems.
For instance on a Pixcir/Sintek panel we have observed blind stripes.
If you suspect problems you can:
use the "Pointer location" app that comes with Android DevTools.
Move your finger slowly because otherwise the app will interpolate
between the actual positions and you will see points where the panel
did not get any actual contact. Be also careful to use only the tip
of your finger because some devices detect two contacts when the
contact surface is large, and some drivers will interpolate the two
contacts to produce their output, once again resulting into artificial
points.
or use our modified version of "Pointer location" on which traces are
remanent: PointerTest.apk (as of 1/5/2010)
or compile and install the evtest program from
http://cgit.freedesktop.org/~whot/evtest/. Read
/proc/bus/input/devices to determine the number N of your device.
Then launch 'evtest /dev/input/eventN' and read the output. You
will see X and Y coordinates, use them to check for blind zones.
How to add support for your panel
If you own a multitouch panel that is not supported on your Android
device, and you are able to compile and install kernel modules, you
might be able to add support for your panel.
Is your panel supported?
use lsusb to determine the vendorID/productID of your panel
check in our list if
your device has a Linux driver.
depending on your kernel version, either retrieve the
right driver from your kernel sources or download it from the
ENAC drivers, using
the appropriate branch.
Patch your kernel if necessary
add the driver file to drivers/hid,
in the same directory, add the appropriate lines
to hid-ids.h, hid-core.c,
Makefile and Kconfig.
Recompile and reinstall the hid module and the new module
to check that everything is fine.
See the general Linux howto for
details.
Older kernel version
If your kernel is older than 2.6.33 (for instance 2.6.32 as found
in Android 2.2), you will need to first modify include/linux/hid.h
as described in our Linux
multitouch howto before recompiling the hid module or the kernel.
Adapt the driver for Android
Android uses a variant of the early Linux kernel multitouch protocol. You
need to adapt your new driver.
modify the _input_mapping function so as to make sure that
ABS_MT_TOUCH_MAJOR is published. You can for instance replace
ABS_MT_TRACKING_ID in 'case HID_DG_CONTACTID'.
modify the _filter_event function so as to make sure
that ABS_MT_TOUCH_MAJOR=1 is emitted when a finger first touches
the panel, and ABS_MT_TOUCH_MAJOR=0 when it is released.
The exact code depends on the driver.
Recompile and install the new module.
Contact: chatty at enac.fr, benjamin dot tissoires at enac.fr
Updated Sep 17, 2011.