Wacom, Mari and recent linux distributions

[Update: June 14 2011]
This is no longer needed starting with Mari 1.3v1, where the wacom detection was fixed. In fact using the here described workaround with Mari 1.3v1 and up breaks the wacom functionality.

So if you are using mari 1.3v1 and up do not follow these instructions !

[End of Update: June 14 2011]

If you are running Mari under a recent linux distribution and happen to have a wacom tablet, you certainly run into the problem, that pressure sensitivity does not work in Mari.

I encountered this problem during my normal evaluation period and almost went mad, that such a basic need wasn’t working. I knew that Mari was Qt based and that Qt had increasing problems recognizing tablet input devices with newer versions of the xf86-wacom driver.

As it turned out, the qt version Mari is using ( 4.5.2 if I am correct) does a somehow hardcoded approach in finding the available input devices. That means it expects the wacom driver to name its devices “stylus”, “eraser”, “pad” etc.

With the new version of the wacom x-driver that started shipping with ubuntu 10.04 the way the driver names the devices has changed, and whatever tricks you try to name them (either through xorg.conf or the fdi naming)  you never will get a device called stylus.

I had a look at the Qt code and it actually looks for a device starting with stylus.

A run of xsetwacom –list gives the following output on my machine:

Wacom Intuos4 6x9 eraser ERASER 
Wacom Intuos4 6x9 cursor CURSOR   
Wacom Intuos4 6x9 pad PAD      
Wacom Intuos4 6x9 stylus STYLUS

My way of fixing this was to actually patch the x wacom driver and prepend the desired names in front of the device name instead of appending it. So my output from xsetwacom –list looks like this:

eraser Wacom Intuos4 6x9 ERASER 
cursor Wacom Intuos4 6x9 CURSOR   
pad Wacom Intuos4 6x9 PAD      
stylus Wacom Intuos4 6x9 STYLUS

With this Qt ( and thus Mari) is able to find the wacom input devices and works just fine.

This problem was fixed in a later qt 4.5 version and should be fixed for Mari just by using a later version (which may pose different problems :) ). I guess its just a matter of time until Mari will be using an updated Qt version.

And here is my patch against the current xf86-input-wacom driver (version 0.11.0).

device name patch

And here is my compiled wacom driver: 64bit Kubuntu 11.04.

wacom_drv.so

 

10 thoughts on “Wacom, Mari and recent linux distributions”

  1. Nice post, but don’t work for me (in fact I have qt 4.7, but some troubles having pressure enable …) I don’t manage to understand where does Qt get’s device names, I have seen some ATOM() related stuff .. but’s unclear to me, any idea to make it work ?

    By the way i have ubuntu 11.04 64bits with qt4.7.2

    1. I had a quick look at the qt 4.7.3 code, and from a first glimpse it seems, that qt does now correctly handle both scenarios, the pre and post 0.10.0 ( x11_wacom driver) ones.

      If I read the code correctly, the criterion for qt to have a stylus is to see if a device is either named ‘STYLUS’ ( the new way) or ‘Wacom Stylus’. Both strings are defined as atoms in qt_application_x11.cpp.

      The check is done against the type string of the returned input device. You could check with xinput –list or xsetwacom list to see if the type of your devices are ‘STYLUS’ or ‘Wacom Stylus’. Or if you compile qt yourself, just put some debug messages in to print out the type names on your system.

      The x11_wacom driver coming with ubuntu 11.04 should use the type STYLUS.

      I am currently not at my workstation with a wacom, so I cannot directly check this for myself.

  2. Hi there,

    Thanks for the heads-up about what that bug was! I found the code you mentioned in the Qt source, and fixed it to handle a couple of Ubuntu 10.04’s different driver naming styles. A few “quick” rebuilds of Qt later (… not so quick 🙂 ), and now pressure sensitivity works on Ubuntu in Mari 1.3. (which isn’t too far away from release) That should save some headaches for users who don’t want to rebuild drivers.

    Cheers 🙂

    Chris Bevan (Mari dev)

    1. BTW. Did you look at the current 4.7.x implementation of the tablet detection ?

      They are doing an approach which should cover all scenarios. It should be easy to port this back to 4.5x if need be in the future.

      cheers
      Martin

      1. I had a very quick look at the 4.7 implementation – or maybe it was 4.6 – and saw some of the new tablet code. Changing that over could well be possible, but in practice we see so many tablet bugs that it might well reopen half the ones we’ve fixed already. Little fixes are much easier to get through QA ; )

        We’ll certainly keep it in mind in case we see some real nastiness in future. Fingers are crossed for the patched 4.5.2 code working well for a while, though.

        Cheers,
        – Chris

    1. Will the patched wacom_drv.so work on Fedora 14? if not, can you give some info on how to patch the driver myself. I am a little noob with Linux. Thanks 🙂

      1. Hi Bill

        I don’t think the patched driver will directly work on Fedora.

        I strongly advise to use Mari 1.3, as the issue is fixed in this version. So there is no longer any need to fiddle around with patches and self compiled wacom drivers.

        If you have a proper 1.2 license an update should be no problem.

Leave a Reply

Your email address will not be published.