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

Re: Two HID joysticks from one device

Post by mojo » Tue Apr 20, 2010 10:29 pm

Okay, so just for clarity, using two endpoints works and I should try implementing it?

Oh, and I looked on Ralph's site but couldn't see where he did it that way.

-- EDIT --

I tried it and could not get it to work. To further complicate things even if it can be made to work then I need to be able to switch on the fly, which means dynamic configuration descriptors which do not appear to be supported in the driver as it references the descriptor by name rather than querying it.

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 » Wed Apr 21, 2010 12:37 am

Oh, and I looked on Ralph's site but couldn't see where he did it that way.
Yeah, Grendel fixed his post to clear up the confusion. I'd like to see how you make out.

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 » Fri Apr 23, 2010 7:40 pm

Well I think the short answer is that Linux users are boned.

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 » Sun Apr 25, 2010 7:54 am

When I said interface, I ment interface as described in USB 2.0 chapter 9.6.5. You need to add a 2nd interface descriptor to the configuration descriptor, followed by another HID descriptor and a endpoint descriptor for EP3. A 2nd report descriptor needs to be connected to that interface as well. I'm sure there's more that needs to be taken care of, hence I said "needs some research".. ;)

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 25, 2010 12:32 pm

I did understand what you were getting at and attempted to implement it. I must have done something wrong I suppose. It's not an elegant solution either way and presents further problems for me because my device (Retro Adapter) re-configures itself on the fly by disconnecting, changing the USB config, device and HID descriptors and then re-connecting. From the look of it V-USB needs EP3 support compiled in so I would have to make some further changes to deal with that.

Kash

Re: Two HID joysticks from one device

Post by Kash » Sun Jun 06, 2010 4:29 pm

Get this problem solved. The only thing you have to do - specify "HID_QUIRK_MULTI_INPUT" for your device in drivers/hid/hidusb/hid-quirks.c

Code: Select all

{ USB_VENDOR_ID_KASH, USB_DEVICE_ID_KASH_JOY, HID_QUIRK_MULTI_INPUT },

USB_VENDOR_ID_KASH and USB_DEVICE_ID_KASH_JOY defined in drivers/hid/hid-ids.h. rebuild, reboot and you have two input interfaces.
Good luck.

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 Jun 06, 2010 6:15 pm

Kash, I guess you are referring to the Linux HID driver. I will pass the info on to my Linux guy and report back if it works. Thanks for the hint!

Post Reply