Re: wacom graphire usb with freebsd 5.1

From: arVid (nospam_at_hennep.adsl.utwente.nl)
Date: 01/08/04


Date: Thu, 8 Jan 2004 20:51:00 +0100

Jabba Leung:
> You can not use standard USB mouse driver in XFree86.

Why not? It worked perfectly with gentoo linux.

> I find in www.xfree86.org to have help document
> (http://www.xfree86.org/4.3.0/wacom.4.html) to tell you how to modify
> /etc/X11/XF86config manally.

That suggests using the wacom driver from Xfree. And that one doesnt
support usb wacoms for FreeBSD.

I found someone(Dave Huang) who has it working with NetBSD,
http://mail-index.netbsd.org/netbsd-help/2003/12/29/0000.html

I asked for his X86Config, and he sent me this:

Section "ServerLayout"
        Identifier "XFree86 Configured"
        Screen 0 "Screen0" 0 0
        InputDevice "Mouse0" "CorePointer"
        InputDevice "WacomP" "SendCoreEvents"
        InputDevice "WacomE" "SendCoreEvents"
        InputDevice "Keyboard0"
        "CoreKeyboard"
EndSection

Section "InputDevice"
        Identifier "Mouse0"
        Driver "mouse"
        Option "Protocol" "wsmouse"
        Option "Device" "/dev/wsmouse"
        Option "Buttons" "5"
        Option "ZAxisMapping" "4 5"
EndSection

Section "InputDevice"
        Identifier "WacomP"
        Driver "usbtablet"
        Option "Device" "/dev/uhid0"
        Option "Type" "stylus"
        Option "Mode" "Absolute"
EndSection

Section "InputDevice"
        Identifier "WacomE"
        Driver "usbtablet"
        Option "Device" "/dev/uhid0"
        Option "Type" "eraser"
        Option "Mode" "Absolute"
EndSection
                                        
He obviously uses his regular mouse too. I dont want that.

I will paste the rest of his mail here:

However, it looks like although FreeBSD's USB support was derived from
NetBSD's, they've diverged, especially in the area of USB Human
Interface Devices, such as mice and tablets. In particular, NetBSD
now attaches a separate device for each "report ID" of a HID device,
instead of a single device as FreeBSD does:

uhidev0 at uhub0 port 2 configuration 1 interface 0
uhidev0: WACOM CTE-430-UV3.1-4, rev 1.10/3.14, addr 2, iclass 3/1
uhidev0: 3 report ids
ums0 at uhidev0 reportid 1: 3 buttons and Z dir.
wsmouse1 at ums0 mux 0
uhid0 at uhidev0 reportid 2: input=7, output=0, feature=1
uhid1 at uhidev0 reportid 3: input=0, output=0, feature=1

This allows support for devices such as the Graphire3, which look like
a standard USB mouse on report ID 1, and a graphics tablet on report
ID 2 (I don't know what report ID 3 is used for).

I'm not sure if FreeBSD is incapable of handling HID devices with
multiple report IDs, or if it just handles them differently; in
NetBSD, the Graphire3 worked as a standard mouse without any extra
configuration. However, it didn't work as a graphics tablet (when
working as a mouse, it uses relative positioning, and doesn't return
any pressure information).

//note: i will be perfectly happy with that as a result, cause I will
//be able to work with the machine then.

If you stop moused, does
  hexdump -Cv /dev/ums0
show any data when you move the stylus on the tablet? If so, FreeBSD
is seeing the mouse data, in which case I don't know why it wouldn't
work in X. If not, perhaps FreeBSD needs to import the current
uhidev/uhid code from NetBSD to support HID devices with multiple
report IDs.

//It doesnt show anything.

Using the tablet simply as a mouse is a waste though :) I don't know
what would be required to get it working as a tablet in X. The main
thing would be a way to access the data from report ID 2 of the
tablet. In NetBSD, a "uhid" device attaches to report ID 2, and I can
access the data though /dev/uhid0. You'll also need to override the
report descriptor returned by the Graphire3 (instead of describing the
format of the data it returns, it labels everything
"vendor-specific"). It also needs to be sent a command to turn on the
reporting of tablet data (otherwise, it only returns generic mouse
data). See http://www.netbsd.org/cgi-bin/query-pr-single.pl?number=23965
for a patch to NetBSD that does that.

Once the kernel can get data from the tablet, you need an XInput
driver to get the data into X. Lennart Augustsson of NetBSD wrote the
original driver for XFree86 3.3.6, and Matthieu Herrb of OpenBSD
converted it for XFree86 4.x. I simply copied the files back over to
NetBSD with this patch:
http://www.netbsd.org/cgi-bin/query-pr-single.pl?number=23964

You may also be interested in the discussion in the "Wacom USB tablet
and XF86 4.3.0?" thread at
http://mail-index.netbsd.org/tech-x11/2004/01/

Good luck, and perhaps someone on the freebsd-hackers mailing list
might have more information on FreeBSD's uhid driver and devices with
multiple report IDs. (In particular, see the commit comment for
revision 1.1 of uhidev.c at
http://cvsweb.netbsd.org/bsdweb.cgi/src/sys/dev/usb/uhidev.c )
  

-- 
Arvid de Jong, Enschede, Netherlands