Wacom Tablet

From ArchWiki
Revision as of 21:38, 30 December 2011 by Giniu (Talk | contribs) (linuxwacom is no longer name of the drivers, also there is no linuxwacom package in AUR anymore. Instead, told users about git versions of drivers)

Jump to: navigation, search

This template has only maintenance purposes. For linking to local translations please use interlanguage links, see Help:i18n#Interlanguage links.


Local languages: Català – Dansk – English – Español – Esperanto – Hrvatski – Indonesia – Italiano – Lietuviškai – Magyar – Nederlands – Norsk Bokmål – Polski – Português – Slovenský – Česky – Ελληνικά – Български – Русский – Српски – Українська – עברית – العربية – ไทย – 日本語 – 正體中文 – 简体中文 – 한국어


External languages (all articles in these languages should be moved to the external wiki): Deutsch – Français – Română – Suomi – Svenska – Tiếng Việt – Türkçe – فارسی

Introduction

Before we begin, I would like to point out that this guide was started for USB based Wacom tablets, so much of the info in here focuses on that. For an internal tablet device (like the serial devices found in many Tablet PCs) a static Xorg is recommended in case autodetection doesn't work. For USB devices, you can setup both static Xorg configuration, meaning things may not work if later on you plug your Wacom tablet into a different USB port, or follow the dynamic instructions further down.

It's also worth to mention that this wiki article is very much influenced by the very helpful Gentoo Linux Wiki - HOWTO Wacom Tablet, which I recommend anyone visit if they would like to learn about things that are not covered here.

Try Autodetection First

Newer versions of X might be able to automatically detect and configure your device. Before going any further, try installing the xf86-input-wacom package, reboot your system, and (re-)start X. With the arrival of Xorg 1.8 that dropped support for HAL in favor of udev, autodetection might be broken for sometablets as fitting udev rules might not exist yet, so you need to write your own.

If you have linuxwacom or linuxwacom-dev and X fails to start, remove those packages first. They are known to cause problems with newer version of X. xf86-input-wacom is the only package you need to install the kernel drivers.

Test if your device was recognized completely (i.e., that both pen and eraser work, if applicable), by opening gimp or xournal and checking the extended input devices section, or whatever tablet-related configuration is supported by the software of your choice.

Installing

Install Wacom drivers

Thanks to The Linux Wacom Project, you only need to install the xf86-input-wacom package, which contains everything needed to use a Wacom tablet on Linux. There is also xf86-input-wacom-git in AUR which provides git version of xf86-input-wacom. In case of new devices not supported by current kernel, it is also possible to install git version of kernel driver from: stable branch (wacom-linux-git), next branch (wacom-next-linux-git) or mainline branch (wacom-mainline-linux-git).

Dynamic Xorg setup with udev

Again thanks to Gentoo Linux Wiki - HOWTO Wacom Tablet for the information! This was done with a Volito2, and so reflects the experiences with that tablet, but it should work for any tablet supported by the linuxwacom project.

Note: The linuxwacom package from AUR already includes a udev-rules-file, so you might skip this part and move on to the Template:Filename configuration if you're using the linuxwacom package from AUR.

Install udev from the repositories (when using Xorg > 1.8, this is a dependency and will already be installed). Run the lsusb command. It should return something like this

Bus 002 Device 007: ID 056a:0062 Wacom Co., Ltd
Bus 002 Device 006: ID 03eb:0902 Atmel Corp.
Bus 002 Device 005: ID 0bc2:0503 Seagate RSS LLC
Bus 002 Device 004: ID 05e3:0660 Genesys Logic, Inc. USB 2.0 Hub
Bus 002 Device 001: ID 1d6b:0002
Bus 003 Device 001: ID 1d6b:0001
Bus 001 Device 003: ID 06a3:8000 Saitek PLC
Bus 001 Device 002: ID 045e:00d1 Microsoft Corp.
Bus 001 Device 001: ID 1d6b:0001

You can see from here my tablet among other devices. We are interested in the tablet and mouse - unless there is no mouse attached to the said computer of course. Next make the file Template:Filename in /etc/udev/rules.d. You need to add these two lines

KERNEL=="event*", SYSFS{idVendor}=="056a", NAME="input/%k", SYMLINK="input/wacom"
KERNEL=="mouse*", SYSFS{idProduct}=="045e", NAME="input/%k", SYMLINK="input/mouse_udev"

Of course you need to change '056a' and '045e' to what lsusb returns for you – I used the VendorID for my tablet and the ProductID for my mouse. Save the file and reload udev's configuration profile using the command udevadm control --reload-rules Check to make sure that it has appeared in /dev/input. Note that you may need to plug-in the tablet again for the device to appear.

bash-3.2# cd /dev/input
bash-3.2# ls
by-id    event0  event2  event4  event6  event8  mouse0  mouse2      wacom
by-path  event1  event3  event5  event7  mice    mouse1  mouse_udev

You can even check that the device works by

# cat wacom

It should make lots of odd characters appear onscreen. If it works, then all that is left to do is add the relevent information to Template:Filename.

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

Make sure that you also change the path ("Device") to your mouse, as it will be /dev/input/mouse_udev now.

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

Add this to the ServerLayout section

InputDevice "cursor" "SendCoreEvents" 
InputDevice "stylus" "SendCoreEvents"
InputDevice "eraser" "SendCoreEvents"

And finally make sure to update the indentifier of your mouse in the ServerLayout section – as mine went from

InputDevice    "Mouse0" "CorePointer"

to

InputDevice    "Mouse1" "CorePointer"

Tablet PC with serial Wacom tablet device (Xorg > 1.8)

Create /etc/udev/rules.d/10-wacom.rules with these lines:

ACTION!="add|change", GOTO="wacom_end"
   # Match all wacom tablets with a serial ID starting with WACf or FUJ*
   ATTRS{id}=="WACf*" ENV{NAME}="Serial Wacom Tablet", ENV{ID_INPUT}="1", ENV{ID_INPUT_TABLET}="1"
   ATTRS{id}=="FUJ*" ENV{NAME}="Serial Wacom Tablet", ENV{ID_INPUT}="1", ENV{ID_INPUT_TABLET}="1"
LABEL="wacom_end"

Dynamic Xorg setup with HAL

Note: In Xorg 1.8 and later, support for HAL is dropped. Input hotplugging will NOT work with these versions of X, you need to use udev (see above) instead.
Note: The linuxwacom package from AUR already includes a fitting fdi file, so you might skip this part and just try out if it works after installing linuxwacom and restarting X.

To use a Wacom/WALTOP/N-Trig tablet with HAL Xorg hotplugging create Template:Filename with this code:

<?xml version="1.0" encoding="UTF-8"?> <!-- -*- SGML -*- -->

<deviceinfo version="0.2">
 <device>
   <match key="info.capabilities" contains="input">
     <match key="info.product" contains="Wacom">
       <merge key="input.x11_driver" type="string">wacom</merge>
       <merge key="input.x11_options.Type" type="string">stylus</merge>
     </match>
     <match key="info.product" contains="WALTOP">
       <merge key="input.x11_driver" type="string">wacom</merge>
       <merge key="input.x11_options.Type" type="string">stylus</merge>
     </match>
   </match>
   <match key="info.product" contains="HID 1b96:0001">
     <match key="info.parent" contains="if0">
      <merge key="input.x11_driver" type="string">wacom</merge>
      <merge key="input.x11_options.Type" type="string">stylus</merge>
     </match>
   </match>
  </device>
 </deviceinfo>

Then kill your X server, restart HAL and start the X server again.

Following fdi file is known to work with the Bamboo Fun tablet (model CTE-650). Using this file corrects several problems with the stylus that appear when using the default fdi file above. Create the file Template:Filename with the following contents:

<?xml version="1.0" encoding="UTF-8"?>
<deviceinfo version="0.2">
  <device>
    <match key="info.category" contains="input">
      <match key="info.product" contains_outof="Wacom">
        <merge key="input.x11_driver" type="string">wacom</merge>
        <merge key="input.x11_options.Type" type="string">pad</merge>
        <append key="info.callouts.add" type="strlist">hal-setup-wacom</append>
        <append key="wacom.types" type="strlist">eraser</append>
        <append key="wacom.types" type="strlist">cursor</append>
        <append key="wacom.types" type="strlist">stylus</append>
      </match>
    </match>
    <match key="info.capabilities" contains="serial">
      <match key="@info.parent:pnp.id" contains_outof="WACf001;WACf002;WACf003;WACf004;WACf005;WACf006;WACf007;WACf008;WACf009;WACf00a;WACf00b;WACf00c;FUJ02e5">
        <append key="info.capabilities" type="strlist">input</append>
        <merge key="input.x11_driver" type="string">wacom</merge>
        <merge key="input.x11_options.Type" type="string">pad</merge>
        <merge key="input.x11_options.ForceDevice" type="string">ISDV4</merge>
        <merge key="input.device" type="copy_property">serial.device</merge>
        <append key="info.callouts.add" type="strlist">hal-setup-wacom</append>
        <append key="wacom.types" type="strlist">stylus</append>
        <match key="@info.parent:pnp.id" contains_outof="WACf008;WACf009">
          <append key="wacom.types" type="strlist">touch</append>
        </match>
      </match>
    </match>
  </device>
  <device>
    <match key="info.capabilities" contains="input.mouse">
      <match key="info.product" contains="WACOM">
        <match key="info.product" contains="Tablet">
          <merge key="input.x11_driver" type="string">wacom</merge>
          <merge key="input.x11_options.Type" type="string">pad</merge>
          <append key="info.callouts.add" type="strlist">hal-setup-wacom</append>
          <append key="wacom.types" type="strlist">eraser</append>
          <append key="wacom.types" type="strlist">cursor</append>
          <append key="wacom.types" type="strlist">stylus</append>
        </match>
      </match>
    </match>
  </device>
</deviceinfo>

Calibrating Tablet

In order for calibration to work even when the screen is rotated (this applies for both serial and USB tablets), the wacom-names script is useful. It renames your X input devices so that they can be recognized by the linuxwacom driver. Download it from here. You need to be a Ubuntu forums member to download it. If you are not, here is the script. Remember, it was originally intended for Ubuntu so the instructions do not all apply to us Archers:

# wacom-names script by Roger E. Critchlow, Jr. (4-12-09)
#   modified by gali98/Favux (4-14-09)
#
# Place the wacom-names script in  /etc/init.d/wacom-names and link it as
# /etc/rc{2,3,4,5}.d/S27wacom-names.
# Use "sudo update-rc.d wacom start 27 2 3 4 5 ." or "sudo update-rc.d wacom defaults 27".
# Using S27 starts the script after hal and before gdm.  This allows us to modify the hal
# properties before the xserver sees them for the first time.
#
# The script renames the input devices back to what wacomcpl and xsetwacom expect them to
# be, so rotation and interactive calibration work.  It also enables xorg.conf & .xinitrc
# style configuration of Wacom features like the stylus button(s) and calibration.
#
# The script needs to be executable.  chmod +x wacom-names

#! /bin/sh
## find any wacom devices
for udi in `hal-find-by-property --key input.x11_driver --string wacom`
do
type=`hal-get-property --udi $udi --key input.x11_options.Type`
## rewrite the names that the Xserver will use
hal-set-property --udi $udi --key info.product --string $type
#
## To add a xorg.conf or xsetwacom (.xinitrc) style configuration, say mapping a stylus
## button, you could add to the script:
#case $type in
#stylus|eraser)
## eg:  map stylus button 2 to mouse button 3 (right click)
#hal-set-property --udi $udi --key input.x11_options.Button2 --string 3
#
#;;
#esac
done

Copy and paste and (or directly) save it as wacom-names to /etc/rc.d and make it an executable.

# chmod +x /etc/rc.d/wacom-names

Add wacom-names to the DAEMONS line in your Template:Filename. Make sure to put it after HAL, and do not background HAL, because this script will not work if it runs before HAL has started. For example:

DAEMONS=(syslog-ng @crond hal @acpid @alsa @gpm wacom-names)

Reboot your computer. From here you can either keep wacom-names in your rc.conf if your rotation script calls on xsetwacom directly, or if you just need the calibration data, you can now use wacomcpl.

If you are looking for more information, this thread at the Ubuntu forums is incredibly useful, and also provided the link to Rec's wacom-names script.

Static Xorg config

Note: Static configuration is deprecated by the X.org project. If you are using a version of Xorg 1.8 or newer, try configuring with udev (see above) first. If you are using a using Xorg older than 1.8, consider using HAL (see above) instead. These approaches will give you the ability for hotplugging and automatic configuration.

This is a static Xorg configuration, meaning things may not work if later on you plug your Wacom tablet into a different USB port.

	InputDevice    "cursor" "SendCoreEvents"
	InputDevice    "stylus" "SendCoreEvents"
	InputDevice    "eraser" "SendCoreEvents"

Firstly, add these to the ServerLayout section of your Xorg config (Template:Filename).

$ cat /proc/bus/input/devices

Now we need to determine the location of your tablet device. Run the command above, and take note of the event number of the Handlers row. We will use this to set the correct device in our Xorg config below. If you are using a serial tablet, chances are that there will not be any such device displayed here. Try

$ cat /dev/ttyS0

and move the pen on the tablet. If pen movement makes garbage characters show up on screen, this is your tablet device. In this case, use this as the "Device" option as seen below.

I: Bus=0003 Vendor=056a Product=0016 Version=0403
N: Name="Wacom Graphire4 6x8"
P: Phys=
S: Sysfs=/class/input/input7
H: Handlers=mouse2 event7 ts2 
B: EV=1f
B: KEY=1c63 0 70011 0 0 0 0 0 0 0 0
B: REL=100
B: ABS=100 3000003
B: MSC=1

Here is an example of the output for my Graphire4 tablet. From this, we can determine that my tablet device goes through Template:Filename.

Section "InputDevice"
	Identifier  "stylus"
	Driver      "wacom"
	Option      "Type" "stylus"
	Option      "Device" "/dev/input/event7" #for serial tablet, this might be e.g. "/dev/ttyS0" instead
	Option      "USB" "on" #remove this line for serial tablets
	Option      "Mode" "Absolute"
	Option      "Vendor" "WACOM"
	Option      "Threshold" "5"
EndSection

Section "InputDevice"
	Identifier  "eraser"
	Driver      "wacom"
	Option      "Type" "eraser"
	Option      "Device" "/dev/input/event7" #for serial tablet, this might be e.g. "/dev/ttyS0" instead
	Option      "USB" "on" #remove this line for serial tablets
	Option      "Mode" "Absolute"
	Option      "Vendor" "WACOM"
	Option      "Threshold" "5"
EndSection

Section "InputDevice"
	Identifier  "cursor"
	Driver      "wacom"
	Option      "Type" "cursor"
	Option      "Device" "/dev/input/event7" #for serial tablet, this might be e.g. "/dev/ttyS0" instead
	Option      "USB" "on" #remove this line for serial tablets
	Option      "Mode" "Absolute"
	Option      "Vendor" "WACOM"
EndSection

Now update your Xorg config (Template:Filename) as above.

To learn about each of the Wacom tablet Xorg options checkout the man pages found at Linux Wacom Project HOWTO - 5.1 - Adding the InputDevices.

I recommend you checkout Linux Wacom Project HOWTO - 5.0 - Configuring X11, I also recommend you checkout Gentoo Linux Wiki - HOWTO Wacom Tablet - Installing - Xorg.

TwinView Setup

If you are going to use two Monitors the aspect ratio while using the Tablet might feel unnatural. In order to fix this you need to add

Option "TwinView" "horizontal"

To all of your Wacom-InputDevice entries in the Template:Filename file. You may read more about that HERE

Xrandr Setup

xrandr sets two monitors as one big screen, mapping the tablet to the whole virtual screen and deforming aspect ratio. For a solution see this thread: archlinux forum.

Graphire4 buttons

	InputDevice    "pad" "SendCoreEvents"

Add this to the ServerLayout section of your Xorg config (Template:Filename).

Section "InputDevice"
	Identifier  "pad"
	Driver      "wacom"
	Option      "Type" "pad"
	Option      "Device" "/dev/input/event7"  #for serial tablet, this might be e.g. "/dev/ttyS0" instead
	Option      "USB" "on"#remove this line for serial tablets
	Option      "ButtonsOnly" "on"
EndSection

Now update your Xorg config (Template:Filename) as above.

I recommend you checkout Gentoo Linux Wiki - HOWTO Wacom Tablet - Installing - Xorg - Graphire4 buttons.

Tablet devices still do not appear

Start Xorg with tablet connected. Then look at logs (Template:Filename) and search for those errors:

 Error opening /dev/input/wacom : Success
 (EE) xf86OpenSerial: Cannot open device /dev/input/wacom
         No such file or directory.

This error will show even when device exists.

Second error is

 usbDetect: can not ioctl version
 Wacom xf86WcmWrite error : Invalid argument

If there are those errors, check if your wacom device is Template:Filename or another ts device (or symlink to this device). If it is, then device is handled by Compaq touchscreen emulation. This is tsdev module. Just unload the module

 # modprobe -r tsdev

and add this module to blacklist in Template:Filename.

WALTOP tablet support by the Wacom drivers

Note: The 'linuxwacom' package is now unsupported, and the drivers are only recommended for use with Xorg 1.7 or older. For current drivers (Xorg >= 1.8), use the 'xf86-input-wacom' package from extra (It should not require this patch).

Since lately Wacom drivers cannot be started with WALTOP tablets, although the functionality is present. This is due to a vendor check in the wacom X.org driver. To bypass this check, download the linuxwacom sources (for example, the linuxwacom-cvs package from AUR) and apply a similar patch to Template:Filename:

% cat wcmUSB.c.diff 
528,529c528,529
< 	/* vendor is wacom */
< 	if (sID[1] == 0x056A)
---
> 	/* vendor is wacom or waltop*/
> 	if (sID[1] == 0x056A || sID[1] == 0x172f)


The GIMP

To enabled proper usage, and pressure sensitive painting in The GIMP, just go to Preferences → Input Devices → Configure Extended Input Devices.... Now for each of your eraser, stylus, and cursor devices, set the mode to Screen, and remember to save.

  • Please take note that if present, the pad device should be kept disabled as I do not think The GIMP supports such things. Alternatively, to use such features of your tablet you should map them to keyboard commands with a program such as Wacom ExpressKeys.
  • You should also take note that the tool selected for the stylus is independent to that of the eraser. This can actually be quite handy, as you can have the eraser set to be used as any tool you like.

I recommend you checkout Linux Wacom Project HOWTO - 10.0 - Working With Gimp, and the Setting up GIMP section of GIMP Talk - Community - Install Guide: Getting Wacom Drawing Tablets To Work In Gimp.

Inkscape

As in The GIMP, to do the same simply got to File → Input Devices.... Now for each of your eraser, stylus, and cursor devices, set the mode to Screen, and remember to save.

Krita

Krita 2.0 and later only require that QT is able to use your tablet to function properly. If your tablet is not working in Krita, then make sure to check it's working in QT first. The effect of tablet pressure can then be tweaked in the painttop configuration, for example by selecting opacity, then selecting pressure from the drop down and adjusting the curve to your preference.

For earlier versions of Krita, simply go to Settings → Configure Krita... Click on Tablet and then like in Inkscape and GIMP set stylus and any others' mode to screen.

Bamboo

Note: Some users reported problems with linuxwacom 0.8.1-1 and Bamboo. Their Cursor jumped around when trying to use the stylus-tilt to avoid that problem simply use linuxwacom 0.8.0 (You can simply edit the pkgver in the PKGBUILD).

If you use an older version of linuxwacom it could happen that you will not be able to use your pen with GIMP or Inkscape when configured as above since the stylus is firing a button2 event instead of a button1 event, same with the eraser. To correct this add (don't just copy and paste the whole section, just add the part about the buttons) these lines to the appropriate section of your xorg.conf.

Section "InputDevice"
	Driver        "wacom"
	Identifier    "stylus"
	Option        "Button1"      "1"	#this line is important
	Option        "Button2"      "1"	#this line is important
EndSection
Section "InputDevice"
	Driver        "wacom"
	Identifier    "eraser"
	Option        "Button1"      "1"	#this line is important
	Option        "Button2"      "1"	#this line is important
EndSection

Be adviced that this way pressure sensitive painting in GIMP and Inkscape will work but the lower button of the pen will also fire a button1 event same as the stylus and eraser. You can not configure any other button for Button2, it got to be the same as Button1! There is no need to add these lines to the cursor section since the bamboo doesn't ship a mouse, still i advice you not to remove the cursor device as an input device, not even from the serverlayout section. That lead to an unstable xserver in my case.

If you are relying on hotplugging, the default fdi file contained in the packages xf86-input-wacom and linuxwacom will most likely not fully support your Bamboo tablet (e.g. stylus not working properly). Refer to the section on hotplugging above for a custom fdi file that supports the Bamboo (tested with model CTE-650).

Wacom and VirtualBox

My current setup is :

 Guest OS: Windows XP
 Tablet: Wacom Graphire4
 Linux Driver: xf86-input-wacom 0.8.4-1

First, make sure that your tablet works well under Arch. Then, download and install the last driver from Wacom website on the guest OS. Shutdown the virtual machine, go to Settings > USB. Select Add Filter From Device and select your tablet (e.g. WACOM CTE-440-U V4.0-3 [0403]). Select Edit Filter, and change the last item Remote to Any.

Linuxwacom 0.8.1 bug

If you have trouble with the linuxwacom 0.8.1 beta/developer version driver as reported HERE, such as when you apply pressure the cursor freezes then you should try the linuxwacom 0.8.0 production version. Just download the existing PKGBUILD and other files from the AUR and change pkgver from 0.8.1 to 0.8.0, and the first md5sum from 4b78f1b66f6e9097a393cf1e3cdf87a3 to 1d89b464392515492bb7b97c20e68d4e.

Pressure curves

You can add two options to xorg.conf to change how the pressure is registered when putting pressure on the pen. Example:

 Option        "PressCurve"    "50,0,100,50"         # Custom preference
 Option        "Threshold"     "60"                  # sensitivity to do a "click"

References