Okay.. Sounds good. I'm about to try your new fdi files..
Also just so you know, libhal1-dev is not installed by default, so you shouldn't have to worry about it too much.
Okay off to test now. Wish me luck!
Kory
Printable View
Okay.. Sounds good. I'm about to try your new fdi files..
Also just so you know, libhal1-dev is not installed by default, so you shouldn't have to worry about it too much.
Okay off to test now. Wish me luck!
Kory
:D:D:D:D:D:D
It's working! Everything is working!!!!
Okay so now for the story...
I tried your fdi files and they didn't work. The idea was great, except there was a small problem.
For whatever reason when Hal goes in there it creates a bazillion devices and about 5 or six wacom ones. The Problem is that the the devices we want to be captured by the fdi file have a linux.sysfs_path that includes the event number (which changes on reboot.)
E.g.:
So that wouldn't work. So basically I took out all fdi files for wacom devices and rebooted. Then I used lshal to list all the wacom devices.Code:linux.sysfs_path = '/sys/devices/pci0000:00/0000:00:0b.1/usb1/1-2/1-2.3/1-2.3:1.0/input/input7/event7' (string)
I found the two that I needed to be captured by the fdi file and separated them from the rest. Then I cut out all the info that they had the same. Then remove the info that will change (event numbers...)
And we're left with:
On a whim, I chose input.originating_device. (and got lucky lol, but it's my guess any of the three options would work.)Code:udi = '/org/freedesktop/Hal/devices/usb_device_56a_93_noserial_if1_logicaldev_input'
info.parent = '/org/freedesktop/Hal/devices/usb_device_56a_93_noserial_if1' (string)
info.udi = '/org/freedesktop/Hal/devices/usb_device_56a_93_noserial_if1_logicaldev_input' (string)
input.originating_device = '/org/freedesktop/Hal/devices/usb_device_56a_93_noserial_if1' (string)
udi = '/org/freedesktop/Hal/devices/usb_device_56a_93_noserial_if0_logicaldev_input'
info.parent = '/org/freedesktop/Hal/devices/usb_device_56a_93_noserial_if0' (string)
info.udi = '/org/freedesktop/Hal/devices/usb_device_56a_93_noserial_if0_logicaldev_input' (string)
input.originating_device = '/org/freedesktop/Hal/devices/usb_device_56a_93_noserial_if0' (string)
I started the fdi file from scratch basically. I consolidated it into one file, with two separate devices.
As You can see, the only match it makes is to the input.originating_device.Code:<?xml version="1.0" encoding="UTF-8"?> <!-- -*- SGML -*- -->
<deviceinfo version="0.2">
<device>
<match key="input.originating_device" contains="/org/freedesktop/Hal/devices/usb_device_56a_93_noserial_if0">
<merge key="input.x11_driver" type="string">wacom</merge>
<merge key="input.x11_options.Type" type="string">stylus</merge>
<append key="info.callouts.add" type="strlist">hal-setup-wacom</append>
<append key="wacom.types" type="strlist">eraser</append>
</match>
</device>
<device>
<match key="input.originating_device" contains="/org/freedesktop/Hal/devices/usb_device_56a_93_noserial_if1">
<merge key="input.x11_driver" type="string">wacom</merge>
<merge key="input.x11_options.Type" type="string">touch</merge>
<append key="info.callouts.add" type="strlist">hal-setup-wacom</append>
</match>
</device>
</deviceinfo>
This works great. The even better news (and how I have absolutely no idea. It's proof of God lol)
Is that now we have no repeating devices, and those phantom devices Wacom ISDv4 93 have disappeared (at least as inputs.)
So that means only no repeating devices in wacomcpl and no extra useless devices in gimp.
Also as a plus, with the default uncalibrated fdi file, the touch is much more calibrated (its still off by about an inch from each corner, but its not as bad as usual) and touch can be calibrated from wacomcpl now!
Basically this puts me at the stage where I won't have to go back to the old method. It works great!
Below this post, I am going to outline the steps I took to get to this place once more. (Don't want this post to get to long...)
Kory
It worked!!! It worked!! Nice job! We've got it! Yes, yes, yes!
So cool! And the new .fdi looks like the way they handled touch for serial tablet pc's.
*****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:
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.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
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:
Now we need to compile the kernel module from the newest linux wacom release (0.8.4-3)Code:sudo apt-get install wacom-tools xserver-xorg-input-wacom
First we have to get all the tools we need:
1) First download the source code tar onto the desktop. In a terminal type:
2) Next install the needed libraries, packages and updates using the following apt-get commands.Code:cd ./Desktop
wget http://prdownloads.sourceforge.net/linuxwacom/linuxwacom-0.8.4-3.tar.bz2
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:uname -r
If you have the rt kernel:Code:sudo apt-get install linux-headers-generic
(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.)Code:sudo apt-get install linux-headers-rt
4) Okay now unpack the source code tar and go into the unpacked source code directory.
5) Then we compile the module.Code:tar xjvf linuxwacom-0.8.4-3.tar.bz2
cd linuxwacom-0.8.4-3
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:
Section 2: Creating the Fdi FileCode:sudo cp ./src/2.6.28/wacom.ko /lib/modules/`uname -r`/kernel/drivers/input/tablet/wacom.ko
First as a reference I will include a default fdi File:
Start with this as a reference.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>
If you are on Karmic, use: (delete the contents)Code:sudo gedit /usr/share/hal/fdi/policy/20thirdparty/10-wacom.fdi
Copy and paste the above contents then save.Code:sudo gedit /usr/share/hal/fdi/policy/20thirdparty/10-linuxwacom.fdi
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:
such as:Code:Option "OptionName" "OptionValue"
Now we add the line to the fdi file such as:Code:Option "BottomY" "3951"
such as:Code:<merge key="input.x11_options.OptionName" type="string">OptionValue</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:<merge key="input.x11_options.BottomY" type="string">16466</merge>
Section 4: Wacomcpl and settingsCode:<?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>
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:
and copy and paste in the following code then save and exit.Code:gedit monitor_wacom.c
Back at the terminal run: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 */
}
}
}
}
This will create a binary daemon in your home directory. The only thing left to do is add it to sessions.Code:gcc -O2 monitor_wacom.c -o .monitor_wacom
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:
Where you replace yourusername with your user name. (Duh :))Code:/home/yourusername/.monitor_wacom /home/yourusername/.xinitrc
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.
Hello gali98
Worked for me as well! I have a TX2113cl which is a version of the TX2000 so I just used your fdi entries. Great job! My xrandr script is not working correctly for some reason but I can live with that.
gali98,
if i have already installed wacom the old way in jaunty, will i have to take the input devices out of my xorg before installing with your guide?
And you only do this if your file doesnt work correct?
is there anything else i need to do before attempting your method on a tx2500? should the libhal1-dev be installed?Quote:
It should work on the tx2500 also, but just in case we will go over how to fix it if it doesn't.
Run the following commands in a fresh terminal:
Code:
That will open up a text editor with a lot of info. Go back to the terminal and run:Quote:
cd Desktop
lshal>lshal
gedit lshal &
Code:
Find which event points to the wacom file. Now go back to the text editor and hit ctrl+f for search and search that even (e.g. search "event?" where ? is the number.)Quote:
ls -l /dev/input
That should put you in a device set. Within that device set, find "input.originating_device." and copy it's value. Now go back to the fdi file, and replace my value for the first device with what you just copied.
Repeat this procedure for the "wacom-touch" file and use that string for the touch device in the fdi file.
Wow! What a mouthful! I just suggest trying my file first znd if it doesn't work THEN try all that above.
Hi gali98 and M42 and farmercyst,
For fun I tried to see how much I could get working in Intrepid. I duplicated the set-up using rec's script and the linuxwacom 0.8.3-1 I had already installed. I placed gali98's .fdi file in /usr/share/hal/fdi/policy/20thirdparty/. I commented out Wacom in xorg.conf and rebooted. I have stylus but not eraser and I have touch. This is in wacomcpl and gimp. They can be calibrated. Gimp has stylus pressure. However the wacom devices don't rotate with the standard scripts.
For the script I used wacom-names post #93 above. I also linked it as rec recommended:
I decided to experiment with the .fdi file. I took my two usb id_test 1.fdi's and consolidated them into one like gali98 did. Then I substituted the "linux.sysfs_path" = with the "input.originating_device" contains=. Same problem. Stylus and touch seem fine. No eraser. Both in wacomcpl and Gimp. I am not seeing duplicate entries in wacomcpl. And no rotation implying the xsetwacom commands in the xrander rotation script or Tom Jaeger's wacomrotate daemon aren't being seen.Code:sudo update-rc.d wacom-names start 27 2 3 4 5 .
I'm wondering what this is due to. Rec's script? It uses "--key input.x11_options.Type" after all. With Type=stylus, eraser, touch, cursor, pad? Which may be all wacomcpl needs, not the xsetwacom commands? Hmmm...
The call out not working correctly? Guess I could try 0.8.3-2. Most likely I need some of the stuff Timo packaged with 0.8.2-2.
Using rec's Wacom input names in xinput script I got:
before I changed the original wacom.fdi in Intrepid. Or maybe the stylus line appeared twice. With the new wacom.fdi's I am seeing:Code:product 'stylus' is type 'stylus'
Looking at Xinput:Code:product 'touch' is type 'touch'
product 'stylus' is type 'stylus'
shows stylus and touch but not eraser. The results were the same with xinput query-state "stylus" or xinput list-props "touch". I get "unable to find device eraser".Code:xinput list
Hello Favux,
I have touch and stylus with pressure and eraser working in Xjournal. I haven't tried Gimp. I attached my fdi file for info. I also xrandr web site at X.org and they seem to refer to version 1.2. When I checked out the version on my machine it is 1.3. Any possibilities our problem could be in the version difference?
Hi M42,
That could be. But I think more likely the problem with rotation is rec's script. My understanding may be wrong. But since it applies before Xserver, by design, it may not allow xsetwacom commands on the "fly". Which is why we can't get rotation. Or actually should I say it doesn't fix that part of the problem with Timo's patched linuxwacom 0.8.2-2?
Anyway I reactivated Wacom in xorg.conf. Now I have eraser but also a duplicate stylus and touch in wacomcpl. And pressure doesn't work in Gimp. And rotation doesn't work. Wacom tools don't rotate with the screen again implying xsetwacom commands not working. Next step is to remove rec's script.
I think the eraser problem is more likely the fault of Intrepid or linuxwacom 0.8.3-1. I could try 0.8.3-2. Thanks for the .fdi. Removing rec's script fixed the duplicate stylus and touch entries in wacomcpl. But rotation still doesn't work. Next step is to remove the last change, the new 10-wacom.fdi file.
Oops, removing the .fdi still didn't fix rotation. The script isn't in any of the run levels or init.d.
Hello Favux,
I'm not sure what is happening. Maybe when Jaunty is released some of these problems will go away. If I think of something I'll post. Good luck.