Review the current situation of touchscreen handling in ubuntu, take a look at the work done upstream to unify all touchscreen Xorg drivers into evdev. Find the best calibration tool and setup UI to use for touchscreens and make sure it works with the hal-input model.

Release Note

Support for a wide amount of touchscreens devices was added in this realease, this includes a new calibration tool.


Touchscreen are more and more common in all kind of devices from Notebooks over MIDs to all in one PCs. Historically touchscreen devices were hard to configure and set up through opaque calibration tools that had to be run from commandline, partially the values had to be computed manually and then had to be put into the xorg configuration file with an editor. This situation is not bearable for our users, an easy way to calibrate a touchscreen and change the setup is required.

Use Cases

  1. A touchscreen on a single monitor
  2. A touchscreen on one of multiple monitors (not currently supported)
  3. A few touchscreens on few of the monitors (not currently supported)
  4. Rotation of monitor with touchscreen and/or change of resolution on one of the monitors


Upstream switches touchscreen input support to evdev with hal integration, evdev has recieved basic support for touchscreen devices in the latest iteration but is lacking support for calibration. HAL uses evdev for touchscreen devices already but is lacking support for handling calibration data to properly adjust the devices to the used screen.


We will make HAL understand the calibration data. see the evtouch implementation used in intrepid as a design base. Data is read from a calibration file and attached to the HAL device with the hal-set-property command. We will add a cairo based calibration tool to generate a touchscreen calibration file the hal-input layer can read to apply it to the device in Xorg.


The evdev driver in its 2.1 release is capable of handling touchscreen devices, hal recognizes these devices as mice and automatically assigns the evdev driver to them. An implementation similar to the handling of evtouch in intrepid will be written that applies to evdev devices if they are recognized as touchscreens by an .fdi file. In the intrepid cycle a lot of lshal output was collected from the community to easily assemble a .fdi file to match against a large amount of touchscreens. Based on this .fdi data a hal handler will apply the calibration data stored in a textfile to the device. In case no calibration data is found an opportunity of calibration will be offered to the user.

A calibration tool based on the cairo lib was written by Søren Hauberg and its code was sent to the xorg development mailing list. Based of this code a tool for collecting and writing the calibration data to a file will be written.

A menu entry in the System->Administration submenu will be established to run the calibration tool at any given time.

Usually calibration requires more than just the screen coordinates, there are values like touch duration or screen rotation that need to be taken into account. These values need to be adjustable through a GUI, a mockup of this gui can be seen in the UI changes section. The values of the different calibration options will be attached to the calibration file and will be applied to the evdev driver as X properties through hal.

UI Changes

Mockup of a touchscreen settings tool:


Mockup of the advanced options of a touchscreen settings tool:


Code Changes

  • Merge code from the hal based evtouch implementation used in jaunty into an additional package that depends on evdev.
  • Port the gtkmm based calibration tool to plain gtk.
  • Write the UI for extended calibration parameters which has to include a button to launch the calibration tool at any given time, to adjust the calibration coordinates.


An existing evtouch calibration should be automatically converted to an evdev calibration, if this is not possible, make sure the user gets pointed to the new calibration tool to recalibrate his screen.

Test/Demo Plan

  • Open the calibration properties
  • Run the calibration tool
  • Verify the calibration fits the screen
  • Test Case will be added to the testcases wiki to be integrated with milestone testing

Unresolved issues

It is possible that not all existing drivers are covered by evdev. Drivers that dont work need to be identified and support for these devices needs to be added to evdev during the next development cycle. https://bugs.launchpad.net/bugs/317094 is supposed to be a meta collection bug for lshal output to add more hardware to the .fdi file and make sure evdev will support these devices in future releases.

KArmic BOF Notes


* Most touchscreens don't work * evtouch is the only working Xorg touchscreen driver

  • calibration/detection thru HAL which is going away

* Bug that collected hardware information during jaunty:

Calibration Tool

* move to daemon that uses xinput to collect xevents written by alberto milone

  • the daemon currently uses qt-dbus and needs to be ported to some language
    • environment that is on the CD if we want touchscreen support out of the box

* upstream UI attempt http://people.ubuntu.com/~ogra/my_calibrator.cc written

  • by soren hauberg, not finished and coded in gtkmm


* Ignore non-usb touchscreen currently * Priority - get frame work and as many usb touch screens working as possible * Recalibrate on screen rotation as secondary priority * 'lsinput' to list all the input devices on the system

  • add device ids from above bug (lshal outputs) to usbtouchscreen driver?
    • Try by adding the device ids to the module through sysfs first
      • e.g.
        • {{{ find /sys -name new_id lsusb (to find vendor id, product id) modprobe foo_driver

          echo 34ca d365 > /sys/bus/usb/drivers/foo_driver/new_id }}} The first number is the vendor id, the second is the product id.

* some driver provides tools to do calibration, and users have to manually write the values into Xorg.conf


* add all possible device IDs that were collected in the metabug to usbtouchscreen

  • the kernel team needs to make sure we have proper kernel support for all device IDs that can be handled by usbtouchscreen

* alberto will finish his xinput daemon that will act as a backend for the evdev

  • driver

* ogra will port the calibration tool based on the upstream code that was

  • sent to the xorg upstream mailing list (but isn't finished yet) to gtk. this tool will then talk to the xinput daemon and put the detected calibration values into a config file the daemon can read


JauntyTouchscreenHandling (last edited 2009-08-07 10:24:19 by 89)