Wacom USB Graphire4 A6 and OpenBSD -current

To use a Wacom Graphire USB tablet with applications like gromit and gimp under OpenBSD -current as of December 24th 2005 a few tweaks are required. This document is an attempt to provide the required tweaks along with configuration tips.

The device protocol is supported by the X.org usbtablet(4) driver, however, there are a few obstacles that must by dealt with.

Driver issue

First of all, the USB HID report descriptor supplied by the tablet is broken, so the device requires special treatment from the USB HID layer. A diff is available that takes care of this for the Graphire3 A6 and Graphire4 A6. Note, that the scroll wheel and expresskeys on the Graphire4 do not yet work.

This is how the device looks in dmesg:

uhidev1 at uhub1 port 2 configuration 1 interface 0
uhidev1: WACOM CTE-440-U V4.0-3, rev 1.10/4.03, addr 4, iclass 3/1
uhidev1: 3 report ids
ums1 at uhidev1 reportid 1: 3 buttons and Z dir.
wsmouse2 at ums1 mux 0
uhid0 at uhidev1 reportid 2: input=7, output=0, feature=2
uhid1 at uhidev1 reportid 3: input=0, output=0, feature=2

This is what usbhidctl(1) has to say about the device:

luggage$ usbhidctl -f 0 -r
Report descriptor:
Collection page=Digitizer usage=Digitizer
Collection page=Digitizer usage=Digitizer
Input   size=1 count=1 page=Digitizer usage=Touch, logical range 0..1
Input   size=1 count=1 page=Digitizer usage=Barrel_Switch, logical range 0..1
Input   size=1 count=1 page=Digitizer usage=Barrel_Switch, logical range 0..1
Input   size=1 count=1 page=Digitizer usage=Invert, logical range 0..1
Input   size=1 count=1 page=Digitizer usage=Transducer_Index, logical range 0..1
Input   size=1 count=1 page=Digitizer usage=In_Range, logical range 0..1
Input   size=16 count=1 page=Generic_Desktop usage=X, logical range 0..10206
Input   size=16 count=1 page=Generic_Desktop usage=Y, logical range 0..7422
Input   size=16 count=1 page=Digitizer usage=Tip_Pressure, logical range 0..511
End collection
Feature size=0 count=1 page=Digitizer usage=Undefined, logical range 0..511
Total   input size 7 bytes
Total  output size 0 bytes
Total feature size 2 bytes
luggage$ usbhidctl -f 1 -r 
Report descriptor:
Feature size=0 count=1 page=Digitizer usage=Undefined, logical range 0..511
usbhidctl: Excessive collection ends

This shows that the device has a pressure sensitivity of 512 levels (Tip_Pressure), it can tell which end of the stylus you're using (Invert), and that it supports up to two pens or tools at a time (Transducer_Index).

GTK issue

In order for GTK application to take advantage of the extra information from tablets and other extended input devices, GTK must be compiled with support for Xinput which it currently is not. A diff is available that enables this.

X configuration

The following xorg.conf configuration snippet creates two extended input devices, w_stylus and w_eraser. You may want to adjust the Suppress and Threshold options if you have a shaky hand.

Section "InputDevice"
    Identifier "w_stylus"
    Driver "usbtablet"
    Option "Type" "stylus"
    Option "Device" "/dev/uhid0"
    Option "Mode" "Absolute"
EndSection

Section "InputDevice"
    Identifier "w_eraser"
    Driver "usbtablet"
    Option "Type" "eraser"
    Option "Device" "/dev/uhid0"
    Option "Mode" "Absolute"
EndSection

Section "ServerLayout"
    Identifier  "Layout0"
    Screen "Screen0"
    InputDevice "int_kbd" "CoreKeyboard"
    InputDevice "int_mouse" "CorePointer"

# Wacom stuff
    InputDevice "w_stylus" "SendCoreEvents"
    InputDevice "w_eraser" "SendCoreEvents"

EndSection

Note that it is necessary to enumerate the individual devices in the configuration. Specifically, /dev/wsmouse may not be used as an input device as it will take precedence over any other input device.

People using their tablet with a laptop may wish to add the following configuration snippet as well. Leaving it out may cause X to hang or fail to start if the tablet or other removeable pointer devices are unavailable.

Section "ServerFlags"
    Option "AllowMouseOpenFail" "True"
EndSection

gromit

gromit is a tool that allows the user to make annotations anywhere on the screen. It is particularly useful when demonstrating applications and you want to highlight a certain feature.

The following is a sample configuration file:

# Tool definitions

"Red" = PEN (size=7 color="red");
"Blue" = "Red" (color="blue");
"Yellow" = "Red" (color="yellow");
"Pink" = "Red" (color="#ff00aa");
"Eraser" = ERASER (size = 75);

# Mapp tools to pointing devices

"Core Pointer" = "Red";
"Core Pointer"[SHIFT] = "Blue";
"Core Pointer"[CONTROL] = "Yellow";
"Core Pointer"[META] = "Pink";

"w_stylus" = "Red";
"w_stylus"[SHIFT] = "Blue";
"w_stylus"[CONTROL] = "Yellow";
"w_stylus"[META] = "Pink";

"w_eraser" = "Eraser";

When starting gromit, it should give output similar to the following:

luggage$ gromit
Enabling No. 0x848aed80: "w_eraser" (Type: 2)
Enabling No. 0x848aef00: "w_stylus" (Type: 1)

gimp

In order to fully utilise your tablet under gimp, you must enable and configure your tablet devices. The following images show how to do this:




Note that you should use the tools in Screen mode because Window mode does not work very well.

After this, gimp will be able to see what end of the stylus you are using, and it will remember the tools you last used with either end. It works really well -- even better than the software that came with the tablet.