On Sat, Feb 11, 2012 at 6:23 PM, Adam Nielsen <a.niel...@shikadi.net> wrote:
> Hi Chris,
>
> Thanks for the quick response!
>
>
>> Hi, I googled this model and I see its a stand alone screen with built
>> in Wacom digitizer.
>
>
> Yes that's correct.  For the record, it also has a built in USB hub which
> works fine:
>
> Bus 001 Device 021: ID 056a:003b Wacom Co., Ltd
> Device Descriptor:
>  ...
>  bDeviceClass            9 Hub
>  bDeviceSubClass         0 Unused
>  bDeviceProtocol         1 Single TT
>  bMaxPacketSize0        64
>  idVendor           0x056a Wacom Co., Ltd
>  idProduct          0x003b
>  bcdDevice            7.02
>  iManufacturer          10 WACOM
>  iProduct               11 DTI-520 HUB
>  ...
>
> The device also has a number of pushbuttons on its face - five unlabelled
> ones across the top (with a space to insert your own paper label), and six
> along the bottom (L, R, up, down, and two Ctrl.  One Ctrl suggests it shifts
> the up/down keys into zoom in/out.)

Interesting.  I've never heard they did USB hubs before.

For the buttons, none of the wacom drivers currently support anything
quite like this.  I see in the USB report that the device has 2
interfaces.  Normally, we only see this on touchscreens where the
second interface reports touch events.

In your case, the second interface seems to define those buttons.  I
see a set of 5 buttons clearly labeled and then some more bits that
aren't obvious how to decode.

You'd have to write a custom decoder for those if you want to process
them.  In mean time, we may or may not need to detect that interface
and disable it (if it crashes for example).


>
> Here is the output:
>
> Bus 001 Device 022: ID 056a:003a Wacom Co., Ltd
> Device Descriptor:

...

This first section defines a mouse device.  Its default behaviour or
Wacom devices.  If it wasn't for the fact that all Wacom devices are
blacklisted from the hid-core, this screen would most likely already
be working but as an odd mouse (relative mode).

>      iInterface              0
>        HID Device Descriptor:
>          bLength                 9
>          bDescriptorType        33
>          bcdHID               1.10
>          bCountryCode            0 Not supported
>          bNumDescriptors         1
>          bDescriptorType        34 Report
>          wDescriptorLength     110
>          Report Descriptor: (length is 110)
>            Item(Global): Usage Page, data= [ 0x01 ] 1
>                            Generic Desktop Controls
>            Item(Local ): Usage, data= [ 0x02 ] 2
>                            Mouse
>            Item(Main  ): Collection, data= [ 0x01 ] 1
>                            Application
>            Item(Global): Report ID, data= [ 0x01 ] 1
>            Item(Local ): Usage, data= [ 0x01 ] 1
>                            Pointer
>            Item(Main  ): Collection, data= [ 0x00 ] 0
>                            Physical
>            Item(Global): Usage Page, data= [ 0x09 ] 9
>                            Buttons
>            Item(Local ): Usage Minimum, data= [ 0x01 ] 1
>                            Button 1 (Primary)
>            Item(Local ): Usage Maximum, data= [ 0x03 ] 3
>                            Button 3 (Tertiary)
>            Item(Global): Logical Minimum, data= [ 0x00 ] 0
>            Item(Global): Logical Maximum, data= [ 0x01 ] 1
>            Item(Global): Report Count, data= [ 0x03 ] 3
>            Item(Global): Report Size, data= [ 0x01 ] 1
>            Item(Main  ): Input, data= [ 0x02 ] 2
>                            Data Variable Absolute No_Wrap Linear
>                            Preferred_State No_Null_Position Non_Volatile
> Bitfield
>            Item(Global): Report Count, data= [ 0x05 ] 5
>            Item(Main  ): Input, data= [ 0x03 ] 3
>                            Constant Variable Absolute No_Wrap Linear
>                            Preferred_State No_Null_Position Non_Volatile
> Bitfield
>            Item(Global): Usage Page, data= [ 0x01 ] 1
>                            Generic Desktop Controls
>            Item(Local ): Usage, data= [ 0x30 ] 48
>                            Direction-X
>            Item(Local ): Usage, data= [ 0x31 ] 49
>                            Direction-Y
>            Item(Global): Logical Minimum, data= [ 0x81 ] 129
>            Item(Global): Logical Maximum, data= [ 0x7f ] 127
>            Item(Global): Report Size, data= [ 0x08 ] 8
>            Item(Global): Report Count, data= [ 0x02 ] 2
>            Item(Main  ): Input, data= [ 0x06 ] 6
>                            Data Variable Relative No_Wrap Linear
>                            Preferred_State No_Null_Position Non_Volatile
> Bitfield
>            Item(Main  ): End Collection, data=none
>            Item(Main  ): End Collection, data=none

This second defines the report id #2 that contains pen data:

>            Item(Global): Usage Page, data= [ 0x0d ] 13
>                            Digitizer
>            Item(Local ): Usage, data= [ 0x01 ] 1
>                            Digitizer
>            Item(Main  ): Collection, data= [ 0x01 ] 1
>                            Application
>            Item(Global): Report ID, data= [ 0x02 ] 2
>            Item(Main  ): Collection, data= [ 0x00 ] 0
>                            Physical
>            Item(Global): Usage Page, data= [ 0x00 0xff ] 65280
>                            (null)
>            Item(Local ): Usage, data= [ 0x01 ] 1
>                            (null)
>            Item(Global): Logical Minimum, data= [ 0x00 ] 0
>            Item(Global): Logical Maximum, data= [ 0xff 0x00 ] 255
>            Item(Global): Report Size, data= [ 0x08 ] 8
>            Item(Global): Report Count, data= [ 0x07 ] 7

This says the packet size is 7 8-bit bytes.  That maps to
WACOM_PKGLEN_PENPRTN.  I've seen occasionally where they do not
include in this count the 1st byte in packet which is ID.  So the
packet len could either be 7 or 8.  I'd try 8 first which maps to
WACOM_PKGLEN_GRAPHIRE.


>            Item(Main  ): Input, data= [ 0x02 ] 2
>                            Data Variable Absolute No_Wrap Linear
>                            Preferred_State No_Null_Position Non_Volatile
> Bitfield
>            Item(Main  ): End Collection, data=none

Thats all on stylus.  Sometimes they include extra info like max X/Y
values and resolution but doesn't look like it in this report.  You'll
have to figure those out at some point and fill them in structures.

[... delete some less interesting stuff ... ]


This is interface with buttons.

>      Endpoint Descriptor:
>        bLength                 7
>        bDescriptorType         5
>        bEndpointAddress     0x81  EP 1 IN
>        bmAttributes            3
>          Transfer Type            Interrupt
>          Synch Type               None
>          Usage Type               Data
>        wMaxPacketSize     0x0008  1x 8 bytes
>        bInterval              10
>    Interface Descriptor:
>      bLength                 9
>      bDescriptorType         4
>      bInterfaceNumber        1
>      bAlternateSetting       0
>      bNumEndpoints           1
>      bInterfaceClass         3 Human Interface Device
>      bInterfaceSubClass      0 No Subclass
>      bInterfaceProtocol      0 None
>      iInterface              0
>        HID Device Descriptor:
>          bLength                 9
>          bDescriptorType        33
>          bcdHID               1.10
>          bCountryCode            0 Not supported
>          bNumDescriptors         1
>          bDescriptorType        34 Report
>          wDescriptorLength      41
>          Report Descriptor: (length is 41)
>            Item(Global): Usage Page, data= [ 0x01 ] 1
>                            Generic Desktop Controls
>            Item(Local ): Usage, data= [ 0x80 ] 128
>                            System Control
>            Item(Main  ): Collection, data= [ 0x02 ] 2
>                            Logical
>            Item(Global): Report ID, data= [ 0x04 ] 4
>            Item(Global): Usage Page, data= [ 0x09 ] 9
>                            Buttons
>            Item(Local ): Usage Minimum, data= [ 0x01 ] 1
>                            Button 1 (Primary)
>            Item(Local ): Usage Maximum, data= [ 0x05 ] 5
>                            Button 5
>            Item(Global): Logical Minimum, data= [ 0x00 ] 0
>            Item(Global): Logical Maximum, data= [ 0x01 ] 1
>            Item(Global): Report Count, data= [ 0x05 ] 5
>            Item(Global): Report Size, data= [ 0x01 ] 1

This says the 1st 5 bits in packet map to buttons and have on/off single values.

>            Item(Main  ): Input, data= [ 0x02 ] 2
>                            Data Variable Absolute No_Wrap Linear
>                            Preferred_State No_Null_Position Non_Volatile
> Bitfield
>            Item(Global): Report Count, data= [ 0x03 ] 3
>            Item(Main  ): Input, data= [ 0x01 ] 1
>                            Constant Array Absolute No_Wrap Linear
>                            Preferred_State No_Null_Position Non_Volatile
> Bitfield
>            Item(Local ): Usage Minimum, data= [ 0x06 ] 6
>                            (null)
>            Item(Local ): Usage Maximum, data= [ 0x0a ] 10
>                            (null)

Above has values between 6 and 10 so are more than 1 bit.  Not sure
what it is but there are 3 of them.  And then 5 of something else and
3 of another thing follows.

>            Item(Global): Report Count, data= [ 0x05 ] 5
>            Item(Main  ): Input, data= [ 0x02 ] 2
>                            Data Variable Absolute No_Wrap Linear
>                            Preferred_State No_Null_Position Non_Volatile
> Bitfield
>            Item(Global): Report Count, data= [ 0x03 ] 3
>            Item(Main  ): Input, data= [ 0x01 ] 1
>                            Constant Array Absolute No_Wrap Linear
>                            Preferred_State No_Null_Position Non_Volatile
> Bitfield
>            Item(Main  ): End Collection, data=none
>      Endpoint Descriptor:
>        bLength                 7
>        bDescriptorType         5
>        bEndpointAddress     0x82  EP 2 IN
>        bmAttributes            3
>          Transfer Type            Interrupt
>          Synch Type               None
>          Usage Type               Data
>        wMaxPacketSize     0x0003  1x 3 bytes
>        bInterval              10
> Device Status:     0x0000
>  (Bus Powered)
>
>
>> Find the snippet related to Wacom and send it to list.  In that output
>> will often be information on packet sizes.  We can use this
>> information to know what value to set for WACOM_PKGLEN_* without
>> guessing.  Worst case, set that field to 32 for right now and move to
>> next step.
>
>
> Will do - I wasn't sure if the packet length had to match exactly or whether
> it was a maximum limit.  Let me know which part indicates the packet length.

Its kinda a max packet length.  With most peoples USB hubs, its OK to
leave it large.  Some USB hubs will return an error if a packet is
received with less bytes then requested and on those machines you have
to get this value exactly right.

>
>
>> The part that has "PL" above is what tells packet format and there are
>> lots of different packet formats.  Hopefully, this is not a totally
>> new format.
>
>
> I do get some movement roughly corresponding to the stylus with PL and PTU
> so it doesn't seem to be a completely different protocol.

All the stylus formats are usually pretty similar but it takes just 1
bit in a different location and it will act totally strange.

>
>
>> Since PL and PTU didn't work for you, I'd move to some of the other
>> similar HW types (screens with digitizers).  Cintiq's are most popular
>> and possible values for those are WACOM_24HD, CINTIQ, WACOM_BEE, and
>> WACOM_21UX2.
>
>
> Ah ok, I'll try these.  I tried a few others (like INTUOS) which didn't work
> but again I was just poking around in the dark.  Hopefully these will be a
> closer match.
>
>
>> Probably, your screen is closer to the DTU-* and DTF-* models that are
>> already supported.  DTU and PTU are valid values for it so I'd
>> probably try DTU next.
>
>
> I didn't try DTU because in wacom_setup_input_capabilities() in the kernel
> driver it seems to be handled the same as PL.  Is it treated differently
> elsewhere?

Yes, there is a wacom_dtu_irq() and the stylus bits are every so
slightly different.

>
>
>> And the last option to try is Tablet PC driver.  They use TABLETPC.
>>
>> If no luck with any of those, we'd have to start logging some USB
>> packets (using kernels /sys/kernel/debug/usb/usbmon interface) and see
>> if we can't figure out the packet format and add a new DTI driver.
>
>
> Sounds good!  I'll try out the other packet formats and see if I have any
> success.
>
> Thanks again,
> Adam.
>

Good luck.  Hope you find one thats same.  Its always much easier than
writing yet another packet parsing routing.

Chris

------------------------------------------------------------------------------
Virtualization & Cloud Management Using Capacity Planning
Cloud computing makes use of virtualization - but cloud computing 
also focuses on allowing computing to be delivered as a service.
http://www.accelacomm.com/jaw/sfnl/114/51521223/
_______________________________________________
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel

Reply via email to