Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 14 Feb 2008 14:23:32 -0500
From:      Chuck Robey <chuckr@chuckr.org>
To:        Markus Brueffer <markus@FreeBSD.org>
Cc:        freebsd-usb@freebsd.org
Subject:   Re: getting my new graphic tablet cooperating with gimp
Message-ID:  <47B49534.3060207@chuckr.org>
In-Reply-To: <200802140506.52864.markus@FreeBSD.org>
References:  <47AE28EB.7070205@chuckr.org> <20080213180132.511a7fb4.torfinn.ingolfsen@broadpark.no> <47B328A9.7080808@chuckr.org> <200802140506.52864.markus@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Markus Brueffer wrote:
>> I appreciate the extra information.  In fact, I am having one heck of a
>> time trying to figure out exactly how to parse this.  I am reading with the
>> HID1_11 spec on my knee at all times, but I swear, I have never seen such a
>> poorly written document!
> 
> It's not _that_ bad, but it surely lacks several clarifications in some areas 
> and some information on specific topics is scattered across the whole 
> document.

Maybe I'm not used to the style, but reading this reminds me of the first
few times I plowed my way thru the sgml spec, before I finally realized
those guys weren't trying to get anything done, they were trying only to
lay a foundation for a foundation for a way to get things done.  Getting
past that was difficult, and I find specific sections of the usbhid spec
just as difficult.  There is little or no linkage between the sections that
describe features, and the sections that demonstrate how to use those
features.  As one example (which I think I've finally figured out), section
4.2 (Subclass), the subparagraph below that titled ""Subclass Codes" uses
the term (in italics) of bInterfaceSubClass.  It describes one usagfe where
it would be zero (0), but doesn't bother to say  what the other use would
be, nor give any example of what context you'd want to use this statement.

I've written specs myself, but never one that did such a great job of
obfuscation.  I doubt, strongly, that any of you could do as badly (unless
you were going thru perhaps 3 levels of language translation, that would do
it).  Anyhow, that's the reason why I am not yet finished in figuring out
the parsing of my own unit's config dump.

> 
> Best thing to get started is IMHO to get an idea about what reports are and to 
> get the raw report descriptor of a simple device (e.g. a mouse if it's not 
> from a keyboard/mouse combo) and start decoding it by hand. The sources of 
> the libusbhid parser might be of help as well, although it contains several 
> bugs and isn't spec compliant in several cases, but it might get you an idea 
> of what's going on. Furthermore playing with usbhidctl might be of help.
> 
> I have written a completly new fully spec compliant HID parser which is soon 
> ready for public consumption as part of a new libhid. It contains many 
> comments and should be easy to understand. The data representation directly 
> takes the tree-like structure of a decoded report descriptor into account so 
> that it's easy to write drivers that only handle one or more specific 
> application collections. Furthermore physical descriptors are supported and 
> the data handling functions hide the concept of report IDs so that it's less 
> error prone to develop HID drivers (ums(4) e.g. doesn't support reports other 
> than report 0 which is the reason that many of todays mice don't work). The 
> parser itself will hopefully replace our current in-kernel HID parser.
> 

OK, couple more questions: would the state of your new libhid be far enough
along that it might be possible for me to study it?  If it were, could I
get a copy, if I agreed that you are giving me the copy for study only,
that I'm not to release it anywhere myself?

Another thing, is there any  way, beyond my forcing the action in patched
code, to get the uhid driver to claim my device?  I mean, some system
configuration method to force this, like it used to be possible back a long
time ago in the old usbd.conf?  I might be able to figure some things out,
if I could experiment with usbhidctl, if I could use it thru uhid.

>> I am having a terrible time trying to figure out 
>> the actual scope of each statement, which refers to what.  I don't run any
>> piece of Windows stuff here, so many of the pieces of demo software I have
>> found on the web do me no good.
> 
> I didn't find any windows software that really made it easier to understand 
> the spec. It's IMHO easier to directly get your hands dirty and to read the 
> code of an HID parser.

You;'re going to tell me it's easier to read the code than read the spec,
and in the same breath tell me that the spec isn't so badly written?

> 
>> I'm not giving up, I keep on making new discoveries, but if anyone knows of
>> a description of HID that involves some real use of English, I sure would
>> appreciate a pointer to it.
> 
> If you have any specific questions, please drop me a mail.

Look, I'll be honest, I'm kinda embarrassed at the level questions I need
answered, I'm probagbly not going to ask them here on the mail list.  If I
were to start up a usbhid channel on freenode, anyone might come up there
and answer questions?

If not, don't worry, I'm going to keep at this until I di understand it,
I'm rather stubborn.

> 
> Markus

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.4 (FreeBSD)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFHtJU0z62J6PPcoOkRAsT9AJ4v2ORqxbo3KyuzDMtf3jKTWUKn0QCfbPlR
burjy7Hn8MkMVmHJWTQPrq8=
=SAdg
-----END PGP SIGNATURE-----



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?47B49534.3060207>