debian Lenny & wacom cintiq 12wx

522

I recently bought a wacom cintiq 12 wx, after hours of searching, here’s how I, eventually, make it work. Hope these clues will be useful to others.  My config :
a fresh Debian Lenny install on a nvidia card Geforce 6800 with 2 video outputs. After conecting the wacom cintiq on the DVI output and having my primary screen on the other VGA output,  my first step was to set  2 X seperated screens.

1. Install the Nvidia driver and setting seperated X screens

I started to install the nvidia driver from nvidia.com (yes, I did use the restricted driver in that case, avoiding much pain) :

http://us.download.nvidia.com/XFree86/Linux-x86/185.18.29/NVIDIA-Linux-x86-185.18.29-pkg1.run 

many pages and blogs explain how to install this on Debian, I will not get further through that point. The  thing is to have a starting xorg.conf working.   see this link :  http://blog.chewearn.com/2008/10/09/nvidia-separate-x-screen-in-intrepid-ibex-beta/

After installing the package from Nvidia… In gnome or whathever, run in terminal   (as normal user), the nvidia configuration tool:

$ nvidia-settings

click on  the “X Server Display Configuration” left pane, if the second screen is not detected,  click “detect displays”,  the second display should come up. Click on the “configure” button,  set “seperate X screen”. Set your main screen with the resolution of your choice, choose “absolute” option under Position. The NVidia tool detects and auto configures the display for the cintiq (max resolution at 1280 x800), select “RightOf” under Position.

save your X config in your home directory by clicking on “Save to x configuration page” in order to modify it. Backup your old xorg.conf! just in case ..

$sudo cp /etc/X1/xorg.conf xorg.conf.back
$sudo cp ~/xorg.conf /etc/X11/xorg.conf

See my xorg.conf in appendix 1. Note the ‘RightOf’ option in ServerLayout subsection … that can be changed to Leftof

 With this working xorg.conf, restart Xserver :

ctrl+backspace

If X restarts without error, you can breath again, otherwise, recover your xorg.conf backup. Now, after log into X, I had 2 seprate X screens, with 2 gnome desktops and only the mouse can cross.

2. Install the tablet

connect your usb wacom

After setting the dual screen, it’s time to connect your wacom cintiq through one USB output  of your CPU. Then open a terminal, let’s check if the wacom is recognised by using lsusb :

$ lsusb
Bus 001 Device 004: ID 056a:00c6 Wacom Co., Ltd  

the number 00c6  identify the wacom as a Cintiq 12wx

Download last wacom driver and apt-get before compile

first :

$sudo apt-get update

Install the current kernel headers

$sudo apt-get install linux-headers-$(uname -r)

Install  libraries :

$sudo apt-get install build-essential
x11proto-core-dev
libxau-dev libxdmcp-dev
x11proto-input-dev
x11proto-kb-dev xtrans-dev
libx11-dev x11proto-xext-dev
libxext-dev libxi-dev
linux-libc-dev libc6-dev
libncurses5-dev
xserver-xorg-dev tk-dev
tck-dev -y

Install the wacom tools :

$sudo apt-get install wacom-tools xserver-xorg-input-wacom

 From the linux wacom project, get the last driver source code:
http://linuxwacom.sourceforge.net/index.php/dl. When I got the source code, the last package was : linuxwacom-0.8.2-2.tar.bz2. Download and untar in your home directory.

$tar xvfj linuxwacom-0.8.2-2.tar.bz2
$cd linuxwacom-0.8.2-2

3. Now  compile and install the linuxwacom module

before the compilation, I had to (on my system) create or check those following links :

$ sudo ln -s /usr/include/pixman-l/pixman.h /usr/include/pixman.h
$ sudo ln -s /usr/include/pixman-l/pixman-version.h /usr/include/pixman-version.h

In the linuxwacom-0.8.2-2 directory :

$ ./configure -enable-wacom
$ make
and now  install the driver :
$sudo make install

4. xorg config

Backup again your xorg.conf

$ sudo cp xorg.conf xorg.conf.back

Edit xorg.conf in a text editor (gedit, vim, or whatever..) as root or sudo.
According to the xorg.conf, I posted below (see appendix 1), add these lines in “Sever Layout” section and after the lines concerning the keyboard and the mouse :

Section “ServerLayout”
……
    InputDevice    “stylus” “SendCoreEvents”
    InputDevice    “cursor” “SendCoreEvents”
    InputDevice    “eraser” “SendCoreEvents”
    InputDevice    “pad” “SendCoreEvents”

EndSection

For each input devices  given by the cintiq (stylus, eraser, cursor, pad), a section must be added

– the stylus :

Section “InputDevice”
Driver “wacom”
Identifier “stylus”
Option “Device” “/dev/input/wacom”
Option “Type” “stylus”
Option “USB” “on”
Option “Mode” “Absolute”
Option “TVResolution” “1600×1280,1280×800”
Option “ScreenNo” “1”
Option “Twinview” “horizontal”
Option “PressCurve” “0,15,85,100”
Option “Tilt” “on”
Option “KeepShape” “on”
Option “Speed” “0.5”
EndSection

Note the the option “ScreenNo” “1” limits the input device to the second screen, the cintiq 12wx screen.

– the eraser :

Section “InputDevice”
Driver “wacom”
Identifier “eraser”
Option “Device” “/dev/input/wacom”
Option “Type” “eraser”
Option “USB” “on”
Option “Mode” “Absolute”
Option “TVResolution” “1600×1280,1280×800”
Option “ScreenNo” “1”
Option “Twinview” “horizontal”
Option “Tilt” “on”
Option “Speed” “0.5”

EndSection

– the cursor:

Section “InputDevice”
    Driver “wacom”
    Identifier “cursor”
    Option “Device” “/dev/input/wacom”
    Option “Type” “cursor”
    Option “USB” “on”
Option “TVResolution” “1600×1280,1280×800”
Option “ScreenNo” “1”
Option “Twinview” “horizontal”
EndSection

– pad

Section “InputDevice”
    Driver “wacom”
    Identifier “pad”
    Option “Device” “/dev/input/wacom”
    Option “Type” “pad”
    Option “USB” “on”
EndSection  

5. Load the wacom module into the Kernel

 Back to the directory where you compiled the wacom driver (and to the corresponding sub directory of your kernel number), copy the file wacom.ko into the modules kernel directory:

$sudo cp linuxwacom-0.8.2-2/src/src/2.6.27/wacom.ko  /lib/modules/$(uname -r)/kernel/drivers/input/tablet/wacom.ko

Load the module :

$sudo depmod -e

then go back into  the source driver directory and uninstall the old driver :

$cd linuxwacom-0.8.2-2/prebuilt
$sudo ./uninstall
$sudo ./install

 Add Wacom Symlinks to “/etc/udev/rules.d”

first, go to the directory “/etc/udev/rules.d/” and check to see whether a file called “50-xserver-xorg-input-wacom.rules” is present. If not, download the most recent “50-xserver-xorg-input-wacom.rules” from Ron’s Debian repository in your home directory:

$wget -O 50-xserver-xorg-input-wacom.rules “http://git.debian.org/?p=users/ron/wacom-tools.git;a=blob_plain;f=debian/xserver-xorg-input-wacom.udev;hb=e110b046292d6aff63b489c9b1aecec25d470cdb”

then copy it to “/etc/udev/rules.d”

sudo cp 50-xserver-xorg-input-wacom.rules /etc/udev/rules.d/50-xserver-xorg-input-wacom.rules

It’s time to reboot, so everything will be in place … Now, your wacom tablet should work.  check if the stylus cover the  screen and if the pointer moves to the stylus. Of course, it’s not calibrated yet, the stylus is not exactly under the pointer. If no response, your tablet does not work.. and it was my case at this point … argh … so try this,  in a terminal, uninstall wacom-tools :

$sudo apt-get remove wacom-tools xserver-xorg-input-wacom -y

and install again

$sudo apt-get install wacom-tools xserver-xorg-input-wacom -y

then enter again in the wacom driver source directory :

$cd linuxwacom-0.8.2-2/prebuilt

$sudo ./uninstall
$cd ..
$make install

reboot again.

6. Calibrate the wacom : xsetwacom

Xsetwacom is a command line configuration interface, so you can control and change many options of your wacom.  You’ll find all the parameters here : http://linuxwacom.sourceforge.net/index.php/howto/xsetwacom

The main issue here is to get the cursor below the pen. I didn’t find any formula to translate the resolution of the 12wx screen in tablet unit. to figure this out, I used, by trial and error,  xsetwacom, to get the bottom x and y coordinates of the tablet. In a terminal :

$xsetwacom get stylus BottomX

gives you the button coordinate of the cursor on the X axis

$xsetwacom set stylus BottomX 26500

sets and corrects the X coordinate,  by moving those figures, I had, eventually, the cursor bellow the pen. Obviously, the Y axis must be set accordingly.

$xsetwacom set stylus BottomY 33440

Use the same settings for the eraser :

$xsetwacom set eraser BottomX 26500
$xsetwacom set eraser BottomY 33440

 In order to keep these settings at each reboot, make a simple “cintiq.sh” script. Make it executable, so Gnome (or other window manager, see Google for that) can launch in its startup program list. Personnally, I use fluxbox and added a line  to my “~/.fluxbox/startup” file : “cintiq.sh &” .

$touch cintiq.sh

edit the file (gedit, vim ..) and type your settings. Then, make it executable :

$chmod a+x cintiq.sh

With xsetwacom you can set all the extra keys that come with the wacom 12wx (the pad). Again, use xsetwacom and add your settings to the cintiq startup script. My settings, most of them are  set for Gimp: (see this link http://forum.ubuntu-fr.org/viewtopic.php?id=319659)

#!/bin/sh

# right buttons:

#10
——–
#5
#——7
#6
——–
#8

# left buttons:

#9
————
#       1
#3———
#        2
———–
#4

xsetwacom set stylus Suppress “20”
xsetwacom set stylus RawSample “4”
xsetwacom set stylus ClickForce “6”

xsetwacom set stylus PressCurve “0 25 75 100”
xsetwacom set stylus BottomX 26500
xsetwacom set stylus BottomY 33440
xsetwacom set eraser BottomX 26500
xsetwacom set eraser BottomY 33440
xsetwacom set pad StripRDn “CORE KEY -” #zoom out in Gimp
xsetwacom set pad StripRUp “CORE KEY +” #zoom in  in Gimp
xsetwacom set pad StripLDn “CORE KEY ;”
xsetwacom set pad StripLUp “CORE KEY :”
xsetwacom set pad Button10 “CORE KEY =”
xsetwacom set pad Button9 “CORE KEY p” # switch to pen tool
xsetwacom set pad Button8 “CORE KEY ,”
xsetwacom set pad Button7 “CORE KEY SHIFT”
xsetwacom set pad Button6 “CORE KEY CONTROL y” #redo
xsetwacom set pad Button5 “CORE KEY CONTROL z” #undo
xsetwacom set pad Button4 “CORE KEY k” # ink tool
xsetwacom set pad Button3 “CORE KEY SHIFT”
xsetwacom set pad Button2 “CORE KEY CONTROL z” #undo
xsetwacom set pad Button1 “CORE KEY CONTROL y” #redo
xsetwacom set stylus TPCButton “off”
xsetwacom set stylus Button3 “Button 3”
xsetwacom set stylus Button2 “Button 2”
xsetwacom set stylus Button1 “Button 1”

Search Google about using Gimp with Wacom.

Appendix 1: xorg.conf

Section “ServerLayout”
    Identifier     “Layout0”
    Screen      0  “Screen0” 0 0
    Screen      1  “Screen1” RightOf “Screen0”
    InputDevice    “Keyboard0” “CoreKeyboard”
    InputDevice    “Mouse0” “CorePointer”
    InputDevice    “stylus” “SendCoreEvents”
    InputDevice    “cursor” “SendCoreEvents”
    InputDevice    “eraser” “SendCoreEvents”
    InputDevice    “pad” “SendCoreEvents”
EndSection

Section “Files”
    RgbPath         “/etc/X11/rgb”
    ModulePath      “/usr/lib/xorg/modules”
    FontPath        “/usr/share/fonts/X11/misc”
    FontPath        “/usr/share/fonts/X11/cyrillic”
    FontPath        “/usr/share/fonts/X11/100dpi/:unscaled”
    FontPath        “/usr/share/fonts/X11/75dpi/:unscaled”
    FontPath        “/usr/share/fonts/X11/Type1”
    FontPath        “/usr/share/fonts/X11/100dpi”
    FontPath        “/usr/share/fonts/X11/75dpi”
    FontPath        “/var/lib/defoma/x-ttcidfont-conf.d/dirs/TrueType”
EndSection

Section “ServerFlags”
    Option         “Xinerama” “0”
EndSection

Section “InputDevice”
    # generated from default
    Identifier     “Mouse0”
    Driver         “mouse”
    Option         “Protocol” “auto”
    Option         “Device” “/dev/psaux”
    Option         “Emulate3Buttons” “no”
    Option         “ZAxisMapping” “4 5”
EndSection

Section “InputDevice”
    # generated from default
    Identifier     “Keyboard0”
    Driver         “kbd”
    Option        “XkbRules”    “xorg”
    Option        “XkbModel”    “pc105”
    Option        “XkbLayout”    “be”
EndSection

Section “InputDevice”
Driver “wacom”
Identifier “stylus”
Option “Device” “/dev/input/wacom”
Option “Type” “stylus”
Option “USB” “on”
Option “Mode” “Absolute”
Option “TVResolution” “1600×1280,1280×800”
Option “ScreenNo” “1”
Option “Twinview” “horizontal”
Option “PressCurve” “0,15,85,100”
Option “Tilt” “on”
Option “KeepShape” “on”
Option “Speed” “0.5”

EndSection

Section “InputDevice”
Driver “wacom”
Identifier “eraser”
Option “Device” “/dev/input/wacom”
Option “Type” “eraser”
Option “USB” “on”
Option “Mode” “Absolute”
Option “TVResolution” “1600×1280,1280×800”
Option “ScreenNo” “1”
Option “Twinview” “horizontal”
Option “Tilt” “on”
EndSection

Section “InputDevice”
    Driver “wacom”
    Identifier “cursor”
    Option “Device” “/dev/input/wacom”
    Option “Type” “cursor”
    Option “USB” “on”
Option “TVResolution” “1600×1280,1280×800”
Option “ScreenNo” “1”
Option “Twinview” “horizontal”
EndSection Section “InputDevice”
    Driver “wacom”
    Identifier “pad”
    Option “Device” “/dev/input/wacom”
    Option “Type” “pad”
    Option “USB” “on”
Option “TVResolution” “1600×1280,1280×800”
Option “ScreenNo” “1”
Option “Twinview” “horizontal”
EndSection Section “Monitor”
    Identifier     “Monitor1”
    VendorName     “Unknown”
    ModelName      “WAC Cintiq 12WX”
    HorizSync       31.0 – 82.0
    VertRefresh     56.0 – 75.0
    Option         “DPMS”
EndSection

Section “Monitor”
    Identifier     “Monitor0”
    VendorName     “Unknown”
    ModelName      “Hitachi CM766”
    HorizSync       31.0 – 96.0
    VertRefresh     50.0 – 180.0
    Option         “DPMS”
EndSection

Section “Device”
    Identifier     “Device1”
    Driver         “nvidia”
    VendorName     “NVIDIA Corporation”
    BoardName      “GeForce 6800”
    BusID          “PCI:1:0:0”
    Screen          1
    Option      “AddARGBGLXVisuals”    “true”
EndSection

Section “Device”
    Identifier     “Device0”
    Driver         “nvidia”
    VendorName     “NVIDIA Corporation”
    BoardName      “GeForce 6800”
    BusID          “PCI:1:0:0”
    Screen          0
    Option      “AddARGBGLXVisuals”    “true”
EndSection

Section “Screen”
    Identifier     “Screen1”
    Device         “Device1”
    Monitor        “Monitor1”
    DefaultDepth    24
    Option         “TwinView” “1”
    Option         “metamodes” “DFP: nvidia-auto-select +0+0”
    SubSection     “Display”
        Depth       24
    EndSubSection
EndSection

Section “Screen”
    Identifier     “Screen0”
    Device         “Device0”
    Monitor        “Monitor0”
    DefaultDepth    24
    Option         “TwinView” “1”
    Option         “metamodes” “CRT: 1600x1280_70 +0+0; CRT: 1152×864 +0+0”
    SubSection     “Display”
        Depth       24
    EndSubSection
EndSection

Section “Extensions”
    Option “Composite” “Enable”
EndSection