Saturday, September 10, 2011

Configuring Wacom Bamboo Pen and Touch(CTH-460) in Debian squeeze

Recently bought a Wacom bamboo pen and touch after searching many places. Here in Kolkata It was not available in the shop of Ganesh Avenue and Chandni Chowk. Most of them have never heard the name Wacom. In Supreme Computers only bamboo pen model was available. I was searching for pen and touch model because this 1024 levels of pressure sensitivity while the pen model has only half of it. Finally I got it in imagine store at salt lake city center.

I after i bought it I thought of giving it a try in my Debian squeeze. I searched for guides in the net but none of them was sufficient for squeeze. After trying for 2 days I got it working.

First of all the current kernel of squeeze (2.6.32-5) does not have driver of this model. So the kernel module need to compiled and xserver-xorg-input-wacom (0.10.5) does not support this as said here . So that is also need to be compiled.

As said in linuxwacom wiki for kernels between 2.6.26 - 2.6.36 you need to download the input-wacom driver. I downloaded input-wacom-0.11.1.tar.bz2 which is the latest one as of now.

Before compiling we need to install the build tools. So, do

$sudo aptitude install build-essential xorg-dev autoconf libtool
Get kernel version using
$uname -a
Then install,
$sudo aptitude install linux-headers-
Do,
$tar xjvf input-wacom-0.11.1.tar.bz2
$cd input-wacom-0.11.1
To compile
$./autogen.sh --prefix=/usr --libdir=/usr/lib  # for 32bit installations
or
$./autogen.sh --prefix=/usr --libdir=/usr/lib64  # for 64bit installations
This will generate wacom.ko. Now copy it to the default kernel modules location. Before that the previous wacom.ko at
/lib/modules/`uname -r`/kernel/drivers/input/tablet/wacom.ko can be backed-up.

$sudo cp ./2.6.30/wacom.ko /lib/modules/`uname -r`/kernel/drivers/input/tablet/wacom.ko
$sudo depmod -a
Now if the tablet is connected it gets attached to some /dev/input/eventX , one for pen and another one for touch. This can be seen using,
$dmesg|tail
But to use it in applications xorg driver also must be installed.
For this I downloaded xf86-input-wacom-0.11.1.tar.bz2. The latest one can be downloaded from here.
Before compiling this we need to install xutils-dev which provides xorg-macros.
$sudo aptitude install xutils-dev.
Now to compile the wacom input driver for X.
First,
$tar -xvf xf86-input-wacom-0.11.1.tar.bz2
$cd xf86-input-wacom-0.11.1
Then
$./configure --prefix=/usr --libdir=/usr/lib # for 32bit $installations
or
$./configure --prefix=/usr --libdir=/usr/lib64 # for 64bit installations
After that

$make
$make install
After installing the driver, restart X (by logging out and then logging in or by restarting the computer).

Now we need to configure X before we can actually use it.
First rename existing wacom configuration /usr/share/X11/xorg.conf.d/20-wacom.conf. The file 50-wacom.conf in xorg.conf.d is copied by xf86-input-wacom, that should be kept intact. If there are any files of wacom in /etc/udev/rules.d/ rename them.

Now create a new file 52-wacom-options.conf in /usr/share/X11/xorg.conf.d/
with the following content:
Section "InputClass"
 Identifier "Wacom Bamboo Presscurve and Area configurations"
 MatchProduct "Wacom BambooFun 2FG 4x5 Pen"
 MatchDevicePath "/dev/input/event*"

# Apply a custom configuration options. Any option will # also apply to all dependent devices, if applicable. So # e.g. the pressure curve
will be available on the      # stylus and the eraser (but not on the pad).
 Option "PressCurve" "0 10 90 100"
 Option "TopX" "0"
 Option "TopY" "0"
 Option "BottomX" "14720"
 Option "BottomY" "9200"
EndSection

Section "InputClass"
 Identifier "Wacom Bamboo Finger Area configuration"
 MatchProduct "Wacom BambooFun 2FG 4x5 Finger"
 MatchDevicePath "/dev/input/event*"

 # Apply custom Options to this device below.
 Option "TopX" "0"
 Option "TopY" "0"
 Option "BottomX" "480"
 Option "BottomY" "320"
EndSection

This is just copied form linuxwacom wiki custom options may be changed. See man wacom for details.
Now the bambooPT will work.
Here is picture drawn using it on GIMP by Gopal.

5 comments:

nrz said...

Nicely done mate!
I tried several other manuals how to fire up bamboo cth-460 on Debian squeeze, but only yours worked for me as a charm.
Thanks a lot :)

nrz said...

Hi,
could you please check my config and explain, why my touch is still on, though I turned it off:
http://tinypaste.com/ce6f1aef
(in bold text)

Unknown said...

sorry mate, I don't have the wacom now. Can't test it.

Nabarun chatterjee said...

no wonder the name consists the word "bamboo"

Unknown said...

@naba This much thing is needed to be done only squeeze or on GNU/linux with old kernel and x11. This works out of the box in Ubuntu 11.04. I've tried it.