linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* joydev: support for Saitek PS1000 gamepad
@ 2011-11-22 10:28 Andreas Hübner
  2011-11-22 17:13 ` simon
  0 siblings, 1 reply; 9+ messages in thread
From: Andreas Hübner @ 2011-11-22 10:28 UTC (permalink / raw)
  To: linux-input

[-- Attachment #1: Type: text/plain, Size: 1544 bytes --]

Hello!

I was trying to contact who I think is the maintainer of the joydev
module (vojtech@suze.cz), but had no success. Apologies if this list is
not the right target audience, I would appreciate any hints about who is
currently maintaining the module.
It's also possible, that the issue is not related to joydev module
itself. usb-hid could also be involved.

I'm pasting the contents of the mail I had sent:

---------------------------------------------------------------------------

In the linux kernel documentation you requested information on what
devices this driver currently can't make complete use of.
I have a Saitek PS1000 Gamepad (USB) that has 5 axis and at least 10 buttons,
probably more. (One of the axis is also wired to buttons in the windows
driver.)
The joydev driver does not fully support this device:

Joystick (Jess Technology Co., Ltd. PS1000 Dual AnaloguePad) has 6 axes and 0 buttons. Driver version is 2.1.0.
Testing ... (interrupt to exit)
Axes:  0:     0  1:     0  2:     0  3:     0  4:     0  5:-32767

All the axes work but the sixth does not exist on the device. However,
no button is detected which makes it kind of unusable.

If you need more info or need me to compile, test, debug stuff, just ask.
I also attached the lsusb -vv output.

---------------------------------------------------------------------------

So if anyone has an idea how to deal with the issue, please contact me.
I'm willing to debug this if someone tells me where to dive in or how
the usb input stuff works.


Andreas Hübner

[-- Attachment #2: lsusb.txt --]
[-- Type: text/plain, Size: 1980 bytes --]

Bus 002 Device 002: ID 06a3:0621 Saitek PLC 
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               2.00
  bDeviceClass            0 (Defined at Interface level)
  bDeviceSubClass         0 
  bDeviceProtocol         0 
  bMaxPacketSize0        64
  idVendor           0x06a3 Saitek PLC
  idProduct          0x0621 
  bcdDevice            1.00
  iManufacturer           1 Jess Technology Co., Ltd.
  iProduct                2 PS1000 Dual AnaloguePad
  iSerial                 0 
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength           34
    bNumInterfaces          1
    bConfigurationValue     1
    iConfiguration          0 
    bmAttributes         0x80
      (Bus Powered)
    MaxPower              200mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      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.11
          bCountryCode            0 Not supported
          bNumDescriptors         1
          bDescriptorType        34 Report
          wDescriptorLength     137
         Report Descriptors: 
           ** UNAVAILABLE **
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval              10
Device Status:     0x0000
  (Bus Powered)


^ permalink raw reply	[flat|nested] 9+ messages in thread
* Re: Saitek PS1000 gamepad - HID descriptor wonky
@ 2011-12-11 21:48 Andreas Hübner
  0 siblings, 0 replies; 9+ messages in thread
From: Andreas Hübner @ 2011-12-11 21:48 UTC (permalink / raw)
  To: linux-input

Hi Simon!

Let's continue the discussion on the list. I did made some progress
that requires input from the HID maintainers.

> You have to check the rsize, otherwise you might have problems writing
> outside the size of the original descriptor.

That's exactly what I've been doing, or did I miss something?
In fact, I wanted to be absolutely sure and only mess with the descriptor
when the sizes match.  (*rsize == 137)

> Note a D-Pad might be defined as 'Buttons', a 'D-Pad' or as a 'Hat'. You
> need to check out the values change in the HID stream.

It's defined as a 'Hat' with 8 different directions.

> Send me a copy of the original descriptor and I'll have a look.

Should already be on the list. And I was able to identify the culprit so
no need to bother you.

The problem is the following code in hidinput_configure_usage
(drivers/hid/hid-input.c):

	if (field->flags & HID_MAIN_ITEM_CONSTANT)
		goto ignore;

The buttons and the hat are defined with the constant flag enabled.
Now I might be reading the spec wrong, but I'm not so sure that we can
simply skip constant values.
This is the description of the data/constant flag.

    Indicates whether the item is data or a constant
    value. Data indicates the item is defining report
    fields that contain modifiable device data. Constant
    indicates the item is a static read-only field in a
    report and cannot be modified (written) by the
    host.


Well, I need to patch the descriptor nevertheless because it defines a
non-existing sixth axis. Might as well remove the constant flag on the
buttons and hat. However, other devices might be affected as well, so
I'd like to get some input on how to deal with the situation.


Andreas

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2012-02-22  0:56 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-11-22 10:28 joydev: support for Saitek PS1000 gamepad Andreas Hübner
2011-11-22 17:13 ` simon
2011-11-23  8:43   ` Andreas Hübner
2011-11-23 15:45     ` Saitek PS1000 gamepad - HID descriptor wonky simon
2011-11-24  8:12       ` Andreas Hübner
     [not found]         ` <30cc35606560d634477e2a288bdf6db3.squirrel@host171.canaca.com>
     [not found]           ` <20111208123424.GA1298@tapura>
     [not found]             ` <a8799dfc5b69fd158ec54b099d231961.squirrel@host171.canaca.com>
     [not found]               ` <20111210131702.GA5620@tapura>
     [not found]                 ` <d13c53ac7f835eaff26cfc2aae0fac6c.squirrel@mungewell.org>
     [not found]                   ` <20111211214010.GA14046@tapura>
2011-12-12 18:49                     ` simon
2011-12-13 19:09                       ` Andreas Hübner
2012-02-22  0:50                       ` Andreas Hübner
  -- strict thread matches above, loose matches on Subject: below --
2011-12-11 21:48 Andreas Hübner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).