Difference between revisions of "Wacom Tablet"

From ArchWiki
Jump to: navigation, search
(TwinView addition)
(Xorg input hotplugging setup)
Line 238: Line 238:
  
 
  InputDevice    "Mouse1" "CorePointer"
 
  InputDevice    "Mouse1" "CorePointer"
 +
 +
==Xorg input hotplugging setup==
 +
 +
For using a wacom/WALTOP/N-Trig tablet with Xorg hotplugging.
 +
Create /etc/hal/fdi/policy/custom_wacom.fdi with this code and restart X and HAL:
 +
 +
<?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>
 +
    <!-- N-Trig Duosense Electromagnetic Digitizer -->
 +
    <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>
  
 
= The GIMP =
 
= The GIMP =

Revision as of 18:39, 17 March 2009


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.

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

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 (/etc/X11/xorg.conf).

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 /dev/input/event7.

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 (/etc/X11/xorg.conf) 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 xorg.conf file. You may read more about that HERE

Graphire4 buttons

	InputDevice    "pad" "SendCoreEvents"

Add this to the ServerLayout section of your Xorg config (/etc/X11/xorg.conf).

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 (/etc/X11/xorg.conf) 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 (/var/log/Xorg.0.log) 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 /dev/input/ts3 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 /etc/rc.conf

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 xorg.conf 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 10-local.rules 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 /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"         "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"

Xorg input hotplugging setup

For using a wacom/WALTOP/N-Trig tablet with Xorg hotplugging. Create /etc/hal/fdi/policy/custom_wacom.fdi with this code and restart X and HAL:

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

<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>

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.

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