• Welcome to Overclockers Forums! Join us to reply in threads, receive reduced ads, and to customize your site experience!

Attn: Wacom Tablet Users

Overclockers is supported by our readers. When you click a link to make a purchase, we may earn a commission. Learn More.

JigPu

Inactive Pokémon Moderator
Joined
Jun 20, 2001
Location
Vancouver, WA
If anybody here has a Wacom tablet (or any tablet really), I was wondering if you'd be interested in testing something for me. I've been working off and on for a while porting the JTablet library to Linux. JTablet provides Java applications and applets with support for tablets, making it possible for them to determine pen pressure and other attributes.

Note: A Trac wiki & SVN repository for this project is up and available at http://localhostlabs.no-ip.org/jtablet/ -- feel free to drop by or checkout files :)

x86 Debian/Ubuntu Instructions
~~~~~~~~~~~~~~~~~~~~~~~~

Begining with 0.9.5.2.1 Debian and Ubuntu users should be able to install JTablet Linux from a simple DEB package. This greatly reduces the work required to install since the package will search for and install all other required packages for you. To install, simply download the attached DEB package and run the following command:

Code:
# dpkg -i jtablet_20090101-1_i386.deb

If you'd like to remove JTablet at a later date, removing it is as simple as running:

Code:
# dpkg -r jtablet


Other x86 Linux Distros
~~~~~~~~~~~~~~~~~~~~~~~~

Users of other distros which do not wish (or unable to) compile from source may be able to make use of the binary installer. This version installs the pre-compiled library onto your system. However, for the library to work you will need to be sure your system satisfies a few requirements:

  • A Java VM (only tested with Java 6, very likely works with others)
    • Sun Java 6 JRE
  • X11 Development Libraries
    • libX11
    • libXi
    • libXau
    • libXdmcp
    • libXext
  • C Library
    • libc
  • Standard C++ Library
    • libstdc++

To install the binaries, extract the .zip file to a location of your choosing. From within that dirctory, run the following command as root:

Code:
# make install

If you ever want to uninstall the binaries, run the following command as root:

Code:
# make uninstall


Compiling From Source
~~~~~~~~~~~~~~~~~~~~~~~~

For those who are not able (or do not wish to) install one of the provided binary versions can compile the project from source by following the instructions below.

Prior to compiling, there are a number of requirements that must be satisfied:

  • Java Compiler (only tested with Java 6, very likely works with others)
    • Sun Java 6 JDK
    • JDK_HOME set properly (installing Sun Java does not do this! a command similar to the following must be run if JDK_HOME has not been defined)
      • export JDK_HOME="/usr/lib/jvm/java-6-sun/"
  • C++ Compiler
    • g++
  • X11 Development Headers
    • libx11-dev (X11 client-side library development headers)
    • x11proto-core-dev (X11 core wire protocol and auxiliary headers)
    • x11proto-input-dev (X11 Input extension wire protocol)
    • libXi-dev (X11 Input extension library (development headers))

To compile the source, download the attached .zip file and extract the files. Open up a terminal and change to the location you extracted. Run the following command:

Code:
$ make

Once compiled, the resulting library and JAR may be installed by running the following as root:

Code:
# make install

If you want to uninstall the library and JAR, run the following as root:

Code:
# make uninstall


Testing
~~~~~~~~~~~~~~~~~~~~~~~~

Only the source package includes examples that can be run. If you built from source you can run any of the following commands from the project's root:

Code:
$ make test
Code:
$ make test2
Code:
$ make test3

The first command runs an applet which provides a canvas that you can draw on. It should respond to pressure by varying the stroke width. The second command displays real-time details about the tablet (such as position, pressure, and [if supported] pen angle). The final command is the same as the second, but runs as a Java application instead of an applet -- try this if the first two do not run.

If you have not installed from source, you will need to try to run a JTablet-enabled applet online. The following is a list of sites that have JTablet-enabled applets:



Troubleshooting
~~~~~~~~~~~~~~~~~~~~~~~~

When troubleshooting problems, it is important that you provide the console output. This is easy for compiling/installation problems, as you are typically already working at the console. If having problems with applets online, open up the browser through the console (e.g., by running the command "firefox" from the console) to view the library's output.

Debugging messages are enabled by default on the binary distributions provided, though not enabled by default when compiling from source. To enable debugging for the compiled version, you can rebuild the files like this:

Code:
$ make clean
$ make DEBUG=1
$ su
# make uninstall
# make install

This will clean out all the compiled code and then rebuild it with debugging enabled. After it is built, the old version is uninstalled and the new version installed in its place.

Also, screenshots are useful, as well as some OS information. Posting the distro, X.Org version, LinuxWacom driver version, etc are a great help if you know them :)


Version History
~~~~~~~~~~~~~~~~~~~~~~~~

2007-10-27: Fixed a bug with the button mask & mapped all available axes (even though I've yet to come up with a good way to determine if the tablet actually supports them...). Created an abstract TabletDevice superclass which xtabletaccess.cpp interfaces with (rather than directly with WacomDevice).

2007-10-29: Modified makefiles to use the $JAVA_HOME and $JDK_HOME environment variables. This should result in more portable code (since those variables should be present on way more systems than the java-config command I'd been using) but will break if you attempt to "sudo" the install or uninstall commands (since environment variables like $JAVA_HOME are not passed in by sudo to the command :()

2007-11-05: Fixed an error in the refactoring I did on 2007-10-27, fixed some stuff to make it compile under Ubuntu Gutsy. Good luck with the compiling :)

2008-01-13: Modified xtablet to make use of device names rather than device IDs to allow for better tablet detection (since IDs aren't constant between systems :(). Also, adapted the event registration code from JPen since it was working for henke_a.

2008-01-25: After going through the code again, I've realized my problem with catching events wasn't in event registration, but rather in determining the "owner" of an event. Simply, I had misread the X11 API and was looking for the wrong device ID. It was only through sheer luck that the last version worked on my Gentoo install. I've installed Ubuntu Gutsy on my desktop, and this latest version is working under it, so I have high hopes...

2008-03-30: Modified the structure of the package quite a bit from the previous version. Win32 and X11 builds are seperated into their own subdirectories (only the common files are left in the root), classes now have associated .h files, makefiles have been modified, etc. I've also unified debug statements across all the files, and am littering them in more and more places. This version also hopefully fixes an issue with X.Org 7.3 "XExtensionPointer" devices which weren't being recognized (and temporarily ignores all extension device test results while I debug).

2008-04-06: Fixed the code which reported the stylus tilt to give altitutde/azimuth values (as required by the jTablet library) rather than x-tilt/y-tilt values (as reported from the LinuxWacom driver).

2008-05-14: Re-wrote the math powering the altitude/azumith code. Hopefully this time it returns real values ;)

2008-05-19: Changed the SupportsAxis method to check that the requested axis number is less than the number of axes supported by the tablet. This should keep non-Wacom tablets which use the same axis numbering scheme from crashing when JTablet requests a non-existant axis.

2008-06-10: Removed some files from the examples directory which caused incorrect error messages when files have not been properly installed. Also allowed compatibility check to allow devices that start with "Tablet" or "Wizardpen" (the two common prefixes for Wizardpen device names).

2008-06-18: Overhauled the logging system to make use of a static Log class instead of the #define hacks I was using. Also included a new log message to notify about events which are taken from the event queue but never acted on.

2008-06-25: Added in a missing #include found by tetromino. Changed compatibility verification code which checks tablet names to warn on unknown names instead of fail.

2008-07-08: Included NULL pointer checking and warning in XWacomDevice::GetEventType, since that is where the pen-down crash occurs. I've not pinned down the cause, so hopefully these new warnings will be sufficient to let me figure out what is going wrong. ALSO changed version number scheme for better use with my SVN server. I hope to eventually put a link to my SVN & Trac server to provide access to all the versions and a ticketing system.

2008-07-11: Fixed three bugs. 1) Log was not displaying WARN level entries. 2) Compatibility check did not reject virtual devices. 3) Inaccessible devices would create half-initialized objects.

2009-01-01: Happy New Year! There are a number of changes in this release, mostly related to installation. I've figured out a better spot to install the .so and .jar files (which should work across all distros), and have also managed to find instructions on creating DEB packages (so that Debian/Ubuntu users need not compile anything!). Also, compilations will NOT by default be debug versions anymore. Instructions on creating debug versions are included above.
 

Attachments

  • jtablet_0.9.5.2.1_src.zip
    182.3 KB · Views: 643
  • jtablet_0.9.5.2.1_x86.zip
    427.7 KB · Views: 599
  • jtablet_20090101-1_i386.deb.zip
    51.3 KB · Views: 597
Last edited:
Here's a sample of what I'd like :)

Notes:
Gentoo Linux 2006.1
X.Org 7.1
LinuxWacom 0.7.8-3

Console Output:
Code:
jgerecke@Nacho ~/Desktop/jtablet-sdk-v0.9.5_linux/c++src $ make test_applet2
cd ../examples && appletviewer JTablet-test2.html
using java 2! (v1.4+!)
Closing all known tablets.
Tablet(s) closed.
Connected to X server.
Enumerating devices...
Found: deviceInfo[0].name = <default pointer>, type = 92, id = 0
Found: deviceInfo[1].name = pad, type = 121, id = 1
Constructing new WacomDevice (id = 1, type = 121)
   * Class 1 is a KeyClass. There are 32 keys from 8 to 39.
   * Class 1 is a ButtonClass. There are 0 buttons.
   * Class 2 is a ValuatorClass. There are 0 valuators.
      + Valuator #0: 0 - 10208 (resolution: 2032)
      + Valuator #1: 0 - 7424 (resolution: 2032)
      + Valuator #2: 0 - 511 (resolution: 1)
      + Valuator #3: 0 - 4097 (resolution: 1)
      + Valuator #4: 0 - 4097 (resolution: 1)
      + Valuator #5: 0 - 1023 (resolution: 1)
      + Valuator #6: 136467496 - 1148387728 (resolution: 1148387728)
      + Valuator #7: 1148387728 - 80 (resolution: 0)
Found: deviceInfo[2].name = cursor, type = 122, id = 2
Constructing new WacomDevice (id = 2, type = 122)
   * Class 1 is a KeyClass. There are 32 keys from 8 to 39.
   * Class 1 is a ButtonClass. There are 0 buttons.
   * Class 2 is a ValuatorClass. There are 0 valuators.
      + Valuator #0: 0 - 10208 (resolution: 2032)
      + Valuator #1: 0 - 7424 (resolution: 2032)
      + Valuator #2: 0 - 511 (resolution: 1)
      + Valuator #3: -900 - 899 (resolution: 1)
      + Valuator #4: -1023 - 1023 (resolution: 1)
      + Valuator #5: 0 - 1023 (resolution: 1)
      + Valuator #6: 64 - 24 (resolution: 17)
      + Valuator #7: 134247284 - 136431968 (resolution: 136462384)
Found: deviceInfo[3].name = eraser, type = 123, id = 3
Constructing new WacomDevice (id = 3, type = 123)
   * Class 1 is a KeyClass. There are 32 keys from 8 to 39.
   * Class 1 is a ButtonClass. There are 0 buttons.
   * Class 2 is a ValuatorClass. There are 0 valuators.
      + Valuator #0: 0 - 10208 (resolution: 2032)
      + Valuator #1: 0 - 7424 (resolution: 2032)
      + Valuator #2: 0 - 511 (resolution: 1)
      + Valuator #3: -64 - 63 (resolution: 1)
      + Valuator #4: -64 - 63 (resolution: 1)
      + Valuator #5: 0 - 1023 (resolution: 1)
      + Valuator #6: 51 - 217 (resolution: 694775155)
      + Valuator #7: 24 - 136457472 (resolution: 136457792)
Found: deviceInfo[4].name = stylus, type = 124, id = 4
Constructing new WacomDevice (id = 4, type = 124)
   * Class 1 is a KeyClass. There are 32 keys from 8 to 39.
   * Class 1 is a ButtonClass. There are 0 buttons.
   * Class 2 is a ValuatorClass. There are 0 valuators.
      + Valuator #0: 0 - 10208 (resolution: 2032)
      + Valuator #1: 0 - 7424 (resolution: 2032)
      + Valuator #2: 0 - 511 (resolution: 1)
      + Valuator #3: -64 - 63 (resolution: 1)
      + Valuator #4: -64 - 63 (resolution: 1)
      + Valuator #5: 0 - 1023 (resolution: 1)
      + Valuator #6: 6 - 17 (resolution: 33)
      + Valuator #7: 24 - 136452440 (resolution: 136452536)
Found: deviceInfo[5].name = Keyboard0, type = 91, id = 5
Tablet(s) initialized.
Cursors differ! Was cursorPhysicalId = 0, cursorId = 0; Now cursorPhysicalId = 4, cursorId = 4
Checking if returned cursor is non-null
Checking if created cursor is non-null
Initializing Cursor cursorPhysicalId = 4, cursorId = 4.
Getting cursor data
Locating device id 4
Getting cursor data
{repeats last 2 lines lots of times...}
 

Attachments

  • Screenshot-Applet Viewer.png
    Screenshot-Applet Viewer.png
    9.1 KB · Views: 2,573
Last edited:
You might be able to boot into a LiveCD and do the test. I'm not certian, but provided the Java libraries aren't accessed directly from the CD-ROM (but rather copied to somewhere in the RAM drive) it should have the same effect.

JigPu
 
I gave it a shot on an Ubuntu 6.10 LiveCD I had laying around without success. Apparently Ubuntu doesn't ship with Sun's Java, and I couldn't find where their version hides its libraries. I'll keep poking around, but for now you'll definatly need Sun Java installed.

JigPu
 
Been working on getting this to work under Ubuntu Gutsy thanks to my sister's boyfriend. There were a number of packages that needed to be installed since Ubuntu doesn't provide a lot of things needed for building. Also, GCC on this computer is a lot pickier than on mine for some reason, so I had to fix a few problems it complained about (thankfully nothing too big). I don't yet have it working, but its late and almost there (its failing on the linker step) ;)

What you need installed before trying to compile:
* Sun JDK (I'm testing with jdk6)
* libx11-dev
* x11proto-core-dev
* x11proto-input-dev
* g++

JigPu
 

Attachments

  • jtablet-sdk-v0.9.5_linux4.zip
    366.3 KB · Views: 326
Good and bad news.

Good News
The version below should compile under Ubuntu Gutsy Gibbon. I've lost my Ubuntu test box (it only came down for a visit), but I did manage to get it working after some screwing around. From what I can see, I was missing one of the X11 development packages, and my makefile was not correctly commenting a line. Also, I fixed a bug that popped up when I refacotred the code earlier (I had forgotten to update my max/min/resolution getters to reflect the fact that different axis constants were being passed around)

What You Need (some fat might be trimmed, I haven't tried):
  • sun-java6-jdk (earlier versions like sun-java5-jdk may work too)
    • JAVA_HOME defined (installing sun java does not do this! a command similar to the following must be run before you compile)
      • export JAVA_HOME="/usr/lib/jvm/java-6-sun/jre"
    • JDK_HOME defined (installing sun java does not do this! a command similar to the following must be run before you compile)
      • export JDK_HOME="/usr/lib/jvm/java-6-sun"
  • g++ (The GNU C++ compiler)
  • libx11-dev (X11 client-side library (development headers))
  • x11proto-core-dev (X11 core wire protocol and auxiliary headers)
  • x11proto-input-dev (X11 Input extension wire protocol)
  • libXi-dev (X11 Input extension library (development headers))

Bad News
I've had a bad feeling that some of the constants I've defined in my code weren't really constants. Specifically the types "PAD", "CURSOR", "ERASER", and "STYLUS" were set based on values my system returned. These values let the library distinguish different types of devices, and makes sure it doesn't try to map e.g. your keyboard as a tablet :D

Unfortunatly for some reason the values weren't the same on both systems, meaning that I couldn't use my tablet in the system without editing the source code to reflect the new values. Afterwords it appeared to work fine, but I'm going to need to do some more digging to figure out why its not constant. What it essentially means for anybody testing is that they shouldn't be surprised when things don't appear to be working at all (or no more than a regular mouse) :(

JigPu
 

Attachments

  • jtablet-sdk-v0.9.5_linux5.zip
    363.4 KB · Views: 298
Hi!
som test results, running Ubuntu gustsy, java 1.6.0_03, wacom intuos 2:
Code:
$ appletviewer JTablet-test2.html
using java 2! (v1.4+!)
Closing all known tablets.
Tablet(s) closed.
Connected to X server.
Enumerating devices...
Found: deviceInfo[0].name = cursor, type = 117, id = 0
Constructing new TabletDevice (id = 0, type = 117)
Constructing new WacomDevice (id = 0, type = 117)
   * Class 1 is a KeyClass. There are 7 keys from 8 to 14.
   * Class 1 is a ButtonClass. There are 0 buttons.
   * Class 2 is a ValuatorClass. There are 0 valuators.
      + Valuator #0: 0 - 60960 (resolution: 2540)
      + Valuator #1: 0 - 24060 (resolution: 2540)
      + Valuator #2: 0 - 1023 (resolution: 1)
      + Valuator #3: -900 - 899 (resolution: 1)
      + Valuator #4: -1023 - 1023 (resolution: 1)
      + Valuator #5: 0 - 1023 (resolution: 1)
Found: deviceInfo[1].name = stylus, type = 118, id = 1
Constructing new TabletDevice (id = 1, type = 118)
Constructing new WacomDevice (id = 1, type = 118)
   * Class 1 is a KeyClass. There are 7 keys from 8 to 14.
   * Class 1 is a ButtonClass. There are 0 buttons.
   * Class 2 is a ValuatorClass. There are 0 valuators.
      + Valuator #0: 0 - 60960 (resolution: 2540)
      + Valuator #1: 0 - 24060 (resolution: 2540)
      + Valuator #2: 0 - 1023 (resolution: 1)
      + Valuator #3: -64 - 63 (resolution: 1)
      + Valuator #4: -64 - 63 (resolution: 1)
      + Valuator #5: 0 - 1023 (resolution: 1)
Found: deviceInfo[2].name = eraser, type = 119, id = 2
Constructing new TabletDevice (id = 2, type = 119)
Constructing new WacomDevice (id = 2, type = 119)
   * Class 1 is a KeyClass. There are 7 keys from 8 to 14.
   * Class 1 is a ButtonClass. There are 0 buttons.
   * Class 2 is a ValuatorClass. There are 0 valuators.
      + Valuator #0: 0 - 60960 (resolution: 2540)
      + Valuator #1: 0 - 24060 (resolution: 2540)
      + Valuator #2: 0 - 1023 (resolution: 1)
      + Valuator #3: -64 - 63 (resolution: 1)
      + Valuator #4: -64 - 63 (resolution: 1)
      + Valuator #5: 0 - 1023 (resolution: 1)
Found: deviceInfo[3].name = Configured Mouse, type = 88, id = 3
Constructing new TabletDevice (id = 3, type = 88)
Found: deviceInfo[4].name = Generic Keyboard, type = 87, id = 4
Constructing new TabletDevice (id = 4, type = 87)
Tablet(s) initialized.
Cursors differ! Was cursorPhysicalId = 0, cursorId = 0; Now cursorPhysicalId = 1, cursorId = 1
Checking if returned cursor is non-null
Checking if created cursor is non-null
Initializing Cursor cursorPhysicalId = 1, cursorId = 1.
Getting cursor data
Locating device id 1
Getting Cursor InfoGetting cursor data
Locating device id 1
Getting Button InfoGetting cursor data
Locating device id 1
Getting cursor data
Locating device id 1
Getting cursor data
Locating device id 1
Getting cursor data
Locating device id 1
Getting cursor data
Locating device id 1
Getting cursor data
Locating device id 1
Getting cursor data
Locating device id 1
Getting cursor data
Locating device id 1
Getting cursor data
Locating device id 1
Getting cursor data
Locating device id 1
Getting cursor data
Locating device id 1
Cursors differ! Was cursorPhysicalId = 1, cursorId = 1; Now cursorPhysicalId = 2, cursorId = 2
Checking if returned cursor is non-null
Checking if created cursor is non-null
Initializing Cursor cursorPhysicalId = 2, cursorId = 2.
Cursors differ! Was cursorPhysicalId = 2, cursorId = 2; Now cursorPhysicalId = 1, cursorId = 1
Checking if returned cursor is non-null
I changed the values of "PAD","CURSOR,"ERASER" and "STYLUS", otherwise it couldn't find my tablet.
I noticed the values only change when a "button" is pressed/released, so if i make a stroke with the stylus I only get the coordinates from where the stroke start and end, is this how its supposed to be?
Please tell me if theres anything more I can do to help you out, I would love to use this in my java applications!
 

Attachments

  • screenshot2.png
    screenshot2.png
    21.9 KB · Views: 2,467
Thanks for trying this out henke_a :)

The values should change any time cursor data changes, not just when buttons are pressed/released. Do you have the Wacom set up correctly under Linux? By default Gutsy needs some tweaking to get most tablets to work correctly. Things are set up correctly if the mouse cursor moves when you move the pen *above* the tablet surface (things need tweaking if the cursor only moves while in contact with the tablet surface).

If things are set up correctly, its probably either a difference in how Intuos tablets send events, or a bug in my event recieving code. Updates on button-press mean that I'm at least recieving those events, but for some reason not seeing other general movement events. You might double-check that SendCoreEvents is enabled for the tablet (outlined here) while I go through my code. If I can't find anything, I'll post up a version for you with some more debug statements in the event handling section.

JigPu
 
I'm pretty sure its setup correct, "SendCoreEvents" are enabled, everything works in GIMP, and I can move the cursor even when the tip is above the tablet.
However I cant get it to work more than a normal mouse in programs running under wine (tried both oC and artRage).
 
Since the tablet is set up correctly on your sytem, I've gone through and added some extra debugging output durring the event handling portion of the code. After unzipping this, you'll want to edit back in the constants for your tablet and then rebuild everything by running make, make uninstall, and make install as root.

Once the library has been recompiled and reinstalled, run the test applet again with the command make test_applet2 2>stderr.txt as root to save the stderr stream (which is where all my debug messages go) to the file "stderr.txt". Move the pen above the tablet surface for a few seconds, press a few buttons, try dragging, etc. Once done, quit the applet and attach the stderr.txt file to your post.

Here's a (hacked down in size) sample of what stderr.txt looks like on my system:
Code:
Closing all known tablets.
Tablet(s) closed.
Connected to X server.
Enumerating devices...
Found: deviceInfo[0].name = <default pointer>, type = 92, id = 0
Constructing new TabletDevice (id = 0, type = 92)
Found: deviceInfo[1].name = pad, type = 121, id = 1
Constructing new TabletDevice (id = 1, type = 121)
Constructing new WacomDevice (id = 1, type = 121)
   * Class 1 is a KeyClass. There are 32 keys from 8 to 39.
   * Class 1 is a ButtonClass. There are 0 buttons.
   * Class 2 is a ValuatorClass. There are 0 valuators.
      + Valuator #0: 0 - 10208 (resolution: 2032)
      + Valuator #1: 0 - 7424 (resolution: 2032)
      + Valuator #2: 0 - 511 (resolution: 1)
      + Valuator #3: 0 - 4097 (resolution: 1)
      + Valuator #4: 0 - 4097 (resolution: 1)
      + Valuator #5: 0 - 1023 (resolution: 1)
      + Valuator #6: 136467496 - 1148387728 (resolution: 1148387728)
      + Valuator #7: 1148387728 - 80 (resolution: 0)
Found: deviceInfo[2].name = cursor, type = 122, id = 2
Constructing new TabletDevice (id = 2, type = 122)
Constructing new WacomDevice (id = 2, type = 122)
   * Class 1 is a KeyClass. There are 32 keys from 8 to 39.
   * Class 1 is a ButtonClass. There are 0 buttons.
   * Class 2 is a ValuatorClass. There are 0 valuators.
      + Valuator #0: 0 - 10208 (resolution: 2032)
      + Valuator #1: 0 - 7424 (resolution: 2032)
      + Valuator #2: 0 - 511 (resolution: 1)
      + Valuator #3: -900 - 899 (resolution: 1)
      + Valuator #4: -1023 - 1023 (resolution: 1)
      + Valuator #5: 0 - 1023 (resolution: 1)
      + Valuator #6: 64 - 24 (resolution: 17)
      + Valuator #7: 134247284 - 136431968 (resolution: 136462384)
Found: deviceInfo[3].name = eraser, type = 123, id = 3
Constructing new TabletDevice (id = 3, type = 123)
Constructing new WacomDevice (id = 3, type = 123)
   * Class 1 is a KeyClass. There are 32 keys from 8 to 39.
   * Class 1 is a ButtonClass. There are 0 buttons.
   * Class 2 is a ValuatorClass. There are 0 valuators.
      + Valuator #0: 0 - 10208 (resolution: 2032)
      + Valuator #1: 0 - 7424 (resolution: 2032)
      + Valuator #2: 0 - 511 (resolution: 1)
      + Valuator #3: -64 - 63 (resolution: 1)
      + Valuator #4: -64 - 63 (resolution: 1)
      + Valuator #5: 0 - 1023 (resolution: 1)
      + Valuator #6: 51 - 217 (resolution: 694775155)
      + Valuator #7: 24 - 136457472 (resolution: 136457792)
Found: deviceInfo[4].name = stylus, type = 124, id = 4
Constructing new TabletDevice (id = 4, type = 124)
Constructing new WacomDevice (id = 4, type = 124)
   * Class 1 is a KeyClass. There are 32 keys from 8 to 39.
   * Class 1 is a ButtonClass. There are 0 buttons.
   * Class 2 is a ValuatorClass. There are 0 valuators.
      + Valuator #0: 0 - 10208 (resolution: 2032)
      + Valuator #1: 0 - 7424 (resolution: 2032)
      + Valuator #2: 0 - 511 (resolution: 1)
      + Valuator #3: -64 - 63 (resolution: 1)
      + Valuator #4: -64 - 63 (resolution: 1)
      + Valuator #5: 0 - 1023 (resolution: 1)
      + Valuator #6: 6 - 17 (resolution: 33)
      + Valuator #7: 24 - 136452440 (resolution: 136452536)
Found: deviceInfo[5].name = Keyboard0, type = 91, id = 5
Constructing new TabletDevice (id = 5, type = 91)
Tablet(s) initialized.
No interesting events in the queue. Returning from ReadTablet
No interesting events in the queue. Returning from ReadTablet
No interesting events in the queue. Returning from ReadTablet
No interesting events in the queue. Returning from ReadTablet
No interesting events in the queue. Returning from ReadTablet
{ABOVE LINE REPEATS MANY TIMES}
Getting initator of event
XI_DeviceMotionNotify; event deviceid = 4; WacomTablet deviceid = 1
XI_DeviceMotionNotify; event deviceid = 4; WacomTablet deviceid = 2
XI_DeviceMotionNotify; event deviceid = 4; WacomTablet deviceid = 3
XI_DeviceMotionNotify; event deviceid = 4; WacomTablet deviceid = 4
Getting initator of event
XI_DeviceMotionNotify; event deviceid = 4; WacomTablet deviceid = 1
XI_DeviceMotionNotify; event deviceid = 4; WacomTablet deviceid = 2
XI_DeviceMotionNotify; event deviceid = 4; WacomTablet deviceid = 3
XI_DeviceMotionNotify; event deviceid = 4; WacomTablet deviceid = 4
Cursors differ! Was cursorPhysicalId = 0, cursorId = 0; Now cursorPhysicalId = 4, cursorId = 4
Checking if returned cursor is non-null
Checking if created cursor is non-null
Initializing Cursor cursorPhysicalId = 4, cursorId = 4.
Filling jTablet data array with information from event.
XI_DeviceMotionNotify; event deviceid = 4; WacomTablet deviceid = 4
XI_DeviceMotionNotify; event deviceid = 4; WacomTablet deviceid = 4
XI_DeviceMotionNotify; event deviceid = 4; WacomTablet deviceid = 4
XI_DeviceMotionNotify; event deviceid = 4; WacomTablet deviceid = 4
XI_DeviceMotionNotify; event deviceid = 4; WacomTablet deviceid = 4
XI_DeviceMotionNotify; event deviceid = 4; WacomTablet deviceid = 4
XI_DeviceMotionNotify; event deviceid = 4; WacomTablet deviceid = 4
XI_DeviceMotionNotify; event deviceid = 4; WacomTablet deviceid = 4
XI_DeviceMotionNotify; event deviceid = 4; WacomTablet deviceid = 4
XI_DeviceMotionNotify; event deviceid = 4; WacomTablet deviceid = 4
XI_DeviceMotionNotify; event deviceid = 4; WacomTablet deviceid = 4
Getting cursor data
Locating device id 4
Getting Cursor InfoGetting cursor data
Locating device id 4
Getting Button InfoGetting cursor data
Locating device id 4
Getting cursor data
Locating device id 4
Getting cursor data
Locating device id 4
Getting cursor data
Locating device id 4
Getting cursor data
Locating device id 4
Getting cursor data
Locating device id 4
Getting cursor data
Locating device id 4
Getting cursor data
Locating device id 4
Getting cursor data
Locating device id 4
Getting cursor data
Locating device id 4
Getting cursor data
Locating device id 4
Getting initator of event
XI_DeviceMotionNotify; event deviceid = 4; WacomTablet deviceid = 1
XI_DeviceMotionNotify; event deviceid = 4; WacomTablet deviceid = 2
XI_DeviceMotionNotify; event deviceid = 4; WacomTablet deviceid = 3
XI_DeviceMotionNotify; event deviceid = 4; WacomTablet deviceid = 4
Getting initator of event
XI_DeviceMotionNotify; event deviceid = 4; WacomTablet deviceid = 1
XI_DeviceMotionNotify; event deviceid = 4; WacomTablet deviceid = 2
XI_DeviceMotionNotify; event deviceid = 4; WacomTablet deviceid = 3
XI_DeviceMotionNotify; event deviceid = 4; WacomTablet deviceid = 4
Getting initator of event
XI_DeviceMotionNotify; event deviceid = 4; WacomTablet deviceid = 1
XI_DeviceMotionNotify; event deviceid = 4; WacomTablet deviceid = 2
XI_DeviceMotionNotify; event deviceid = 4; WacomTablet deviceid = 3
XI_DeviceMotionNotify; event deviceid = 4; WacomTablet deviceid = 4
Filling jTablet data array with information from event.
XI_DeviceMotionNotify; event deviceid = 4; WacomTablet deviceid = 4
XI_DeviceMotionNotify; event deviceid = 4; WacomTablet deviceid = 4
XI_DeviceMotionNotify; event deviceid = 4; WacomTablet deviceid = 4
XI_DeviceMotionNotify; event deviceid = 4; WacomTablet deviceid = 4
XI_DeviceMotionNotify; event deviceid = 4; WacomTablet deviceid = 4
XI_DeviceMotionNotify; event deviceid = 4; WacomTablet deviceid = 4
XI_DeviceMotionNotify; event deviceid = 4; WacomTablet deviceid = 4
XI_DeviceMotionNotify; event deviceid = 4; WacomTablet deviceid = 4
XI_DeviceMotionNotify; event deviceid = 4; WacomTablet deviceid = 4
XI_DeviceMotionNotify; event deviceid = 4; WacomTablet deviceid = 4
XI_DeviceMotionNotify; event deviceid = 4; WacomTablet deviceid = 4
Getting initator of event
XI_DeviceButtonPress or XI_DeviceButtonRelease; event deviceid = 4; WacomTablet deviceid = 1
XI_DeviceButtonPress or XI_DeviceButtonRelease; event deviceid = 4; WacomTablet deviceid = 2
XI_DeviceButtonPress or XI_DeviceButtonRelease; event deviceid = 4; WacomTablet deviceid = 3
XI_DeviceButtonPress or XI_DeviceButtonRelease; event deviceid = 4; WacomTablet deviceid = 4
Getting initator of event
XI_DeviceMotionNotify; event deviceid = 4; WacomTablet deviceid = 1
XI_DeviceMotionNotify; event deviceid = 4; WacomTablet deviceid = 2
XI_DeviceMotionNotify; event deviceid = 4; WacomTablet deviceid = 3
XI_DeviceMotionNotify; event deviceid = 4; WacomTablet deviceid = 4
Getting initator of event
XI_DeviceMotionNotify; event deviceid = 4; WacomTablet deviceid = 1
XI_DeviceMotionNotify; event deviceid = 4; WacomTablet deviceid = 2
XI_DeviceMotionNotify; event deviceid = 4; WacomTablet deviceid = 3
XI_DeviceMotionNotify; event deviceid = 4; WacomTablet deviceid = 4
No interesting events in the queue. Returning from ReadTablet
No interesting events in the queue. Returning from ReadTablet
No interesting events in the queue. Returning from ReadTablet
No interesting events in the queue. Returning from ReadTablet
No interesting events in the queue. Returning from ReadTablet
No interesting events in the queue. Returning from ReadTablet
{ABOVE LINE REPEATS MANY TIMES}

JigPu
 

Attachments

  • jtablet-sdk-v0.9.5_linux6.zip
    363.5 KB · Views: 308
Ok I did this, ran it for about 10 seconds then I had a stderr.txt with a size of 400mb:eek:

I get a lot of "Unknown Event Type (type 6); event deviceid = ??? ", I thought those might be the "MotionNotify" I saw in your output, but I actually do get those, only once though(se my comment in the file). I moved the pen both above and on the tablet surface.
the attached file is a cut down version, but I could give you the large file
gziped(2mb) if you like.
 

Attachments

  • stderr.txt
    10.2 KB · Views: 198
Daaaang! I knew it'd be big, but 400MB was a bit beyond my expectations! jTablet samples the tablet 100 times a second, so even at 10 seconds I never expected anything above a few dozen MB... Though I guess with the unknown events never being taken off the queue it'd cause a balooning like you saw.

~~~~~~~~~~
It appears that X isn't sending any useful events. My code right now uses XI_DeviceMotionNotify events to find the tablet state, but it only ever sent one of those to you. The "type = 6" events you see filling your stderr.txt are XI_DeviceFocusIn events which are apparently sent when some program decides to modify the focus of a device.

After some looking around, I think the problem may be partially resolved by adding in support for other events that X can provide if I ask for them. For example, an XI_DeviceStateNotify event (which contains tablet data) is supposed to follow the XI_DeviceFocusIn you keep recieving. There are several other event types that I should be asking for, but have been ignoring since XI_DeviceMotionNotify worked for me.

I've attached a new version of the library which handles all the events that I think would contain tablet data. Run the applet again and let me know the results. If nothing seems to work, save the output again and let me chew on another sample :)

JigPu
 

Attachments

  • jtablet-sdk-v0.9.5_linux7.zip
    381.4 KB · Views: 308
I moved the stylus around for a few seconds, didn't get any data, then the vm crashed:-/
Code:
$ appletviewer JTablet-test2.html 2>stderr.txt
using java 2! (v1.4+!)
#
# An unexpected error has been detected by Java Runtime Environment:
#
#  SIGSEGV (0xb) at pc=0x8ff1e4f5, pid=7796, tid=2415672208
#
# Java VM: Java HotSpot(TM) Server VM (1.6.0_03-b05 mixed mode)
# Problematic frame:
# C  [libjtablet.so+0x54f5]  _ZN11WacomDevice12GetAxisValueElP23XDeviceStateNotifyEvent+0x89
#
# An error report file with more information is saved as hs_err_pid7796.log
#
# If you would like to submit a bug report, please visit:
#   http://java.sun.com/webapps/bugreport/crash.jsp
#
Aborted (core dumped)
 

Attachments

  • stderr.txt
    185.4 KB · Views: 145
Hmm... Well there are a few more movement events in that log file, but there aren't any state events following your focus events... I'm still not sure why you're getting so many focus events in the first place, but it does seem weird that there are so few events containing real tablet data.

Are you by any chance running any applications which make use of the tablet (e.g., Gimp or wacdump) at the same time? It shouldn't make a difference (I fired up Gimp on my own machine and it still received events properly), but I've got to be missing something...

Hi! I just released JPen <http://jpen.sf.net>. It is a java interface for pen tablets that works on linux and windows. It is released under LGPL.
Sounds cool. I'll give your library a shot :)

If I may, could you explain why you decided to create a new project? I must admit that I've only had a second or two to look at your work, but it seems like a duplication of effort to develop and maintain a library billed to do the same thing as JTablet (which is already used in several Java applets).

JigPu
 
I tried it again cause I wasn't sure if gimp was running last time, also tried some other things, switching to metacity(ran compiz last time), removed some options from my xorg.conf(TwinView, ScreenNo,PressCurve), also added the "pad" device(not needed with Intuos 2), but with the same results.

>nicarran: I tried your lib by running the example and everything seem to work fine :)
 
>hi JigPu,
Here goes some reasons why I developed JPen and why I think that maintaining it is not a duplication of effort. I developed JPen to provide new features and to consolidate the ones found in other similar solutions (JTablet, JWacom, JWinTab). JTablet and JPen are very different and here goes a list with some differences I found (correct me if I'm wrong and the pain worths it ;) :

* JPen includes an event/listener mechanism. This may avoid code/effort duplication, as every JTablet developer may end developing it.

* JPen manages multiple data providers simultaneously and gives priority to digitized (floating point precision X and Y values) when available. This way your program works fine with both mouse and pen tablet data. If the pen tablet is not present, if fires mouse data. In JTablet you would have to implement such mechanism by yourself.

* JPen works on linux and windows. JTablet has been out for a very long time and it still lacks stable linux support.

* With JPen you can have many Java Applications using JPen with digitized ( floating point X and Y values) data. Thats not an easy thing to do with JTablet as it has no mechanism to automatically enable/disable the "digitized" wintab mode.

* JPen gives your X and Y data relative to a predefined AWT component. In JTablet you have to calculate it by yourself.

* JPen does not get tilt/rotation data. JTablet does. (This is not hard to implement in JPen, the thing is that my graphire tablet does not give me these values.)

As you can see, most of the items of the list are presented as JPen's advantages, but in some scenarios they may be the opposite. Well, both libraries are there and now we can choose the better for the goals.

>hi henke_a. nice :)
 
Cool :) I really didn't like that JTablet wasn't event-based, and having XY data relative to a component is great (I had only glanced at the Java side of JTablet, and hadn't noticed that it doesn't do this for you). JPen seems to be working great on my Linux box as well, so things are looking good :beer:

I'm gonna get in touch with you via PM for some help with my code, if you don't mind. I see a few things you're doing differently, and I'm wondering if they'd fix the problems henke_a is having with my JTablet port.

JigPu
 
Back