个人工具

UbuntuHelp:Install linuxwacom driver

来自Ubuntu中文

跳转至: 导航, 搜索

<<Include(Tag/ContentCleanup)>> <<Include(Tag/TooLong)>>

目录

Introduction

This document began in November 2002 as a HOWTO for setting up a USB Wacom Intuos2 on Redhat 8.0. It has since grown to cover all Wacom tablets, USB and serial, running on various different Linux distributions. As of December 2002, this project has transformed into the Linux Wacom Project. Work on this document is on-going so if you find an error, have a question, or have something to add, please send an email to: linuxwacom-discuss@lists.sf.net.

Success Stories

This page documents different distributions tested by myself or reported from the users in the discussion mailing list. If you have success stories for a distribution or version not mentioned, let me know so I can update the page.

  • Redhat
  • Fedora Core 4 - tested on kernel 2.6.14 & 2.6.12, X.org 6.8
  • Fedora Core 3 - tested on kernel 2.6.11-1.14_FC3 & 2.6.9, X.org 6.8 (see [[UbuntuHelp:[debwacomnosrc|Building wacom driver On Fedora Core 3]]])
  • Fedora Core 2 final - tested on kernel 2.6.5-1.358
  • Fedora Core 2 test1 - tested on kernel 2.6.1-1
  • Fedora Core 1 - tested on kernel ???
  • Redhat 9.0 - tested on kernel 2.4.20-6, 2.4.22, 2.4.24, 2.6.0, & 2.6.2
  • Redhat 8.0 - tested on kernel 2.4.18-17.8.0, 2.4.18-18.8.0, 2.4.18-19.8.0, & 2.4.18-24.8.0
  • Redhat 7.3 - tested on kernel 2.4.18-17.7.x
  • Redhat 7.2 - tested on kernel 2.4.18-17.7.x
  • Redhat Enterprise Linux 3 - tested on kernel 2.4.21-4
  • Redhat Enterprise Linux 4 - tested on kernel 2.6.9
  • Mandrake
  • Mandriva 2006 32bit december club - tested on 2.6.12-12mdksmp X.org 6.9.0
  • Mandriva 2006 (Powerpack) - tested on 2.6.12-12mdksmp X.org 6.8.99.900 (6.9.0 RC 0)
  • Mandrake 10.0 - tested on 2.6.3 and X?
  • Mandrake 9.1
  • Mandrake 9.0 - tested on ???
  • Mandrake 8.2 - tested on kernel 2.4.18-6mdk
  • Gentoo
  • Gentoo 2005.0, Xorg-X11 6.8.2-r4 & 6.8.2-r1, linux-2.6.13-gentoo-r3 & linux-2.6.11-gentoo-r6
  • Gentoo 2004.2, Xorg-X11 6.7.0, linux-2.6.8-rc3-mm2
  • Gentoo 2004.1, Xorg-X11 6.7.0, kernel 2.4.25 & 2.6.5
  • Gentoo 1.4rc, XFree86 4.2.0, kernel 2.4.19
  • Gentoo 1.4, XFree86 4.3.0-r5, kernel 2.6.3 (can not run wacomcpl and xsetwacom)
  • Debian
  • Debian (sid) - XFree86 4.3 on 2.6.6 (see [[UbuntuHelp:[debwcmdrv|Installing wacom driver On Debian]]])
  • Debian (sid) - XFree86 4.3(?) on 2.6.0 (can not run wacomcpl and xsetwacom)
  • Mepis 200310 (Debian unstable) - XFree86 4.3 on 2.4.22
  • Debian Woody - XFree86 4.2 on 2.4.20
  • Debian Stable 3.0 - XFree86 4.3 on 2.4.18 (can not run wacomcpl and xsetwacom)
  • Debian Stable - XFree86 4.1
  • Slackware
  • Slackware 10.2, kernel 2.4.31
  • Slackware 10.1, kernel 2.6.11-rc4 & 2.4.29, X.org 6.8.2
  • Slackware 10.0, kernel 2.4.26, X.org 6.7.0
  • Slackware 9.1, with 2.4.22
  • Slackware 9.0
  • Slackware 8.1, (standard release)
  • SuSE
  • Suse Linux 9.3, kernel 2.6.11.4-21.8
  • Suse Linux 9.2 Pro, kernel 2.6.8, X.org 6.8.1 (see [[UbuntuHelp:[susewacom|Building wacom driver On Suse 9.2]]])
  • Suse Linux 9.1, kernel 2.6.4 & 2.6.5, XFree 4.3.99 (4.4.0 RC 2)
  • Suse Linux 8.0, kernel 2.4.18, XFree 4.2
  • Ubuntu
  • Ubuntu 5.04 (Hoary), kernel 2.6.10-5, X.Org 6.8.2-10
  • Ubuntu Breezy, kernel 2.6.12, X.Org 6.8
  • FreeBSD
  • version 4.10, serial only
  • Source Mage
  • gcc 3.2.2, Linux 2.4.21-pre4-ac3, XFree86 4.2.1 and 4.3.0
  • PowerMac
  • Yellow Dog Linux 3.0.1 [Redhat variant for PPC] (see [[UbuntuHelp:[ppcwcmdrv|Building wacom driver On PowerMac]]])

How To Use This Document

Also, it bears mentioning since it's a detail often missed: there are two drivers in the Linux Wacom Project

  • wacom.o and
  • wacom_drv.o.

The first driver is the USB kernel driver. The second driver is the XFree86 Wacom driver. Serial users need only be concerned with the wacom_drv.o driver. USB users need both. If you try to use the wacom_drv.o driver in place of the wacom.o kernel driver or visa-versa, things generally won't work. Next, this document was written with the assumption that you are starting from scratch with a relatively recent distribution of the Linux kernel. Also, if you have already added lines to your XFree86/Xorg configuration file (XF86Config/XF86Config-4 or xorg.conf), you should comment them out and restart X. Since we'll be stepping through the entire process, we need X to ignore the tablet until we're ready. Otherwise, X will just get in the way. Finally, if you know what you're doing, you can leave your X settings intact, print this out, switch to runlevel 3, and follow along from the console. The linuxwacom package has an HTML version of this document in the docs directory. And of course, there's always lynx for the gurus out there, which is why this document is written out in plain vanilla HTML.

Resources and References

The Linux Wacom Project. This site hosts the current version of this document as well as drivers, development tools, and mailing lists. Stefan Runkel's Wacom Tablet HOWTO This page is a bit old, but it covers a lot of details that I mention only briefly. Good reading, even if it is possibly outdated. Wacom Webpage The Wacom web site contains little information about the Linux drivers, but you can look at their nifty new tablets. pxh: Graphire USB This page is devoted to a Graphire-specific XFree86 driver. Wacom Intuos USB Micro-HOWTO An older webpage which may not be relevant anymore, but was useful to me when I got started. Wacom Intuos USB on Linux Another page that was useful to me when I started. Wacom Software Developer Support This page contains some documentation for the older tablets.

Wacom Driver Theory of Operation

Wacom tablets are available in serial and USB configurations. They are also sold as embedded products in certain tablet PC's. I will cover all three types, but the serial case is the most straightforward, so we'll start there.<
><
> Serial Tablet Operation - The Short Story When a Wacom serial tablet is connected to a COM port, software can interact with it directly by opening the appropriate device, usually /dev/ttyS0. The XFree86 Wacom driver (wacom_drv.o) does precisely this, and all stylus movements are converted into XInput events for programs like the Gimp to turn into fluid brush strokes. Wacom tablets are capable of handling a number of different data protocols, and the Linux Wacom Project code currently utilitizes two, Wacom Protocol IV and Protocol V. Each operates with a fixed-sized packet, the length of which depends on the model and ROM version. When the serial tablet is reset, it defaults to a standard baud rate, often 9600 baud. From there, the device type can be queried, and if the tablet supports it, the baud rate increased to a higher value. Additionally, model parameters like tablet size can be queried directly to determine which features are available. Once configured, the tablet streams data back to the application as tools are brought into and out of proximity, are pressed against the tablet surface, or are tilted or inverted. <
><
> USB Tablet Operation - The Long Story Initially at least, the USB Wacom tablet is an HID compliant device, and when first connected to the computer, will identify itself as such. Unfortunately, this is not what you want because in this mode, you will not get any of the fancy features. The hid-core.c, mousedev.c, and usbmouse.c kernel drivers contain exceptions for the wacom; when the device is detected, they ignore the tablet. In this way, the more sophisticated wacom driver has the opportunity to assume control. The first thing that the driver does is register itself with the USB subsystem and wait for work to do. When the user plugs the device in, or the device is first detected, the USB subsystem shops the vendor and device identifier around, checking it against different drivers. The wacom driver takes responsibility for the tablet and then notifies the event system that it will be providing data. It then asks the tablet to switch from HID-compliant mode to "mode 2", a wacom-specific protocol which allows for values like pressure, Z rotation, and tilt. As information arrives, the wacom driver dutifully converts the data into real-world values and hands it on to the event system. From here, any usermode application can get access to the event data by opening /dev/input/event0. A stream of events including mouse movements, clicks, and proximity updates can be read from the device. Similar to the serial case, XFree86's Wacom driver (wacom_drv.o) has the ability to read this device, and performs filtering on the data before convert the Linux input events into XInput events. By breaking the responsibility for the data into three distinct levels, the kernel code remains simple and robust, the applications generalized, and the fancy features commonly accessible to all GUI applications in the X window system itself. This document walks down the entire data path from the USB kernel driver to the gimp application. <
><
> Embedded Device Operation - Tablet PC with Wacom Digitizer Refer to [[UbuntuHelp:[tabletpc|Tablet PC]]] page for detail.

Getting It Together

This section is devoted to preparing your system for the installation. Every distribution handles kernel modules and file locations a bit differently, so the goal here is to return everything to a known state. In some cases, your distribution may have automatically loaded certain modules which you will now need to unload. USB users will need to pay specific attention to discussions related to kernel drivers and modules. Serial tablet users have it much easier, and can bypass this. Both users will need to make changes to the XFree86 configuration file. Incidentally, some distributions detect new hardware on boot. If you allow Redhat's "anaconda" for instance to automatically configure (or remove) your USB tablet, it may undo some of the settings you will make here. Until Redhat's installation program recognizes Wacom tablets as non-HID devices by default, you are best off in my opinion to not allow it to configure the device. Just a warning.

Before We Start

From the beginning, let's make certain that we are on the same page. First, if you have Wacom related lines in your XF86Config/XF86Config-4 or xorg.conf files already, you should comment them out or remove them. In particular, this includes InputDevice sections with a driver set to "wacom" and their corresponding InputDevice lines in ServerLayout. When that's done, restart X.<
> It would be a wise idea at this time to check your XFree86 or Xorg log file for references to wacom, wcm, or tablet. If X persists in trying to interact with the tablet, things will only be problematic later. The log file is often found at /var/log/XFree86.0.log or /var/log/Xorg.0.log. If you have a USB tablet, you need to check Wacom kernel drvier first [[UbuntuHelp:[kernel|The USB Kernel Driver]]]. Serial tablet or Tablet PC users can go directly to the next section [[UbuntuHelp:[download|Downloading the Code]]] page.

Downloading the Code

The file linuxwacom-0.7.2.tar.bz2 is the stable package and contains files that you will need to get your serial or USB tablet working. The current beta package linuxwacom-0.7.3.tar.bz2 is also available and may be used by people who are willing to help test new features. I will never put a beta package on this site that I am not running myself on my primary development machine. So you can be certain that if there are any obvious show stoppers, they will be fixed before you get to see them. Unpacking the tarball is usually a one-step process, but I show both steps in case the typical -jxf option doesn't work with tar. [jej@ayukawa jej]$ bunzip2 linuxwacom-0.7.2.tar.bz2 [jej@ayukawa jej]$ tar -xf linuxwacom-0.7.2.tar [jej@ayukawa jej]$ cd linuxwacom-0.7.2 Once in the package directory, you need only to configure and build the code. This is described in more detail as you continue. The executables and wacom_drv.o are installed automatically; the kernel drivers have different installation procedures depend on the kernel source you use. If you are interested, the following tables contain the package contents and release dates. Otherwise, let's continue.

Stable files included for linuxwacom-0.7.8-3:

  • configure - configure script for distribution independent builds
  • prebuilt/install - installer for the executables and Wacom X driver to a system identical to the development system.
  • prebuilt/uninstall - unistaller for the executables
  • prebuilt/wacom.4x.gz - man page for Wacom driver
  • prebuilt/32 - Wacom X driver and its utility programs for XFree86 and X11R6/Xorg on x86 systems
  • prebuilt/64 - Wacom X driver and its utility programs for XFree86 and X11R6/Xorg on x86-64 systems
  • src/util/wacdump.c - a simple program for displaying tablet event data directly using ncurses
  • src/util/xidump.c - a diagnostic program for displaying XInput event data
  • src/util/wacscrn.c - curses library for wacdump
  • src/util/wactablet.c - wacom tablet library for wacdump
  • src/util/wacusb.c - wacom USB protocol library for wacdump
  • src/util/wacserial.c - wacom serial protocol library for wacdump
  • src/util/wactablet.h - wacom tablet library for wacdump
  • src/util/wacusb.h - wacom USB protocol library for wacdump
  • src/util/wacserial.h - wacom serial protocol library for wacdump
  • src/util/xsetwacom.c - a command line configuration tool for Wacom X driver
  • src/util/wacomcfg.c - configuration option library for xsetwacom
  • src/util/wcmAction.c - keystroke and modifier encoding/decoding
  • src/util/wcmAction.h - keystroke routine definitions
  • src/include/Xwacom.h - configuration options for xsetwacom
  • src/2.4/wacom.c - replacement kernel driver for kernel older than 2.4.22 (tested on 2.4.18/19/20)
  • src/2.4/usbmouse.c - replacement kernel driver for kernel older than 2.4.22 (tested on 2.4.18/19/20), use only if needed
  • src/2.4/hid-core.c - replacement kernel driver for kernel older than 2.4.22 (tested on 2.4.18/19/20), use only if needed
  • src/2.4/evdev.c - replacement kernel driver for kernel older than 2.4.22 (tested on 2.4.18/19/20), use only if needed
  • src/2.4/mousedev.c - replacement kernel driver for kernel older than 2.4.22 (tested on 2.4.18/19/20), use only if needed
  • src/2.4/input.c - replacement kernel driver for kernel older than 2.4.22 (tested on 2.4.18/19/20), use only if needed
  • src/2.4.22/wacom.c - replacement kernel driver for kernel 2.4.22 or newer (tested on 2.4.22/23/24)
  • src/2.4.22/usbmouse.c - replacement kernel driver for kernel 2.4.22 or newer (tested on 2.4.22/23/24), use only if needed
  • src/2.4.22/hid-core.c - replacement kernel driver for kernel 2.4.22 or newer (tested on 2.4.22/23/24), use only if needed
  • src/2.4.22/evdev.c - replacement kernel driver for kernel 2.4.22 or newer (tested on 2.4.22/23/24), use only if needed
  • src/2.4.22/mousedev.c - replacement kernel driver for kernel 2.4.22 or newer (tested on 2.4.22/23/24), use only if needed
  • src/2.4.22/input.c - replacement kernel driver for kernel 2.4.22 or newer (tested on 2.4.22/23/24), use only if needed
  • src/2.4.30x86-64/wacom.c - replacement kernel driver for kernel 2.4.30 or newer (tested on 2.4.30 AMD 64bit system)
  • src/2.4.30x86-64/usbmouse.c - replacement kernel driver for kernel 2.4.30 or newer (tested on 2.4.30 AMD 64bit system), use only if needed
  • src/2.4.30x86-6/hid-core.c - replacement kernel driver for kernel 2.4.30 or newer (tested on 2.4.30 AMD 64bit system), use only if needed
  • src/2.4.30x86-64/evdev.c - replacement kernel driver for kernel 2.4.30 or newer (tested on 2.4.30 AMD 64bit system), use only if needed
  • src/2.4.30x86-64/mousedev.c - replacement kernel driver for kernel 2.4.30 or newer (tested on 2.4.30 AMD 64bit system), use only if needed
  • src/2.6.x/wacom.c - replacement kernel driver for kernel 2.6.x where x can be 8 to 10
  • src/2.6.x/wacom_sys.c - wacom kernel driver specific to each major kernel release, where x can be 11 to 19
  • src/2.6.x/wacom_wac.c - wacom kernel driver processes tablet specific information, where x can be 16 or 19
  • src/2.6.x/wacom.h - wacom kernel driver header specific to each major kernel release, where x can be 11 to 19
  • src/2.6.16/wacom_wac.h - part of wacom kernel driver header for tablet specific declaration and definitions
  • src/2.6.x/hid-core.c - replacement kernel driver for kernel 2.6.x where x can be 8 to 16, use only if needed
  • src/xdrv/xf86Wacom.c - source for wacom_drv.o; requires XFree86/Xorg build environment to compile. Binary available in prebuilt directory.
  • src/xdrv/xf86Wacom.h - source for wacom_drv.o; requires XFree86/Xorg build environment to compile.
  • src/xdrv/wcmCommon.c - source for wacom_drv.o; requires XFree86/Xorg build environment to compile. Common to USB and serial tablets
  • src/xdrv/wcmXCommand.c - source for wacom_drv.o; requires XFree86/Xorg build environment to compile. APIs to xsetwacom.
  • src/xdrv/wcmCompat.c - source for wacom_drv.o; requires XFree86/Xorg build environment to compile. XFree86 4.x support
  • src/xdrv/wcmConfig.c - source for wacom_drv.o; requires XFree86/Xorg build environment to compile. Configuration setup
  • src/xdrv/wcmFilter.c - source for wacom_drv.o; requires XFree86/Xorg build environment to compile. Raw data filters
  • src/xdrv/wcmFilter.h - source for wacom_drv.o; requires XFree86/Xorg build environment to compile. Raw data filters
  • src/xdrv/wcmISDV4.c - source for wacom_drv.o; requires XFree86/Xorg build environment to compile. General Tablet PC
  • src/xdrv/wcmSerial.c - source for wacom_drv.o; requires XFree86/Xorg build environment to compile. Serial tablet support
  • src/xdrv/wcmSerial.h - source for wacom_drv.o; requires XFree86/Xorg build environment to compile. Serial tablet support
  • src/xdrv/wcmUSB.c - source for wacom_drv.o; requires XFree86/Xorg build environment to compile. USB tablet support
  • src/wacomxi/wacomcpl-exec - a graphic configuration tool for wacom XFree86 driver
  • src/wacomxi/wacomxi.c - calibration library for xsetwacom
  • src/wacomxi/wacomxi.h - calibration library for xsetwacom
  • GPL - the GNU General Public License, in case you did not already have one lying around

Stable Packages by Version and Date:

Beta Packages by Version and Date:

Configuring the Package

The Configure Script

This section describes how to configure the package. You can run the configure script now as the samples below demonstrate, or later when you reach the section of the document that explains what specifically needs to be configured and why. This page is provided largely as a reference. By default, xidump, wacdump, xsetwacom, wacom_drv.o, and wacomcpl are built. Additional options include replacement kernel drivers for hid, mousedev, evdev, and usbmouse as well as building the XFree86 driver from scratch. Lastly, remember that for every --enable option, there is also an equivalent --disable option. The configuration options are listed on this page. You can also see the online list by issuing ./configure -help under linuxwacom's base directory.

Building Kernel Modules - USB Only

In order to build kernel modules, you will need the kernel source installed on your system. If you are running on Redhat or Mandrake, you can get it by installing the kernel-source RPM. The kernel source directory is assumed to be in /usr/src/linux-2.4, /usr/src/linux, /usr/src/linux-2.6, /usr/src/linux-`uname -r`, or /lib/modules/`uname -r`/build. If your kernel sources are elsewhere, you will need to specify the directory with the --with-kernel option described below. For kernel 2.6, you need to configure the kernel modules (wacom and hid) under your kernel source directory before configuring linuxwacom.

Module Versioning - USB Only

The script attempts to discover if the kernel is using module versioning by detecting the presence of version numbers in the hid.o module of the currently active kernel. Recent package versions also check for hid.o.gz which exist on Mandrake systems. The configure script may not be able to d etermine if kernel module versioning should be enabled or not, in which case it will say "unknown, assuming no." If module versioning is disabled when it should be enabled, depmod will complain about missing symbols but otherwise, things will probably work fine. If it is enabled when it should be disabled, the code may not compile, and it almost certainly will not load properly. If the configure script fails to determine the correct value, the default action of disabling module versioning is the better choice, and you can allows enable it manually and rebuild if depmod complains.

The XFree86/Xorg XInput Driver - USB and Serial

Generally, you will not need to build wacom_drv.o since it ships in binary form in the prebuilt directory. There are prebuilt binaries for XFree86 and Xorg corresponding to x86 and x86-64 systems, respectively. If no one works for you, building from source may be your only option. See the [[UbuntuHelp:[builddrv|Building wacom_drv.o from Scratch]]] page for more information.

Library Dependencies - ncurses and XLib

Various utilities in the linuxwacom package require not only specific libraries, but their development header files as well. The ncurses package is one such example. Most distributions install the ncurses libraries by default, but the header files are often located in a separate package. You will need both. On Redhat 8.0, they can be found in the ncurses-devel RPM. Similarly, if you wish to test your tablet using xidump to view XFree86 input events, you will need the XFree86 development headers. On Redhat, they are contained in the XFree86-devel package. If any packages are missing, the configuration will warn you and disable building any programs that depend on them.

Processor Type

The processor type is determined by the script and used to build the kernel modules. If it guesses incorrectly, or you would prefer a different setting, use the --with-arch option described below.

Linux Specific Features

The Linux wacom driver uses the Linux input subsystem, as does the USB portions of the XFree86 driver. Consequently, if you are building on a non-Linux system, the USB code will not work for you. This is detected, and a comment to that effect is added to the configuration summary. I recognize that FreeBSD and similar systems have USB support; however, until someone can bridge the gap between the FreeBSD kernel and the XFree86 driver, the problem is largely unsolved. Contributions are of course welcome. The Linux-specific features can be enabled/disabled using the --with-linux argument.

Configuration Options

The following options are provided as reference. Normally, you will only need a few of these options, but more obscure systems may need all of them. Each section of the document identifies which options are necessary and when. Information listed as Option - Default - Build

  • enable-wacom - no - wacom.o kernel driver
  • enable-wacdump - yes - wacdump LinuxInput event monitor
  • enable-xidump - yes - xidump XInput event monitor
  • enable-libwacomcfg - yes - libwacomcfg Dynamic library for xsetwacom
  • enable-libwacomxi - yes - libwacomxi Dynamic library for wacomcpl
  • enable-xsetwacom - yes - xsetwacom XFree86 wacom driver configuration comannd
  • enable-hid - no - hid.o replacement kernel driver (not normally needed)
  • enable-usbmouse - no - usbmouse.o replacement kernel driver (not normally needed)
  • enable-evdev - no - evdev.o replacement kernel driver (not normally needed)
  • enable-mousedev - no - mousedev.o replacement kernel driver (not normally needed)
  • enable-wacomdrv - yes - wacom_drv.o XFree86 driver (binary is available in prebuilt directory)
  • enable-modver=yes|no - best guess - enables kernel module versioning; usually guesses correctly, but can be enabled or disabled if not
  • with-kernel=dir - best guess - Specifies the kernel source directory if configure cannot guess correctly.
  • with-x-src=dir - best guess - Specifies the X driver build source directory
  • with-xorg-sdk=dir - best guess - Specifies the Xorg SDK directory
  • with-tcl=dir - /usr - Specifies the tcl directory. The tcl's include and lib directories should be under this directory. If tcl.h is not in dir/include, it will be searched under dir directly
  • with-tk=dir - /usr - Specifies the tk directory. If tk is under the same directory as tcl, this option can be eliminated. Otherwise, the tk's include and lib directories should be under this directory. If tk.h is not in dir/include, it will be searched under dir directly
  • with-arch=arch - best guess - Specifies the architecture if configure guesses incorrectly
  • enable-xserver64=yes|no - best guess - enables 64-bit X server. You probably need to define xlib directory by adding option with-xlib=xlib-dir so compiler can link with the right Xlib.
  • with-linux=yes|no - best guess - Specifies if compiled on a Linux system; USB code is Linux specific
  • with-xlib=yes|no - best guess - Specifies if building xlib-based programs; xidump uses XInput headers
  • enable-dlloader=yes|no - best guess - Enable dlloader build option and built wacom_drv.so instead of wacom_drv.o

Configuration Samples

Here is a sample output of the script on a Redhat 8.0 system: [jej@ayukawa linuxwacom]$ ./configure checking for a BSD-compatible install... /usr/bin/install -c checking whether build environment is sane... yes ... checking for processor type... i686 checking for kernel module versioning... yes checking for kernel sources... /usr/src/linux checking for XLib include directory... found checking for XLib header files... found ... checking for ncurses.h... yes


BUILD ENVIRONMENT: architecture - i686 linux kernel - yes 2.4 module versioning - yes kernel source - yes /usr/src/linux XFree86 - no XLib - yes TCL - yes /usr TK - yes /usr ncurses - yes GTK - 2.0.6 BUILD OPTIONS: wacom.o - no wacdump - yes xidump - yes libwacomcfg - yes libwacomxi - yes xsetwacom - yes hid.o - no usbmouse.o - no evdev.o - no mousedev.o - no input.o - no tabletdev.o - no wacom_drv.o - no


If the configure script fails to find something that it is looking for, it may disable some options that you previously enabled on the command-line. If this happens, check the output for a warning like the following:

      • WARNING:
      • Unable to compile wacom_drv.o without XF86 build environment
      • wacom_drv.o will not be built

In this particular case, the XFree86 driver was enabled, but the --with-xf86 option was not specified. Without the build environment, the module cannot be compiled and was consequently disabled. The following sample command-line will build everything but wacdump while disabling module versioning. It also has a user-specified kernel source directory: [jej@ayukawa linuxwacom]$ ./configure --enable-hid --enable-usbmouse \ --enable-evdev --enable-moudedev --enable-input --enable-wacom \ --with-xf86=/usr/src/redhat/BUILD/XFree86-4.2.0 \ --with-kernel=/home/jej/src/linux --with-tcl=/usr/local/ActiveTcl \ --disable-modver --disable-wacdump checking for a BSD-compatible install... /usr/bin/install -c checking whether build environment is sane... yes ... checking for processor type... i686 checking for kernel module versioning... yes checking for kernel sources... /usr/src/linux-2.4 checking for valid XFree86 build environment... ok ...


BUILD ENVIRONMENT: architecture - i686 linux kernel - yes 2.4 module versioning - no kernel source - yes /home/jej/src/linux XFree86 - yes /usr/src/redhat/BUILD/XFree86-4.2.0 XLib - yes /usr/X11R6/lib TCL - yes /usr/local/ActiveTcl TK - yes /usr/local/ActiveTcl ncurses - yes GTK - 2.0.6 BUILD OPTIONS: wacom.o - yes wacdump - no xidump - yes libwacomcfg - yes libwacomxi - yes xsetwacom - yes hid.o - yes usbmouse.o - yes evdev.o - yes mousedev.o - yes input.o - yes tabletdev.o - no wacom_drv.o - yes Notice that the configure script guessed module versioning was enabled by default, but was disabled by the command-line option --disable-modver. Similarly, the wacdump program which is enabled by default was also disabled. All the kernel modules and the XFree86 wacom driver are enabled. Here is another sample from Red Hat Enterprise Linux ES v.4: [jej@ayukawa linuxwacom-x86-64]$ ./configure --enable-wacom --enable-hid \ --with-xf86=/home/jej/Desktop/X11R6.8 \ --with-tcl=/usr/local/ActiveTcl \ --enable-xserver64 --with-xlib=/usr/X11R6/lib64 checking for a BSD-compatible install... /usr/bin/install -c checking whether build environment is sane... yes ... checking build system type... x86_64-redhat-linux-gnu checking host system type... x86_64-redhat-linux-gnu checking for ld used by g++... /usr/bin/ld -m elf_x86_64 ...


BUILD ENVIRONMENT: architecture - x86-64 linux kernel - yes 2.6.9 module versioning - yes -DCONFIG_MODVERSIONS -DMODVERSIONS -include /usr/src/linux/include/linux/modversions.h kernel source - yes /usr/src/linux XFree86 - yes /home/jej/Desktop/X11R6.8 XSERVER64 - yes XLib - yes /usr/X11R6/lib64 TCL - yes /usr/local/ActiveTcl TK - yes /usr/local/ActiveTcl ncurses - yes BUILD OPTIONS: wacom.o - yes wacdump - yes xidump - yes libwacomcfg - yes libwacomxi - yes xsetwacom - yes hid.o - yes usbmouse.o - no evdev.o - no mousedev.o - no input.o - no tabletdev.o - no wacom_drv.o - yes

The Root Account

If you are comfortable with the root account, paths, the /sbin directory, and programs like modprobe, you can skip this section. This is largely to clarify some things for people who are new to Linux and get tripped up with the root account and paths. This is not meant to be a tutorial, so if this is over your head, I would recommend reading a book on Linux command line usage. All examples in this document assume the bash shell. Many of the procedures in this document need root access, and the commands that are executed are located in places on the system that are not normally accessed by typical users. In order to run the modprobe command, for instance, you must have root access. Additionally, if the /sbin directory which contains modprobe does not appear in your path, you must specify the full pathname, /sbin/modprobe, to run the command. Here is an example of the problem, followed by solutions. [jej@ayukawa jej]$ modprobe foo bash: modprobe: command not found [jej@ayukawa jej]$ locate modprobe /sbin/modprobe [jej@ayukawa jej]$ echo $PATH /bin:/usr/bin: ... :/home/jej/bin Normal users do not have /sbin in their path, so running modprobe directly fails. Running the program using the full pathname (/sbin/modprobe) will solve this, as will adding /sbin to the path. But there is another problem, as we will see: [jej@ayukawa jej]$ /sbin/modprobe foo foo.o: create_module: Operation not permitted Normal users are not allowed to run this command. For that, we need to be root. The su command stands for "substitute user" since it can be used to become any user on the system, but it is generally known by the incorrect but very memorable mnemonic "superuser." [jej@ayukawa jej]$ su Password: [root@ayukawa jej]# whoami root Note the change to the root account, and the additional change from $ to # on the prompt. I maintain this convention in all the examples in this document, so if you get an "access denied" error, check the prompt. You probably need to be root. Now that we have root access, is /sbin in our path? No. We have only been granted the privileges of root; we are not really in the root account's environment. Most notably, the home directory ($HOME) changes, but the path ($PATH) stays the same. Thus, becoming root is not sufficient to run modprobe without the full pathname, but does solve the access problem. [root@ayukawa jej]# modprobe foo bash: modprobe: command not found [root@ayukawa jej]# export PATH=$PATH:/sbin [root@ayukawa jej]# modprobe foo [root@ayukawa jej]# In this example, the user adds the /sbin directory to the path and can run modprobe normally. export is a bash shell command that changes aspects of your environment; in this case, /sbin is appended to the path. In the highly unlikely event that you are using a different shell, which for novice users seems unwise to me, you would need to use a different command. Redhat, Mandrake, and similar distributions all use bash by default, so it is unlikely that you would be using anything else. At any rate, changing the path is a reasonably good solution, if you can remember the syntax of the export command. Another approach to this problem is to do more than just "be root," but to run in the root account's environment. This is accomplished with the "su -" command and provides you with root's normal path, including the /sbin directory. The unfortunate side-effect is that you wind up in root's home directory, requiring you to cd back to the original directory in which you were working. [jej@ayukawa src]$ pwd /home/jej/src/linuxwacom/src [jej@ayukawa src]$ su - [root@ayukawa root]# cd /home/jej/src/linuxwacom/src [root@ayukawa src]# echo $PATH /bin:/sbin:/usr/bin: ... :/root/bin Here, the user starts in the package's src directory, but upon invoking "su -" is magically shuttled off to root's home directory. A quick cd back to the package directory and all is better. And, as demonstrated above, the path conveniently contains /sbin. So that leaves you with two immediate options, and one potential long-term option:

  1. Option One: Become root and add /sbin to the path.

[jej@ayukawa src]$ su [jej@ayukawa src]# export PATH=$PATH:/sbin

  1. Option Two: Become root using root's environment and cd back.

[jej@ayukawa src]$ su - [root@ayukawa root]# cd /home/jej/src/linuxwacom/src

  1. Option Three (recommended): Add /sbin to your personal account's path

[jej@ayukawa src]$ export PATH=$PATH:/sbin [jej@ayukawa src]$ su [root@ayukawa src]# echo $PATH /bin:/usr/bin: ... :/home/jej/bin:/sbin By adding the path early in the session, it becomes available every time you su to root later on. You could also add the export command to the .bash_profile file in your home directory and have the path set automatically when you log in. To exit from the root account and return to your normal account, you can use the exit command or type Ctrl-D on an empty line. [root@ayukawa src]# exit [jej@ayukawa src]$ If any of this is not explained clearly, drop me a line and let me know where you got stuck. I'd be happy to clarify directly and update this page for future readers.

The USB Kernel Driver

Serial tablet users rejoice: you can skip this entire section. Please go to the [[UbuntuHelp:[wacdump|Using wacdump]]] page for details on viewing the tablet output. USB users stay put; we need to tweak your kernel. Kernel modules must be recompiled for each new kernel so I can't just provide binaries. By the time you read this, my present kernel will be entirely out of date with yours. In any event, many new features are available in the latest drivers from the Linux Wacom Project, so I wholly recommend using them over the drivers provided by your standard distribution. Rest assured, efforts are being made to get these changes merged back into the Linux kernel. Note: If your system is running a 2.4 kernel and you don't have any application required to run on kernel 2.4, upgrading your kernel to version 2.6 (preferablely 2.6.8 or later) may save you the steps to update wacom kernel related modules.

Testing Tablet Detection

In this section we will determine which driver, if any, claims control over the tablet. There are at least three drivers that are interested: 1) (usb)hid.o which may think it is an HID device, <
> 2) usbmouse.o which may think it is an HID mouse (for kernel 2.4), and <
> 3) the wacom driver which should identify the tablet as its own. <
> To see which driver is driving the tablet, issuing more /proc/bus/usb/devices should list something similiar to the following: [jej@ayukawa wacom]$more /proc/bus/usb/devices T: Bus=01 Lev=01 Prnt=01 Port=01 Cnt=02 Dev#= 3 Spd=12 MxCh= 0 D: Ver= 1.10 Cls=00(>ifc ) Sub=00 Prot=00 MxPS= 8 #Cfgs= 1 P: Vendor=056a ProdID=0042 Rev= 1.15 S: Manufacturer=Tablet S: Product=XD-0608-U C:* #Ifs= 1 Cfg#= 1 Atr=80 MxPwr=140mA I: If#= 0 Alt= 0 #EPs= 1 Cls=03(HID ) Sub=01 Prot=02 Driver=wacom E: Ad=81(I) Atr=03(Int.) MxPS= 10 Ivl=5ms where Vendor=056a indicates a Wacom device. Driver=wacom means Wacom driver is in control of the tablet. If you see anything other than wacom after Driver=, at least hid-core.c needs to be updated. On newer 2.6 systems, more /proc/bus/input/devices gives you [jej@ayukawa wacom]$more /proc/bus/input/devices I: Bus=0003 Vendor=056a Product=0042 Version=1.15 N: Name="Wacom Intuos2 6x8" P: Phys=usb-0000:00:1d.1-2/input0 H: Handlers=event0 B: EV=1f B: KEY=1cff 0 1f00ff 0 0 0 0 0 0 0 0 B: REL=100 B: ABS=f00017b B: MSC=1 where, again, Vendor=056a indicates a Wacom device. Name="Wacom Intuos2 6x8" means an Intuos2 6x8 tablet reported to /dev/input/event3. If there is no Wacom after Name=, you need to update wacom.c. On kernel 2.4 or older 2.6 systems, unplug then replug your tablet after issuing tail -f /var/log/messages, you should see a flurry of activity. The exact output depends a lot on your particular kernel and distribution. BLOCKQUOTE> This is Redhat 8.0 (2.4.18-17.8.0):<
> [jej@ayukawa usb]# tail /var/log/messages Apr 03 21:26:11 ayukawa kernel: hub.c: USB new device connect on bus2/2, assigned device number 2 Apr 03 21:26:11 ayukawa kernel: input0: Wacom Intuos2 12x12 on usb2:2.0 Apr 03 21:26:11 ayukawakernel: wacom.c: Setting tablet report for tablet data Apr 03 21:26:11 ayukawa kernel: wacom.c: input1: Wacom Intuos3 6x11 on usb1:6.0 Apr 03 21:26:14 ayukawa /etc/hotplug/usb.agent: Setup wacom hid for USB product 56a/44/115 Apr 03 21:26:14 ayukawa /etc/hotplug/usb.agent: Setup mousedev for USB product 56a/44/115 And here it is again on Redhat 7.2 (2.4.18-17.7.x):<
> [jej@sasami root]# tail /var/log/messages Apr 03 21:28:38 sasami kernel: hub.c: USB new device connect on bus1/1, assigned device number 2 Apr 03 21:28:38 sasami kernel: input0: Wacom Intuos2 12x12 on usb1:2.0 Apr 03 21:28:39 sasami kernel: usb.c: registered new driver hiddev Apr 03 21:28:39 sasami kernel: usb.c: registered new driver hid Apr 03 21:28:39 sasami kernel: hid-core.c: v1.8.1 Andreas Gal, Vojtech Pavlik <vojtech@suse.cz> Apr 03 21:28:39 sasami kernel: hid-core.c: USB HID support drivers Apr 03 21:28:39 sasami kernel: mice: PS/2 mouse device common for all mice If all went well like above, the USB device was successfully detected and handled by the wacom driver. This presumably means that information like pressure and tilt will be received on /dev/input/event0. You are ready to configure the X driver [[UbuntuHelp:[download|Downloading the Code]]]. If instead you got any of the following lines in your log, the wacom driver did not get control. Either hid or usbmouse did. input0,hiddev0: USB HID v1.00 Mouse [Tablet XD-0608-U] on usb1:5.0 input0: Tablet XD-1212-U on usb2:2.0

Updated wacom.c

The wacom.c driver that is available in linuxwacom-0.7.2.tar.bz2 has a number of updates which cannot be found in many distributions yet. This driver supports the new tablets: Intuos3 6x11, Graphire4, PL710, DTF720, and Volito2. It also reports tool ID and serial number. The driver contains additional debugging code which may be useful in diagnosing data flow problems.

On newer kernel versions, 2.6.8 or later, you can link Wacom USB tablet to "/dev/input/wacom#", where # is a number when you have more than one Wacom tablet on the system. It can be done by adding the following rules in /etc/udev/rules.d/10-wacom.rules:

KERNEL="event*", SYSFS{idVendor}="056a", NAME="input/%k", SYMLINK="input/wacom%e" Fedore Core and RHEL use SYSFS{manufacturer}="WACOM" instead of SYSFS{idVendor}="056a" in the file, which is wrong. You need to modify it. If you only have one Wacom tablet, SYMLINK="input/wacom" instead of SYMLINK="input/wacom%e" to avoid port changes after hot-plugging the device. If you have more than one Wacom tablets plugged on the system, specify the link with product id is recommanded: KERNEL="event*", SYSFS{idVendor}="056a", SYSFS{idProduct}="00B5", NAME="input/%k", SYMLINK="input/intuos3" KERNEL="event*", SYSFS{idVendor}="056a", SYSFS{idProduct}="0015", NAME="input/%k", SYMLINK="input/graphire4"

Building wacom.c (for kernel 2.4)

To build the wacom.o kernel module, you need configure the package with --enable-wacom option. The kernel sources are required as described on the [[UbuntuHelp:[config|configuration]]] page. Here's how the configuration should generally look: [jej@ayukawa linuxwacom]$ ./configure --enable-wacom ... checking for valid kernel source tree... ok ...


BUILD ENVIRONMENT: architecture - i686 linux kernel - yes 2.4 module versioning - yes kernel - yes /usr/src/linux XFree86 - no XLib - yes /usr/X11R6 TCL - yes /usr TK - yes /usr ncurses - yes GTK - 2.0.6 BUILD OPTIONS: wacom.o - yes wacdump - yes xidump - yes libwacomcfg - yes libwacomxi - yes xsetwacom - yes hid.o - no usbmouse.o - no evdev.o - no mousedev.o - no input.o - no tabletdev.o - no wacom_drv.o - no


As shown above, the kernel directory was detected and the wacom.o module will be built. If the kernel option shows "no", you will need to specify the --with-kernel option and the correct directory. To build the driver, just run make. The output will be a file called wacom.o. It is located in the linuxwacom package's src/2.4 directory for versions older than 2.4.22. For versions 2.4.22 or newer, it is in src/2.4.22 directory. This is your replacement driver.

Building wacom.c (for kernel 2.6)

To build the wacom.ko kernel module, you need to configure wacom as a kernel module under your kernel source tree first. The kernel sources are required as described on the [[UbuntuHelp:[config|configuration]]] page. Then, you need to configure the package with --enable-wacom option. Here's how the configuration should generally look: [jej@ayukawa linuxwacom]$ ./configure --enable-wacom ... checking for valid kernel source tree... ok ...


BUILD ENVIRONMENT: architecture - i686 linux kernel - yes 2.6.9 module versioning - yes kernel - yes /usr/src/linux XFree86 - no XLib - yes /usr/X11R6 TCL - yes /usr TK - yes /usr ncurses - yes GTK - 2.0.6 BUILD OPTIONS: wacom.o - yes wacdump - yes xidump - yes libwacomcfg - yes libwacomxi - yes xsetwacom - yes hid.o - no usbmouse.o - no evdev.o - no mousedev.o - no input.o - no tabletdev.o - no wacom_drv.o - no


As shown above, the kernel directory was detected and the wacom.o module will be built. If the kernel option shows "no", you will need to specify the --with-kernel option and the correct directory. To build the driver, just run make. If everything works properly, you'll see the following from the make: [jej@ayukawa linuxwacom]$ make ... Making all in 2.6.9 make[3]: Entering directory `/home/jej/linuxwacom/src/2.6.9' Building linuxwacom drivers for 2.6 kernel. make -C /usr/src/linux M=/home/jej/linuxwacom/src/2.6.9 make[4]: Entering directory `/home/jej/linux-2.6.9' LD /home/jej/linuxwacom/src/2.6.9/built-in.o CC [M] /home/jej/linuxwacom/src/2.6.9/wacom.o Building modules, stage 2. MODPOST CC /home/jej/linuxwacom/src/2.6.9/wacom.mod.o LD [M] /home/jej/linuxwacom/src/2.6.9/wacom.ko make[4]: Leaving directory `/usr/src/linux' make[3]: Leaving directory `/home/jej/linuxwacom/src/2.6.9' ...

Testing If wacom.o Will Load

Before we install the wacom driver, we need to test that it will load properly. We do this by loading the driver manually. We will also [[UbuntuHelp:[root|need to be root]]] to do this. WARNING: there is a small chance that this will bomb your kernel, so we run sync to write all the stale buffers to the disk. People using ext3 have little to worry about, but it's always good to be prepared for the worst. At the very least, save your work. [root@ayukawa linuxwacom]# sync From the package's associated kernel directory, we unload any previous modules and load the new one. The following example is from a kernel 2.4.22 system. For Kernel 2.6.x, replace wacom.o with wacom.ko where it is used. Kernels 2.6.0 and 2.6.1 are handled in src/2.6. Kernel 2.6.11 and 2.6.12 are in src/2.6.11." [root@ayukawa linuxwacom]# cd src/2.4.22 [root@ayukawa 2.4.22]# rmmod wacom [root@ayukawa 2.4.22]# insmod ./wacom.o # for those about to rock, we salute you. Well, if you did not bomb, then good. And if you did, well, sorry. So far, we have not had any reports of this happening, so please send in yours. Incidentally, if you run "insmod wacom.o" and happen to be in the wrong directory, the old driver reloads, sometimes without warning. I therefore changed this to read "insmod ./wacom.o" which seems to prevent this from happening. To be certain, you can check the log file for the correct version number. [root@ayukawa src]# tail /var/log/messages Apr 03 20:34:41 ayukawa kernel: usb.c: registered new driver wacom Apr 03 20:34:41 ayukawa kernel: Reporting max 30480, 31680 Apr 03 20:34:41 ayukawa kernel: wacom.c: Setting tablet report for tablet data Apr 03 20:34:41 ayukawa kernel: input0: Wacom Intuos2 12x12 on usb2:3.0 Apr 03 20:34:41 ayukawa kernel: wacom.c: $1.43-0.7.2 Vojtech Pavlik <vojtech@suse.cz> Apr 03 20:34:41 ayukawa kernel: wacom.c: USB Wacom Graphire and Wacom Intuos tablet driver (MODIFIED-DEBUG) The important detail is the version number. A version number like "1.30" is an original kernel version and not from the linuxwacom package. The correct version should also have the -0.7.2 portion as well. Also, future versions of the driver will say "LINUXWACOM-DEBUG" or similar rather than "MODIFIED-DEBUG" as shown above. This is to help differentiate between the stock kernel driver and those available from the Linux Wacom Project. If you get errors inserting the module, then you may need to reconfigure and build with module versioning disabled. If it loads without a hitch, move on to the next part.

Installing wacom.o

For Kernel 2.6.x, replace wacom.o with wacom.ko where it is used. To install or not to install, that is the question. Since the driver is in memory, you can pretty much use it this way throughout the rest of this document. Anywhere you see "modprobe wacom", you'll instead need to "insmod ./wacom.o". You'll also need to be careful that you are in the package's src directory. If you instead use the less-specific command "insmod wacom.o" from a directory other than the package's src directory, insmod will load the driver from the kernel modules directory instead. The result is that you'll be using the wrong driver. Why would you not install the driver? Well, for one, you may be using a beta driver, and if the system crashes (you get an Oops or things come unglued in other ways), it would be nice to reboot and have the original drivers load instead. When should I install the driver? When you're comfortable that the driver will not crash your system. The linuxwacom tarballs will be marked as beta if I am not absolutely convinced that they are stable. On the other hand, the new features will be in beta tarballs before they are marked stable, so there you have it. For the first time through this document, I would recommend installing the files found in the stable tarball. If you really know what you're doing, just load the drivers manually like in the previous section [[UbuntuHelp:Testing If wacom.o Will Load|testwacom|Testing If wacom.o Will Load]]. On some distributions, Mandrake or Mandriva included, the wacom.o (or wacom.ko) driver that appears in the kernel modules directory appears to be compressed. If you cannot find wacom.o (or wacom.ko) using the method below, try locating wacom.o.gz (or wacom.ko.gz) instead. People who encountered this problem were able to run gzip on the module and copy that instead. Installing the driver requires knowing where it belongs. A little research will help here. By using the locate command, you can find all copies of the original driver on the computer. jej@ayukawa wacom]$ locate wacom.o /lib/modules/2.4.18-14/kernel/drivers/usb/wacom.o /lib/modules/2.4.18-18.8.0/kernel/drivers/usb/wacom.o [jej@ayukawa wacom]$ uname -r 2.4.18-18.8.0 On this computer, there are two kernels installed. uname identifies the currently active kernel as 2.4.18-18.8.0. The correct driver to replace is therefore at /lib/modules/2.4.18-18.8.0/kernel/drivers/usb/wacom.o. You will need to be root to replace this file, and it is a very good idea to make a backup copy. [jej@ayukawa wacom]$ su - [jej@ayukawa root]# cd /lib/modules/2.4.18-18.8.0/kernel/drivers/usb [jej@ayukawa usb]# cp wacom.o /home/jej/src/wacom/wacom_old.o [jej@ayukawa usb]# cp /home/jej/src/wacom/wacom.o wacom.o Here, I've saved the original to wacom_old.o and copied my new driver over it. You should substitute directory names as appropriate. NOTE: Don't leave the backup copy in the same directory as the original. depmod will treat both as valid drivers, regardless of their names. Copy the original somewhere outside of the kernel module directory to ensure that this does not happen. In at least one case, the backup driver was loaded instead of the new one due to a curious dependency issue. Finally, it is always a good thing to update the module dependencies. This is where you find out if the module was compiled without kernel module versioning. The following command, even if it generates errors is relatively benign. If it fails, then there is no harm done. It just means that you will have to load modules in the correct order since the system will not be able to guess for you. [jej@ayukawa usb]# depmod -e If you get no errors and no output, everything is fine, and the module was compiled, linked, and installed properly. If you received unresolved symbols like usb_set_idle or printk, then you need to reconfigure with module versioning enabled and recompile. Here is an example from a 2.6.12 system on Mandriva. jej@ayukawa wacom]$ locate wacom.ko.gz /lib/modules/2.6.12-12mdksmp/kernel/drivers/usb/input/wacom.o /lib/modules/2.6.12-12mdksmp/kernel/drivers/usb/input/wacom.o [je