Two HID joysticks from one device

General discussions about V-USB, our firmware-only implementation of a low speed USB device on Atmel's AVR microcontrollers
mojo
Rank 1
Rank 1
Posts: 39
Joined: Tue Mar 04, 2008 3:57 pm

Two HID joysticks from one device

Post by mojo » Mon Apr 12, 2010 8:37 pm

I am trying to create a device that appears to the computer as two separate joysticks. I have it working in Windows but not in Linux.

Windows can see two separate joysticks in the game controller applet, but Linux only sees one in /dev/input. I know Linux can show two as I have a dual Playstation to USB converter which appears as two separate devices in /dev/input.

I tried cloning the converter's HID report descriptor but it didn't seem to help. I also tried cloning as much of it's USB device descriptor as possible but that didn't make it work either. I am at a loss to explain why it doesn't work in Linux because from what I can tell there is nothing obviously different about the converter and my hardware.

For reference, my HID report (using stock V-USB descriptors for everything else):

Code: Select all

PROGMEM char usbHidReportDescriptor[90] = {
   /* Controller and report_id 1 */
    0x05, 0x01,         // USAGE_PAGE (Generic Desktop)
    0x09, 0x04,         // USAGE (Joystick)
    0xa1, 0x01,         //   COLLECTION (Application)
   0x85, 0x01,         //         REPORT_ID (1)
    0xa1, 0x02,         //      COLLECTION (Physical)
    0x09, 0x01,         //      USAGE (Pointer)
   0x09, 0x30,         //         USAGE (X)
    0x09, 0x31,         //         USAGE (Y)
    0x15, 0x00,         //         LOGICAL_MINIMUM (0)
    0x26, 0xff, 0x00,   //         LOGICAL_MAXIMUM (255)
    0x75, 0x08,         //         REPORT_SIZE (8)
    0x95, 0x02,         //         REPORT_COUNT (2)
    0x81, 0x02,         //         INPUT (Data,Var,Abs)

    0x05, 0x09,         //         USAGE_PAGE (Button)
    0x19, 1,         //         USAGE_MINIMUM (Button 1)
    0x29, 8,         //         USAGE_MAXIMUM (Button 8)
    0x15, 0x00,         //         LOGICAL_MINIMUM (0)
    0x25, 0x01,         //         LOGICAL_MAXIMUM (1)
    0x75, 1,         //          REPORT_SIZE (1)
    0x95, 8,         //         REPORT_COUNT (8)
    0x81, 0x02,         //         INPUT (Data,Var,Abs)
   0xc0,            //      END_COLLECTION
    0xc0,            // END_COLLECTION

   /* Controller and report_id 2 */
    0x05, 0x01,         // USAGE_PAGE (Generic Desktop)
    0x09, 0x04,         // USAGE (Joystick)
    0xa1, 0x01,         //   COLLECTION (Application)
   0x85, 0x02,         //         REPORT_ID (2)
    0xa1, 0x02,         //      COLLECTION (Physical)
    0x09, 0x01,         //      USAGE (Pointer)
   0x09, 0x30,         //         USAGE (X)
    0x09, 0x31,         //         USAGE (Y)
    0x15, 0x00,         //         LOGICAL_MINIMUM (0)
    0x26, 0xff, 0x00,   //         LOGICAL_MAXIMUM (255)
    0x75, 0x08,         //         REPORT_SIZE (8)
    0x95, 0x02,         //         REPORT_COUNT (2)
    0x81, 0x02,         //         INPUT (Data,Var,Abs)
    0x05, 0x09,         //         USAGE_PAGE (Button)
    0x19, 1,         //         USAGE_MINIMUM (Button 1)
    0x29, 8,         //         USAGE_MAXIMUM (Button 8)
    0x15, 0x00,         //         LOGICAL_MINIMUM (0)
    0x25, 0x01,         //         LOGICAL_MAXIMUM (1)
    0x75, 1,         //          REPORT_SIZE (1)
    0x95, 8,         //         REPORT_COUNT (8)
    0x81, 0x02,         //         INPUT (Data,Var,Abs)
   0xc0,            //      END_COLLECTION
    0xc0,            // END_COLLECTION
};


The output of lsusb for my device:

Code: Select all

Bus 002 Device 004: ID 8282:2101  
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               1.10
  bDeviceClass            0 (Defined at Interface level)
  bDeviceSubClass         0
  bDeviceProtocol         0
  bMaxPacketSize0         8
  idVendor           0x8282
  idProduct          0x2101
  bcdDevice            4.01
  iManufacturer           1 MoJo
  iProduct                2 Retro Adapter
  iSerial                 0
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength           34
    bNumInterfaces          1
    bConfigurationValue     1
    iConfiguration          0
    bmAttributes         0x80
      (Bus Powered)
    MaxPower              250mA
    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.01
          bCountryCode            0 Not supported
          bNumDescriptors         1
          bDescriptorType        34 Report
          wDescriptorLength      90
          Report Descriptor: (length is 90)
            Item(Global): Usage Page, data= [ 0x01 ] 1
                            Generic Desktop Controls
            Item(Local ): Usage, data= [ 0x04 ] 4
                            Joystick
            Item(Main  ): Collection, data= [ 0x01 ] 1
                            Application
            Item(Local ): Usage, data= [ 0x01 ] 1
                            Pointer
            Item(Main  ): Collection, data= [ 0x00 ] 0
                            Physical
            Item(Global): Report ID, data= [ 0x01 ] 1
            Item(Local ): Usage, data= [ 0x30 ] 48
                            Direction-X
            Item(Local ): Usage, data= [ 0x31 ] 49
                            Direction-Y
            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= [ 0x02 ] 2
            Item(Main  ): Input, data= [ 0x02 ] 2
                            Data Variable Absolute No_Wrap Linear
                            Preferred_State No_Null_Position Non_Volatile Bitfield
            Item(Global): Usage Page, data= [ 0x09 ] 9
                            Buttons
            Item(Local ): Usage Minimum, data= [ 0x01 ] 1
                            Button 1 (Primary)
            Item(Local ): Usage Maximum, data= [ 0x08 ] 8
                            (null)
            Item(Global): Logical Minimum, data= [ 0x00 ] 0
            Item(Global): Logical Maximum, data= [ 0x01 ] 1
            Item(Global): Report Size, data= [ 0x01 ] 1
            Item(Global): Report Count, data= [ 0x08 ] 8
            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
            Item(Main  ): End Collection, data=none
            Item(Global): Usage Page, data= [ 0x01 ] 1
                            Generic Desktop Controls
            Item(Local ): Usage, data= [ 0x04 ] 4
                            Joystick
            Item(Main  ): Collection, data= [ 0x01 ] 1
                            Application
            Item(Local ): Usage, data= [ 0x01 ] 1
                            Pointer
            Item(Main  ): Collection, data= [ 0x00 ] 0
                            Physical
            Item(Global): Report ID, data= [ 0x02 ] 2
            Item(Local ): Usage, data= [ 0x30 ] 48
                            Direction-X
            Item(Local ): Usage, data= [ 0x31 ] 49
                            Direction-Y
            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= [ 0x02 ] 2
            Item(Main  ): Input, data= [ 0x02 ] 2
                            Data Variable Absolute No_Wrap Linear
                            Preferred_State No_Null_Position Non_Volatile Bitfield
            Item(Global): Usage Page, data= [ 0x09 ] 9
                            Buttons
            Item(Local ): Usage Minimum, data= [ 0x01 ] 1
                            Button 1 (Primary)
            Item(Local ): Usage Maximum, data= [ 0x08 ] 8
                            (null)
            Item(Global): Logical Minimum, data= [ 0x00 ] 0
            Item(Global): Logical Maximum, data= [ 0x01 ] 1
            Item(Global): Report Size, data= [ 0x01 ] 1
            Item(Global): Report Count, data= [ 0x08 ] 8
            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
            Item(Main  ): End Collection, data=none
      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
Device Status:     0x0000
  (Bus Powered)


And the output of lsusb for the dual PSX converter (HID report is different, I know, I have simplified it to the above to try and remove as many variables as possible):

Code: Select all

Bus 002 Device 003: ID 0810:0001 Personal Communication Systems, Inc. 
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               1.00
  bDeviceClass            0 (Defined at Interface level)
  bDeviceSubClass         0
  bDeviceProtocol         0
  bMaxPacketSize0         8
  idVendor           0x0810 Personal Communication Systems, Inc.
  idProduct          0x0001
  bcdDevice            1.06
  iManufacturer           0
  iProduct                2 Twin USB Joystick
  iSerial                 0
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength           34
    bNumInterfaces          1
    bConfigurationValue     1
    iConfiguration          0
    bmAttributes         0x80
      (Bus Powered)
    MaxPower              500mA
    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.10
          bCountryCode           33 US
          bNumDescriptors         1
          bDescriptorType        34 Report
          wDescriptorLength     202
          Report Descriptor: (length is 202)
            Item(Global): Usage Page, data= [ 0x01 ] 1
                            Generic Desktop Controls
            Item(Local ): Usage, data= [ 0x04 ] 4
                            Joystick
            Item(Main  ): Collection, data= [ 0x01 ] 1
                            Application
            Item(Global): Report ID, data= [ 0x01 ] 1
            Item(Main  ): Collection, data= [ 0x02 ] 2
                            Logical
            Item(Global): Report Size, data= [ 0x08 ] 8
            Item(Global): Report Count, data= [ 0x04 ] 4
            Item(Global): Logical Minimum, data= [ 0x00 ] 0
            Item(Global): Logical Maximum, data= [ 0xff 0x00 ] 255
            Item(Global): Physical Minimum, data= [ 0x00 ] 0
            Item(Global): Physical Maximum, data= [ 0xff 0x00 ] 255
            Item(Local ): Usage, data= [ 0x32 ] 50
                            Direction-Z
            Item(Local ): Usage, data= [ 0x35 ] 53
                            Rotate-Z
            Item(Local ): Usage, data= [ 0x30 ] 48
                            Direction-X
            Item(Local ): Usage, data= [ 0x31 ] 49
                            Direction-Y
            Item(Main  ): Input, data= [ 0x02 ] 2
                            Data Variable Absolute No_Wrap Linear
                            Preferred_State No_Null_Position Non_Volatile Bitfield
            Item(Global): Report Size, data= [ 0x04 ] 4
            Item(Global): Report Count, data= [ 0x01 ] 1
            Item(Global): Logical Maximum, data= [ 0x07 ] 7
            Item(Global): Physical Maximum, data= [ 0x3b 0x01 ] 315
            Item(Global): Unit, data= [ 0x14 ] 20
                            System: English Rotation, Unit: Degrees
            Item(Local ): Usage, data= [ 0x39 ] 57
                            Hat Switch
            Item(Main  ): Input, data= [ 0x42 ] 66
                            Data Variable Absolute No_Wrap Linear
                            Preferred_State Null_State Non_Volatile Bitfield
            Item(Global): Unit, data= [ 0x00 ] 0
                            System: None, Unit: (None)
            Item(Global): Report Size, data= [ 0x01 ] 1
            Item(Global): Report Count, data= [ 0x0c ] 12
            Item(Global): Logical Maximum, data= [ 0x01 ] 1
            Item(Global): Physical Maximum, data= [ 0x01 ] 1
            Item(Global): Usage Page, data= [ 0x09 ] 9
                            Buttons
            Item(Local ): Usage Minimum, data= [ 0x01 ] 1
                            Button 1 (Primary)
            Item(Local ): Usage Maximum, data= [ 0x0c ] 12
                            (null)
            Item(Main  ): Input, data= [ 0x02 ] 2
                            Data Variable Absolute No_Wrap Linear
                            Preferred_State No_Null_Position Non_Volatile Bitfield
            Item(Global): Usage Page, data= [ 0x00 0xff ] 65280
                            (null)
            Item(Global): Report Size, data= [ 0x01 ] 1
            Item(Global): Report Count, data= [ 0x08 ] 8
            Item(Global): Logical Maximum, data= [ 0x01 ] 1
            Item(Global): Physical Maximum, data= [ 0x01 ] 1
            Item(Local ): Usage, data= [ 0x01 ] 1
                            (null)
            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
            Item(Main  ): Collection, data= [ 0x02 ] 2
                            Logical
            Item(Global): Report Size, data= [ 0x08 ] 8
            Item(Global): Report Count, data= [ 0x04 ] 4
            Item(Global): Physical Maximum, data= [ 0xff 0x00 ] 255
            Item(Global): Logical Maximum, data= [ 0xff 0x00 ] 255
            Item(Local ): Usage, data= [ 0x02 ] 2
                            (null)
            Item(Main  ): Output, data= [ 0x02 ] 2
                            Data Variable Absolute No_Wrap Linear
                            Preferred_State No_Null_Position Non_Volatile Bitfield
            Item(Main  ): End Collection, data=none
            Item(Main  ): End Collection, data=none
            Item(Global): Usage Page, data= [ 0x01 ] 1
                            Generic Desktop Controls
            Item(Local ): Usage, data= [ 0x04 ] 4
                            Joystick
            Item(Main  ): Collection, data= [ 0x01 ] 1
                            Application
            Item(Global): Report ID, data= [ 0x02 ] 2
            Item(Main  ): Collection, data= [ 0x02 ] 2
                            Logical
            Item(Global): Report Size, data= [ 0x08 ] 8
            Item(Global): Report Count, data= [ 0x04 ] 4
            Item(Global): Logical Minimum, data= [ 0x00 ] 0
            Item(Global): Logical Maximum, data= [ 0xff 0x00 ] 255
            Item(Global): Physical Minimum, data= [ 0x00 ] 0
            Item(Global): Physical Maximum, data= [ 0xff 0x00 ] 255
            Item(Local ): Usage, data= [ 0x32 ] 50
                            Direction-Z
            Item(Local ): Usage, data= [ 0x35 ] 53
                            Rotate-Z
            Item(Local ): Usage, data= [ 0x30 ] 48
                            Direction-X
            Item(Local ): Usage, data= [ 0x31 ] 49
                            Direction-Y
            Item(Main  ): Input, data= [ 0x02 ] 2
                            Data Variable Absolute No_Wrap Linear
                            Preferred_State No_Null_Position Non_Volatile Bitfield
            Item(Global): Report Size, data= [ 0x04 ] 4
            Item(Global): Report Count, data= [ 0x01 ] 1
            Item(Global): Logical Maximum, data= [ 0x07 ] 7
            Item(Global): Physical Maximum, data= [ 0x3b 0x01 ] 315
            Item(Global): Unit, data= [ 0x14 ] 20
                            System: English Rotation, Unit: Degrees
            Item(Local ): Usage, data= [ 0x39 ] 57
                            Hat Switch
            Item(Main  ): Input, data= [ 0x42 ] 66
                            Data Variable Absolute No_Wrap Linear
                            Preferred_State Null_State Non_Volatile Bitfield
            Item(Global): Unit, data= [ 0x00 ] 0
                            System: None, Unit: (None)
            Item(Global): Report Size, data= [ 0x01 ] 1
            Item(Global): Report Count, data= [ 0x0c ] 12
            Item(Global): Logical Maximum, data= [ 0x01 ] 1
            Item(Global): Physical Maximum, data= [ 0x01 ] 1
            Item(Global): Usage Page, data= [ 0x09 ] 9
                            Buttons
            Item(Local ): Usage Minimum, data= [ 0x01 ] 1
                            Button 1 (Primary)
            Item(Local ): Usage Maximum, data= [ 0x0c ] 12
                            (null)
            Item(Main  ): Input, data= [ 0x02 ] 2
                            Data Variable Absolute No_Wrap Linear
                            Preferred_State No_Null_Position Non_Volatile Bitfield
            Item(Global): Usage Page, data= [ 0x00 0xff ] 65280
                            (null)
            Item(Global): Report Size, data= [ 0x01 ] 1
            Item(Global): Report Count, data= [ 0x08 ] 8
            Item(Global): Logical Maximum, data= [ 0x01 ] 1
            Item(Global): Physical Maximum, data= [ 0x01 ] 1
            Item(Local ): Usage, data= [ 0x01 ] 1
                            (null)
            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
            Item(Main  ): Collection, data= [ 0x02 ] 2
                            Logical
            Item(Global): Report Size, data= [ 0x08 ] 8
            Item(Global): Report Count, data= [ 0x04 ] 4
            Item(Global): Physical Maximum, data= [ 0xff 0x00 ] 255
            Item(Global): Logical Maximum, data= [ 0xff 0x00 ] 255
            Item(Local ): Usage, data= [ 0x02 ] 2
                            (null)
            Item(Main  ): Output, data= [ 0x02 ] 2
                            Data Variable Absolute No_Wrap Linear
                            Preferred_State No_Null_Position Non_Volatile Bitfield
            Item(Main  ): End Collection, data=none
            Item(Main  ): End Collection, data=none
      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
Device Status:     0x0000
  (Bus Powered)


I see there are a couple of other threads along similar lines but none seem to have reached any kind of useful resolution or mention Linux support. As I say, Windows is fine.

Any help would be much appreciated.

mojo
Rank 1
Rank 1
Posts: 39
Joined: Tue Mar 04, 2008 3:57 pm

Re: Two HID joysticks from one device

Post by mojo » Sat Apr 17, 2010 2:33 am

No-one?

ulao
Rank 4
Rank 4
Posts: 481
Joined: Mon Aug 25, 2008 8:45 pm

Re: Two HID joysticks from one device

Post by ulao » Sat Apr 17, 2010 3:11 am

Its been a known issue for far too long. Most people just except it and look no deeper ;( I have never heard a good reason for it not working in linux. Have you talked to Ralf? I know he is aware of it and also a big linux buff. He may have researched it with the v-usb team a ways back. I'm fairly confident you wont find the solution here. I personally always though it was a linux limitation but you say you saw a working example? Was it a 2.0 implementation or 1.1/1.0?

mojo
Rank 1
Rank 1
Posts: 39
Joined: Tue Mar 04, 2008 3:57 pm

Re: Two HID joysticks from one device

Post by mojo » Sat Apr 17, 2010 10:26 pm

I tried to contact Ralf but his email address is bouncing. I can't see anything he does differently in his code anyway. As a test I tried copying his data (HID report, USB descriptors etc.) and it didn't work. Maybe if I find the time I will build his hardware but it doesn't seem worth it at the moment.

I have an AT90USBKey and plan to try out the HID descriptors with it. That should at least prove if it's an issue with V-USB or the code. I have to assume for the moment that it's V-USB because even Ralf's code doesn't work.

ulao
Rank 4
Rank 4
Posts: 481
Joined: Mon Aug 25, 2008 8:45 pm

Re: Two HID joysticks from one device

Post by ulao » Sun Apr 18, 2010 12:36 am

I tried to contact Ralf but his email address is bouncing. I can't see anything he does differently in his code anyway.
I was not suggesting he did it, but that he may know why it's not possible with v-usb. I think I have another email address for him I'll check. I'm 99% sure its a v-usb thing.

mojo
Rank 1
Rank 1
Posts: 39
Joined: Tue Mar 04, 2008 3:57 pm

Re: Two HID joysticks from one device

Post by mojo » Sun Apr 18, 2010 12:42 am

Ah, okay, thanks for the clarification. It's interesting that we have both come to the same conclusion.

Still, I would like to know what the problem is. My design is fixed now with an ATmega168 so I can't stop using V-USB.

ulao
Rank 4
Rank 4
Posts: 481
Joined: Mon Aug 25, 2008 8:45 pm

Re: Two HID joysticks from one device

Post by ulao » Sun Apr 18, 2010 1:43 am

Then again we have a similar issue. I'm stuck withv-usb and can not figure out how to fully emulate an xbox controller. Guessing its do to the 1.0 limitations but I have not gave up yet.

viewtopic.php?f=8&t=2152

If I here back from Ralf I will let you know.

mojo
Rank 1
Rank 1
Posts: 39
Joined: Tue Mar 04, 2008 3:57 pm

Re: Two HID joysticks from one device

Post by mojo » Sun Apr 18, 2010 2:06 pm

Well the composite devices I have checked all report back USB version 1.1 so I don't think it is a problem with the protocol as such. It has to be something about the way V-USB works.

I'm tempted to get in touch with the Linux USB stack guys and see if we can find a solution. It should be possible to write a patch to support V-USB devices by VID/PID. Unfortunately that won't help you with your XBOX controller emulator. I think you will have to move to a USB AVR for that. I can't because I have units out in the field but it seems that you are still at the design stage.

The lower end USB AVRs are available for about €5 now. Only in TQFP format which is a bit of a pain. They are pretty good spec though, with even the basic ones having 64k flash.

ulao
Rank 4
Rank 4
Posts: 481
Joined: Mon Aug 25, 2008 8:45 pm

Re: Two HID joysticks from one device

Post by ulao » Sun Apr 18, 2010 4:20 pm

I do realize moving a full avr usb based device woudl achieve my goal. But where is the fun in that? Really though, ditching the 88 style chip woudl through out my entire design. I'd rather ditch the xbox idea yet I seem to have this knack to make things work that should not.

Definitely let us know who your endeavors go, would be a nice have for the linux community.

mojo
Rank 1
Rank 1
Posts: 39
Joined: Tue Mar 04, 2008 3:57 pm

Re: Two HID joysticks from one device

Post by mojo » Sun Apr 18, 2010 6:19 pm

Ah, I see what you mean.

I'd just like to point out at this stage that I'm not trying to run V-USB down or anything. It's an amazing bit of kit and seems very robust and reliable in general use. You can't beat being able to use USB on a <€1 microcontroller.

ulao
Rank 4
Rank 4
Posts: 481
Joined: Mon Aug 25, 2008 8:45 pm

Re: Two HID joysticks from one device

Post by ulao » Sun Apr 18, 2010 11:04 pm

I'd like to also make that comment, v-usb is simple an amazing development. If I ever had gripe it would be lack of definitive answers. I'd like to see some sticky posts, or attempts to answer some of the question that dead end. I do understand its free ware and certainly appreciate that. However sometimes is can be a kicker if you can't get a solid response from the author.For example, "Two HID joysticks from one device" is one of them. I do applaud the hard work.

mojo
Rank 1
Rank 1
Posts: 39
Joined: Tue Mar 04, 2008 3:57 pm

Re: Two HID joysticks from one device

Post by mojo » Tue Apr 20, 2010 1:48 am

I noticed one thing which may be of interest. V-USB reports USB version 0x10, 0x01. Most USB 1.1 devices seem to go with 0x01, 0x01. I will send a test firmware to my Linux tester to see if it makes any difference.

Oh, and BTW, Windows gets confused if you switch HID descriptor too much. You can go from joystick to multiple joysticks or joystick to different joystick, but not joystick to mouse. I had to change the PID to make it detect a mouse after the device had already enumerated as a joystick.

Grendel
Rank 4
Rank 4
Posts: 167
Joined: Sat Dec 16, 2006 9:53 pm
Location: Oregon, USA
Contact:

Re: Two HID joysticks from one device

Post by Grendel » Tue Apr 20, 2010 2:41 am

Instead of having two reports in one report descriptor you could set up a 2nd interface using endpoint 3 (optional EP in V-USB). Have one stick on EP 1, the other on on 3. This is from the top of my head (getting a bit rusty here ;)), you'll have to research the specifics.
Last edited by Grendel on Tue Apr 20, 2010 9:52 pm, edited 1 time in total.

ulao
Rank 4
Rank 4
Posts: 481
Joined: Mon Aug 25, 2008 8:45 pm

Re: Two HID joysticks from one device

Post by ulao » Tue Apr 20, 2010 2:44 am

I noticed one thing which may be of interest. V-USB reports USB version 0x10, 0x01. Most USB 1.1 devices seem to go with 0x01, 0x01. I will send a test firmware to my Linux tester to see if it makes any difference.

If you look a few posts down you will see that was already answered.
viewtopic.php?f=8&t=4146

Grendel, I believe the goal is to achieve two devices to show up. This is the acceptable work around others have done and in fact its what Ralh did on his page.

Grendel
Rank 4
Rank 4
Posts: 167
Joined: Sat Dec 16, 2006 9:53 pm
Location: Oregon, USA
Contact:

Re: Two HID joysticks from one device

Post by Grendel » Tue Apr 20, 2010 9:47 pm

ulao wrote:Grendel, I believe the goal is to achieve two devices to show up. This is the acceptable work around others have done and in fact its what Ralh did on his page.

Yes and no. The goal is to have two joysticks to show up. Using a single report descriptor w/ two reports seems to work w/ Windows (and it should) but not Linux. I just pointed out an alternative way to have two joysticks in one device.

Edited my post above for clarity.

Post Reply