HOWTO Wacom Tablet

From Gentoo Linux Wiki

Jump to: navigation, search
This article is part of the HOWTO series.
Installation Kernel & Hardware Networks Portage Software System X Server Gaming Non-x86 Emulators Misc

Contents

[edit] Introduction

This article is going to explain how to properly set up a Wacom Tablet.
Thanks to TFKyle of ##gentoo-pub for helping me along the way.

Warning: To all the Wacom Bamboo users out there: the Bamboo tablet is supported from kernel 2.6.23 and up. Also linuxwacom version 0.7.8 or higher is required. This means that you either have to wait for portage to catch up or follow the guide below to work around these problems.

[edit] Installing

[edit] Linuxwacom

emerge linuxwacom

Now you have to recompile your kernel to include Wacom support and Event Interface support.

Note that you may be required to recompile xorg-x11 with the 'sdk' use flag to compile linuxwacom succesfully.

[edit] Kernel

Once in menuconfig, we have to compile the devices used to control the Wacom tablet.

Linux Kernel Configuration: Enabling devices in older kernels
Device Drivers --->
    Input device support --->
        <*> Event interface
    USB Support --->
        <M> Wacom Intuos/Graphire tablet support


Linux Kernel Configuration: Enabling devices in the latest 2.6.20+ kernels
Device Drivers --->
    Input device support --->
        <*> Event interface
        [*] Tablets --->
             <M> Wacom Intuos/Graphire tablet support (USB)

Exit menuconfig and make the kernel.

make && make modules_install

Normally everyone has Event interface support compiled in so all you need is the Wacom driver itself.

Try modprobeing the module:

modprobe wacom

If you see errors (check with dmesg), install your new kernel and reboot to apply the changes.

If you have a Bamboo tablet, keep reading.

[edit] Kernel Bamboo Support

Note: If you are not a Wacom Bamboo user, or if you are a Bamboo user but you are using a 2.6.23 or higher kernel, skip this section and move on


Note: If you are a Wacom Bamboo Fun user the /drivers/input/tablet/wacom_wac.c file is missing the 0x17 id of the bamboo fun you'll have to add it manually or wait to be included in the kernel if you add the id manually (modify the static struct usb_device_id wacom_ids[] at the end of the file)you can skip this section

So here you are, with your shiny new Bamboo tablet and no support for it (yet). We will start by getting the 0.7.8 linuxwacom package and removing the old crud if you had it installed already:

emerge --unmerge linuxwacom

Now get the latest linuxwacom from the site: http://linuxwacom.sourceforge.net/index.php/dl Extract, configure, compile and install it:

tar xvjf linuxwacom-*.tar.bz2
cd linuxwacom-*
./configure <-- Check the result of configure at the end to see if it detected everything like it should
make
make install

Now, patch the kernel. I used the 2.6.22 Gentoo kernel as base. In the directory driver/input/tablets are a number of wacom_* files. You can find the same files in the linuxwacom directory under src/2.6.19/wacom_*. Backup the old kernel files and then copy the files into your kernel tree:

cp -R /usr/src/linux/drivers/input/tablets ~/kernel_backup
cp ~/linuxwacom-*/src/2.6.19/wacom_* /usr/src/linux/drivers/input/tablets

Ofcourse, substitute the paths with the ones you used on your system.

Now build the modules and install the modules (assuming you followed the guide this far):

make clean modules modules_install

If you had the module loaded (like I did), remove it and insert the new one:

rmmod wacom
modprobe wacom
dmesg

In dmesg, the last line should be something like:

drivers/input/tablet/wacom_sys.c: v1.46-pc0.1:USB Wacom Graphire and Wacom Intuos tablet driver

If you see (note the version number):

drivers/input/tablet/wacom_sys.c: v1.46:USB Wacom Graphire and Wacom Intuos tablet driver

Then something is going wrong: 1.46 or older are the non-Bamboo drivers, the 1.46-pc0.1 is the one adding Bamboo support.

To check if it worked:

cat /proc/bus/usb/devices | grep -A5 056a | grep Driver | grep wacom

If you see a line ending with Driver=wacom then everything is peachy and bob's your uncle (aka the wacom driver latched onto the device and is working) - otherwise retrace your steps and check out the documentation on the linuxwacom project site: http://linuxwacom.sourceforge.net/index.php/howto/main

[edit] setserial

Sometimes the touchscreens (and the tablets) are connected to some weird ports you're not likely to find. For this reason you should use setserial, which takes a port and tells a device to connect to that port. We're going to select /dev/ttyS0 because it's tested but it may be possible to select other ports.

First emerge setserial

# emerge setserial

and then connect the ports

# setserial /dev/ttS0 port 0x338 autoconfig

Remember to use /dev/ttyS0 in the Device options of the InputDevice section of your Xorg file.

[edit] Xorg

First of All, you have to check if you compiled xorg-server with "wacom" in INPUT_DEVICES= var. If not, you should make

/#INPUT_DEVICES="wacom" emerge xorg-server -p

Make sure that you have all your INPUT_DEVICES flags like "keyboard" and "mouse" and you have not flags with minus; if you have them, then you should add it do INPUT_DEVICES= var.

example:

/# INPUT_DEVICES="keyboard mouse wacom" emerge xorg-server

So, go on..

There are two ways of setting up the configuration for x.org.

Method 1 is a static method which is a little easier to setup. A downside is that you may need to reconfigure when you decide to plug your tablet into another USB-port.

Method 2 uses a tool called udev, which dynamically creates symbolic links to a device.

Note:

Modern Gentoo installations have udev as default device manager (very old installations might still use devfs or similar). Method 1 is quick and dirty, method 2 should be the preferred way on Gentoo these days.

[edit] METHOD 1 (static, not recommended)

We have to find out which input device the tablet is trying to use.

File: Devices
cat /proc/bus/input/devices

I: Bus=0003 Vendor=056a Product=0013 Version=0314
N: Name="Wacom Graphire3"
P: Phys=usb-0000:00:1f.4-2/input0
H: Handlers=mouse1 event2
B: EV=f
B: KEY=1c43 0 70000 0 0 0 0 0 0 0 0
B: REL=100
B: ABS=3000003

I: Bus=0003 Vendor=046d Product=c00c Version=0610
N: Name="Logitech USB Mouse"
P: Phys=usb-0000:00:04.2-2.3/input0
H: Handlers=mouse0 event1
B: EV=7
B: KEY=70000 0 0 0 0 0 0 0 0
B: REL=103

Taking a look at the H line containing Name="Wacom ...", we can tell what device our tablet uses. Using this information, we can configure xorg.conf correctly.

Update your xorg.conf file in a similar fashion like the example below.

If you also want to keep on using your existing mouse as well make sure to have a look at the configuration for your mouse in xorg.conf as well.

If the line containing 'Option "Device"' contains a reference to either a device called "psaux" or "mice", be sure to change it to the mouse device as shown in the H line for your mouse.

This will avoid conflicts between your mouse and tablet.

File: xorg.conf Core Pointers
# **********************************************************************
# Core Pointer's InputDevice section
# **********************************************************************

Section "InputDevice"
    Identifier    "Mouse0"
    Driver    "mouse"
    Option "Protocol"    "IMPS/2"
    Option "Device"      "/dev/input/mouse0"   # This can be called /dev/mouse0 on some systems.
    Option "ZAxis Mapping" "4 5"
    Option "Emulate3Buttons"
EndSection

Section "InputDevice"
    Driver "wacom"
    Identifier "cursor"
    Option "Device" "/dev/input/event2"
    Option "Type" "cursor"
    Option "USB" "on"
    Option "Vendor" "WACOM"
EndSection

Section "InputDevice"
    Driver "wacom"
    Identifier "stylus"
    Option "Device" "/dev/input/event2"
    Option "Type" "stylus"
    Option "USB" "on"
    Option "Vendor" "WACOM"
    Option "tilt" "on"  # add this if your tablet supports tilt
    Option "Threshold" "5"   # the official linuxwacom howto advises this line
EndSection

Section "InputDevice"
    Driver "wacom"
    Identifier "eraser"
    Option "Device" "/dev/input/event2"
    Option "Type" "eraser"
    Option "USB" "on"
    Option "Vendor" "WACOM"
    Option "tilt" "on"  # add this if your tablet supports tilt
    Option "Threshold" "5"   # the official linuxwacom howto advises this line
EndSection 


File: xorg.conf ServerLayout
# **********************************************************************
# ServerLayout sections.
# **********************************************************************

Section "ServerLayout"

    Identifier  "Simple Layout"

    Screen "Screen 1"

    InputDevice "Mouse0" "CorePointer"
    InputDevice "Keyboard1" "CoreKeyboard"
    InputDevice "cursor" "SendCoreEvents"
    InputDevice "stylus" "SendCoreEvents"
    InputDevice "eraser" "SendCoreEvents"

EndSection


[edit] METHOD 2 (dynamic using udev)

In contradiction to method 1 we do not have to find out which input device the tablet is trying to use. We are going to tell the system to create a link to whichever device the tablet uses. After that we'll tel x.org to use that link instead of the device in order to communicate with the tablet.

Warning: Be sure to use a recent version of udev - currently 114 is stable - or you'll get errors while setting up the rules below


Note: In this howto I'll be using a simple logitech mouse as well.

I did this because most people will want to have their tablet AND a mouse to function.

If you need the tablet only, just ignore the mouse bits.


Note: I doubt the mouse parts are still usefull because modern udev systems create /dev/input/mouse* links on their own

If you don't have udev running on your system, obtain it by running

# emerge udev

After udev has emerged, we need to find a method to uniquely identify our tablet. To do this run the command lsusb.

# lsusb
Bus 002 Device 001: ID 0000:0000
Bus 001 Device 004: ID 046d:c00c Logitech, Inc. Optical Wheel Mouse
Bus 001 Device 003: ID 0451:1446 Texas Instruments, Inc. TUSB2040/2070 Hub
Bus 001 Device 002: ID 056a:0013 Wacom Co., Ltd
Bus 001 Device 001: ID 0000:0000

The output is read as: Bus number device number VendorID:ProductID Description.

As you can see the VendorID for wacom is 056a, and the product ID for my graphire 3 tablet is 0013.

Now we're going to create a rules file for udev, so it'll know what device to attach to which link.

# cd /etc/udev/rules.d/
localhost rules.d # ls
05-udev-early.rules        60-persistent-storage.rules  70-persistent-cd.rules             80-hotplug.rules
10-local.rules             60-vmware.rules              70-persistent-net.rules            90-hal.rules
50-udev.rules              64-device-mapper.rules       75-cd-aliases-generator.rules      95-udev-late.rules
60-persistent-input.rules  70-bluetooth.rules           75-persistent-net-generator.rules  99-fuse.rules

Your listing might vary but we are interested in 10-local.rules. This is the file to put your own modifications in so open up your editor and add the following to the end:

File: 10-local.rules
 KERNEL=="event*", SYSFS{idVendor}=="056a", NAME="input/%k", SYMLINK="input/wacom"
 KERNEL=="mouse*", SYSFS{idProduct}=="c00c", NAME="input/%k", SYMLINK="input/mouse_udev"

As you can see in the example, I used the ProductID for my mouse, and the VendorID for my tablet. Update this with your mouse if needed, or leave the first line out. Now save the file and start udev with the command : (No need to reboot)

# udevstart

To test our devices cd to the directory /dev/input and see if they were created.

# cd /dev/input
localhost input # ls
event0  event2  mice    mouse_udev
event1  event3  mouse0  wacom
Note: You can actually "see" the devices work by reading their output on your screen.
# cat wacom

When you move the pen over the tablet something like below should appear on your screen:

 (ÿ((ÿ(ÿ(ÿ(ÿ((þ(þ8ÿü8üý8ûü8üþ8ýÿ8þÿ??ÿ(ÿ(ÿ(ÿ(ÿ(ÿ(ÿ(þ(ý(ü(þ(ý(þ(þ(þ(þ(ÿ(ÿ(ÿ(ÿ?ÿ?ÿ??ÿ?ÿ

When you move the mouse nothing should happen. If you do the same trick with the mouse, the same happens but than the other way around of course. If our device(s) work, now we only need to update our /etc/X11/xorg.conf file.

The example below matches the example just given.

File: xorg.conf_
Section "InputDevice"
    Identifier  "Mouse1"
    Driver      "mouse"
    Option      "CorePointer"
    Option      "Device"             "/dev/input/mouse_udev"
    Option      "SendCoreEvents"     "true"
    Option      "Protocol"           "IMPS/2"
    Option      "ZAxisMapping"       "4 5"
    Option      "Buttons"            "5"
EndSection

Section "InputDevice"
    Driver        "wacom"
    Identifier    "stylus"
    Option        "Device"       "/dev/input/wacom"
    Option        "Type"         "stylus"
    Option        "USB"          "on"                 # USB ONLY
    Option        "Mode"         "Relative"           # other option: "Absolute"
    Option        "Vendor"       "WACOM"
    Option        "tilt"         "on"  # add this if your tablet supports tilt
    Option        "Threshold"    "5"   # the official linuxwacom howto advises this line
EndSection

Section "InputDevice"
    Driver        "wacom"
    Identifier    "eraser"
    Option        "Device"       "/dev/input/wacom"
    Option        "Type"         "eraser"
    Option        "USB"          "on"                  # USB ONLY
    Option        "Mode"         "Relative"            # other option: "Absolute"
    Option        "Vendor"       "WACOM"
    Option        "tilt"         "on"  # add this if your tablet supports tilt
    Option        "Threshold"    "5"   # the official linuxwacom howto advises this line
EndSection

Section "InputDevice"
    Driver        "wacom"
    Identifier    "cursor"
    Option        "Device"       "/dev/input/wacom"
    Option        "Type"         "cursor"
    Option        "USB"          "on"                  # USB ONLY
    Option        "Mode"         "Relative"            # other option: "Absolute"
    Option        "Vendor"       "WACOM"
EndSection
Note: You should probably use the absolute mode on the stylus and eraser because otherwise drawing feels pretty much the same as with a mouse.

and edit the serverLayout to something like (this was missing - took me ages to find out :P )

File: xorg.conf ServerLayout
# **********************************************************************
# ServerLayout sections.
# **********************************************************************

Section "ServerLayout"

    Identifier  "Simple Layout"

    Screen "Screen 1"

    InputDevice "Mouse0" "CorePointer"
    InputDevice "Keyboard1" "CoreKeyboard"
    InputDevice "cursor" "SendCoreEvents"  # add these 3 lines
    InputDevice "stylus" "SendCoreEvents"
    InputDevice "eraser" "SendCoreEvents"

EndSection
Note: In my case it happened that the eraser and pen were reversed; switching the InputDevice lines for stylus and eraser seems to solve this issue.

[edit] Graphire4 buttons

You will probably need linuxwacom 0.7.4 or higher for this to work with xorg 7.

Add the following line to the "ServerLayout" section of your /etc/X11/xorg.conf file:

InputDevice    "pad" "SendCoreEvents"
Note: I came across info advising NOT to add "SendCoreEvents" to the line. However without it the buttons will not work. In combination with the ButtonsOnly option -see below- the problems described elsewhere will not occur.

Then you will need to add an InputDevice section. Here is what I have in my /etc/X11/xorg.conf file.

File: xorg.conf
Section "InputDevice"
        Identifier  "pad"
        Driver      "wacom"
        Option      "Type" "pad"
        Option      "Device" "/dev/input/event2"
        Option      "ButtonsOnly" "on"
        Option      "Button9" "2"
        Option      "Button13" "3"
        Option      "USB" "on"
EndSection

The important option is the one with "ButtonsOnly" "on". Without this option as soon as you activate any button on the pad the pointer will jump to the top left corner of the screen. Since there is nothing to scroll there the wheel on the pad will not seem to work. With the ButtonsOnly option the wheel on the pad should work. To get the other two buttons to do something usefull they need to be mapped. I got the Button9 and Button13 info by running:

# xidump pad

in a terminal and pressing the buttons on the pad. Do this before you map the buttons.


[edit] Intuos3 buttons

To get the two sliders and the eight buttons working on an Intuos3 you should download expresskeys and install it according to the instructions in the package. It will also tell you how to map the buttons properly etc.

For it all to work you should Add the following line to the "ServerLayout" section of your /etc/X11/xorg.conf file:

InputDevice    "pad" # It is important that pad does not send core events

And add the following InputDevice section:

File: xorg.conf
Section "InputDevice"
        Identifier  "pad"
        Driver      "wacom"
        Option      "Type" "pad"
        Option      "Device" "/dev/input/wacom"
        Option      "ButtonsOnly" "off"
        Option      "USB" "on"
EndSection

[edit] Linux Wacom tools

  • xsetwacom - Used by wacomcpl to set wacom device parameters
  • wacomcpl - Wacom Configuration Panel, used to change options for Wacom. (requires tcltk)

settings from *wacomcpl can be made permanent in xorg.conf:

File: /etc/X11/xorg.conf
Section "InputDevice"
    Driver        "wacom"
    Identifier    "stylus"
    Option        "Device"       "/dev/input/wacom"
    Option        "Type"         "stylus"
    Option        "USB"          "on"                 # USB ONLY
    Option        "Mode"         "Absolute"           # other option: "Relative"
    Option        "Vendor"       "WACOM"
    Option        "TopX"         "180"
    Option        "TopY"         "130"
    Option        "BottomX"      "10028"
    Option        "BottomY"      "7294"
EndSection
  • wacomcpl-exec - Same as wacomcpl
  • wacdump - Used to dump raw data from the Wacom tablet
  • xidump - Used to dump raw data from Xorg configuration
Personal tools