Wacom Tablet

From ArchWiki
Revision as of 22:57, 26 April 2010 by Foxbunny (Talk | contribs) (Try Autodetection First: updated instructions to match latest developments)

Jump to: navigation, search


Introduction

Before we begin, I would like to point out that this guide is only for a USB based Wacom tablets. Futhermore, you can either setup a 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. Finally this guide is based on my experience of installing my Graphire4 tablet, so others may like to add things specific to other Wacom tablets. I do welcome others to update this wiki to include a wider range of information.

I'd also like to mention that this wiki 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 should be able to automatically detect and configure your device. Before going any further, try installing the xf86-input-wacom package from AUR, reboot your system, and start the X.

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.

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

Installing

Install Linuxwacom

Thanks to The Linux Wacom Project, you only need to install the linuxwacom package, which contains everything needed to use a Wacom tablet on Linux. You can get this from the AUR.

Configure Xorg

Note: Static configuration is deprecated by the X.org project. Consider using HAL (see below) instead to get hotplugging and automatic configuration.

Again, I'd like to make note that I only cover how to setup 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.

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"
	Option      "USB" "on"
	Option      "Mode" "Absolute"
	Option      "Vendor" "WACOM"
	Option      "Threshold" "5"
EndSection

Section "InputDevice"
	Identifier  "eraser"
	Driver      "wacom"
	Option      "Type" "eraser"
	Option      "Device" "/dev/input/event7"
	Option      "USB" "on"
	Option      "Mode" "Absolute"
	Option      "Vendor" "WACOM"
	Option      "Threshold" "5"
EndSection

Section "InputDevice"
	Identifier  "cursor"
	Driver      "wacom"
	Option      "Type" "cursor"
	Option      "Device" "/dev/input/event7"
	Option      "USB" "on"
	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 apsect 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

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"
	Option      "USB" "on"
	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.

Xorg crashes when logging in

In case that happens to you you need to apply this patch to Xorg and recompile it (from http://sourceforge.net/tracker/index.php?func=detail&aid=1843335&group_id=69596&atid=525124):

diff -ur xorg-server-1.4.orig/xkb/xkbLEDs.c xorg-server-1.4/xkb/xkbLEDs.c
--- xorg-server-1.4.orig/xkb/xkbLEDs.c  2007-11-01 20:49:02.000000000
+0100
+++ xorg-server-1.4/xkb/xkbLEDs.c       2007-11-01 20:48:03.000000000
+0100
@@ -63,6 +63,9 @@

		sli= XkbFindSrvLedInfo(dev,XkbDfltXIClass,XkbDfltXIId,0);

+    if (!sli)
+       return 0;
+
		if (state_changes&(XkbModifierStateMask|XkbGroupStateMask))
			update|= sli->usesEffective;
		if (state_changes&(XkbModifierBaseMask|XkbGroupBaseMask))

Be advised that this patch could lead to unexpected behavior. It's no official patch and only use it at your own risk.


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.

Dynamic (udev) Xorg setup

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. 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 start udev using the command /etc/start_udev Check to make sure that it has appeared in /dev/input.

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 (Template:Codeline) to your mouse, as it will be Template:Codeline 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"

Xorg input hotplugging setup

To use a Wacom/WALTOP/N-Trig tablet with 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.

WALTOP tablet support by the Wacom drivers

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 don't 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

To get your tablet working in 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.

References