*****Tutorial For USB Tablet PC*****
This is NOT for Serial Tablet PCs. The default configuration on Jaunty should work just fine for serial tablets. This tutorial may mess up your machine.
*****************************************
IS THIS FOR ME?
*****************************************
If you:
1. Have to plug your Tablet into your computer,
2. Have the Bamboo, Graphire(any number), Intuos(any number EXCEPT 4), or Cintiq(any version)
3. Have a serial tablet, then
THIS TUTORIAL IS NOT FOR YOU! It will not work, and will only mess things up for you. You have been warned!
Intuos4 people, please use only the part about compiling the kernel module. ONLY do part 1.
(Thanks Favux)
This tutorial borrows Favux's tutorial on the first page - which borrows from several others. Look at the bottom of this post to see more contributions.
Note: Rec's Script is no longer necessary. I'm not sure whether an xserver update fixed this, or the new fdi file. (I think it was the fdi file.)
Also, devices work after suspend and hibernate consistently (and xsetwacom and wacomcpl work as well.)
If you are seeing this tutorial again, replace your current fdi file with the new one below.
IF YOU ARE ON KARMIC, READ THIS SECTION!
Due to Karmic not containing a certain file, you need to run this command:
Code:
sudo wget -O /lib/modules/`uname -r`/build/drivers/hid/hid-ids.h http://kernel.ubuntu.com/git-repos/ubuntu/linux-2.6/drivers/hid/hid-ids.h
This downloads the file we need from ubuntu's servers and puts it in the correct place. You should only need to run this once after every Kernel update. However, running it more than that will not hurt anything. If you receive compile errors on Karmic, run the command again before posting for help.
Now with this done,
SKIP TO SECTION 2 - ONLY IF YOU ARE ON KARMIC
Unless of course you want to compile the newest release. This is no longer necessary with Karmic.
Section 1: Download source code, compile, and install linuxwacom kernel driver/module.
Okay so the first step is to install the packages:
Code:
sudo apt-get install wacom-tools xserver-xorg-input-wacom
Now we need to compile the kernel module from the newest linux wacom release (0.8.4-3)
First we have to get all the tools we need:
1) First download the source code tar onto the desktop. In a terminal type:
Code:
cd ./Desktop
wget http://prdownloads.sourceforge.net/linuxwacom/linuxwacom-0.8.4-3.tar.bz2
2) Next install the needed libraries, packages and updates using the following apt-get commands.
Code:
sudo apt-get update
sudo apt-get install build-essential libx11-dev libxi-dev x11proto-input-dev xserver-xorg-dev tk8.4-dev tcl8.4-dev libncurses5-dev
sudo apt-get upgrade
3) Now the kernel headers for your kernel are needed. To determine your kernel version:
If you have the generic kernel:
Code:
sudo apt-get install linux-headers-generic
If you have the rt kernel:
Code:
sudo apt-get install linux-headers-rt
(Remember if you update to a newer kernel, then the module won't work on restart because the module is compiled for a specific kernel. You will have to recompile the module for the newer kernel.)
4) Okay now unpack the source code tar and go into the unpacked source code directory.
Code:
tar xjvf linuxwacom-0.8.4-3.tar.bz2
cd linuxwacom-0.8.4-3
5) Then we compile the module.
Code:
./configure --enable-wacom
make
*****We DO NOT run "sudo make install" since we only want the module.*****
6) Next we copy the module to the appropriate directory:
Code:
sudo cp ./src/2.6.28/wacom.ko /lib/modules/`uname -r`/kernel/drivers/input/tablet/wacom.ko
Section 2: Creating the Fdi File
First as a reference I will include a default fdi File:
Code:
<?xml version="1.0" encoding="UTF-8"?> <!-- -*- SGML -*- -->
<deviceinfo version="0.2">
<device>
<match key="input.originating_device" contains="if0">
<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>
<merge key="info.product" type="string">stylus</merge>
<append key="info.callouts.add" type="strlist">hal-setup-wacom</append>
<append key="wacom.types" type="strlist">eraser</append>
</match>
</match>
</device>
<device>
<match key="input.originating_device" contains="if1">
<match key="info.product" contains="Wacom">
<merge key="input.x11_driver" type="string">wacom</merge>
<merge key="input.x11_options.Type" type="string">touch</merge>
<merge key="info.product" type="string">touch</merge>
</match>
</match>
</device>
<device>
<match key="input.x11_options.Type" contains="eraser">
<merge key="info.product" type="string">eraser</merge>
</match>
</device>
</deviceinfo>
Start with this as a reference.
Code:
sudo gedit /usr/share/hal/fdi/policy/20thirdparty/10-wacom.fdi
If you are on Karmic, use: (delete the contents)
Code:
sudo gedit /usr/share/hal/fdi/policy/20thirdparty/10-linuxwacom.fdi
Copy and paste the above contents then save.
This fdi file should work for any usb tablet pc. If you find that it does not work for you, please post the output of lshal and the model of your laptop.
Section 3: Configuring the Fdi File
At this point You should be able to reboot and everything should work.
With the current fdi file you will be able to calibrate both touch and the stylus. It is almost exactly the same as editing the xorg.conf, but has a bit of a different format.
Where an xorg.conf option would look like:
Code:
Option "OptionName" "OptionValue"
such as:
Code:
Option "BottomY" "3951"
Now we add the line to the fdi file such as:
Code:
<merge key="input.x11_options.OptionName" type="string">OptionValue</merge>
such as:
Code:
<merge key="input.x11_options.BottomY" type="string">16466</merge>
You can view my fdi file below as an example. All options in the xorg.conf should work in the fdi file using this method.
Code:
<?xml version="1.0" encoding="UTF-8"?> <!-- -*- SGML -*- -->
<deviceinfo version="0.2">
<device>
<match key="input.originating_device" contains="if0">
<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>
<merge key="info.product" type="string">stylus</merge>
<append key="info.callouts.add" type="strlist">hal-setup-wacom</append>
<append key="wacom.types" type="strlist">eraser</append>
<merge key="input.x11_options.BottomY" type="string">16466</merge>
<merge key="input.x11_options.BottomX" type="string">26271</merge>
<merge key="input.x11_options.TopY" type="string">183</merge>
<merge key="input.x11_options.TopX" type="string">397</merge>
</match>
</match>
</device>
<device>
<match key="input.originating_device" contains="if1">
<match key="info.product" contains="Wacom">
<merge key="input.x11_driver" type="string">wacom</merge>
<merge key="input.x11_options.Type" type="string">touch</merge>
<merge key="info.product" type="string">touch</merge>
<merge key="input.x11_options.BottomY" type="string">3909</merge>
<merge key="input.x11_options.BottomX" type="string">3947</merge>
<merge key="input.x11_options.TopY" type="string">185</merge>
<merge key="input.x11_options.TopX" type="string">186</merge>
</match>
</match>
</device>
<device>
<match key="input.x11_options.Type" contains="eraser">
<merge key="info.product" type="string">eraser</merge>
</match>
</device>
</deviceinfo>
Section 4: Wacomcpl and settings
After you have rebooted, you should be able to run the command wacomcpl. This will bring up a dialog that will allow you to configure your tablet, calibrate it and change which buttons do which. After you exit wacomcpl, your settings are saved to a file in your home folder named .xinitrc.
For your settings to stay the same everytime you login and suspend/hibernate, we will need to create a session for it.
This involves compiling a settings daemon. (From Cyberfish.)
Open up a fresh terminal and run the following commands:
Code:
gedit monitor_wacom.c
and copy and paste in the following code then save and exit.
Code:
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <time.h>
#include <assert.h>
void log_msg(const char *msg) {
FILE *log_file = fopen(".monitor_wacom.log", "a");
if (log_file) {
time_t time_g;
time(&time_g);
char date_str[100];
strcpy(date_str, asctime(localtime(&time_g)));
date_str[strlen(date_str) - 1] = '\0'; /* get rid of the \n */
fprintf(log_file, "%s : %s\n", date_str, msg);
}
fclose(log_file);
}
void run_script(const char *filename) { /* only run xsetwacom lines */
FILE *script_file = fopen(filename, "r");
if (!script_file) {
log_msg("Failed to open script (double check your entry in Startup Applications). Terminating.");
exit(1);
}
char buf[1024];
char l_buf[1024];
int count = 0;
while ((fgets(buf, 1023, script_file))) {
if (strstr(buf, "xsetwacom")) {
int r = system(buf);
if (r != 0) {
sprintf(buf, "xsetwacom returned error on line - %s", buf);
log_msg(l_buf);
}
++count;
}
}
sprintf(l_buf, "Script ran. %d matching lines executed.", count);
log_msg(l_buf);
}
int main(int argc, char **argv) {
char script_name[1024];
if (argc != 2) {
log_msg("Script not specified, using .xinitrc");
strcpy(script_name, ".xinitrc");
} else {
strcpy(script_name, argv[1]);
}
run_script(script_name);
FILE* in = popen("dbus-monitor --session type='signal',interface='org.gnome.ScreenSaver',member='ActiveChanged'", "r");
if (!in) {
log_msg("Cannot spawn dbus-monitor process. Terminating.");
return 1;
}
while (1) {
char buf[1024];
assert(fgets(buf, 1023, in));
if (buf[0] == 's' /* early exit optimization */ && strstr(buf, "ActiveChanged") != NULL) {
assert(fgets(buf, 1023, in));
if (strstr(buf, "false") != NULL) {
/* resumed */
log_msg("Exit from screensaver detected. Running script.");
run_script(script_name);
} else {
/* put to sleep */
}
}
}
}
Back at the terminal run:
Code:
gcc -O2 monitor_wacom.c -o .monitor_wacom
This will create a binary daemon in your home directory. The only thing left to do is add it to sessions.
Now go to System->Preferences->Startup Applications
(If you are still on Intrepid - which if you are this tutorial may not work - it is System->Preferences->Sessions)
and create a new entry named whatever you want.
the command should be:
Code:
/home/yourusername/.monitor_wacom /home/yourusername/.xinitrc
Where you replace yourusername with your user name. (Duh )
And that should be it. Everything for me is working great. If you have any problems, post here and You will probably receive help quite soon.
Have a great day!
Thanks:
Favux for his diligent hard working in creating the first tutorial, and helping us all in research.
Rec for his wonderful script and other work.
Timo for his work in getting the packages built and patching and all that wonderful stuff.
Cyberfish for his help in getting the fdi file right, and his settings daemon.
Ping at the Linuxwacom project.
Anyone else who I have failed to mention who deserves credit.
Kory
Edits:
4/18/09 - Fixed my present fdi file with better values for calibration.
5/4/09 - Redid tutorial with more information, updated to 0.8.3-3, removed rec's script, updated fdi file, and added settings daemon.
5/26/09 - Updated tutorial with Cyberfish's Second Daemon (finally), removing the xinitrc part. Updated to 0.8.3-4 and added large warning .
6/27/09 - Updated to 0.8.3-5
7/11/09 - Updated to 0.8.3-6
7/31/09 - Updated to 0.8.4
9/17/09 - Updated to 0.8.4-2 - Thanks Favux!
10/8/09 - Updated to 0.8.4-3 - Added Karmic Section
10/11/09 - Updated Karmic Instructions. Added compile error fix.
Bookmarks