Opened 13 years ago

Closed 13 years ago

#7649 closed bug (fixed)

xbox 360 usb controller non functional

Reported by: stargatefan Owned by: mmlr
Priority: normal Milestone: R1
Component: Drivers/USB Version: R1/Development
Keywords: Cc:
Blocked By: Blocking:
Platform: All

Description

there was a ticket with drivers and source code to make this particular device work. Even with all the recent changes to the usb joystick addition, this countroller doesn't work.

0738:4716 /dev/bus/usb/1/4 "Mad Catz, Inc." "MadCatz GamePad" ver. 0490

https://dev.haiku-os.org/ticket/7429

Attachments (10)

New text file copy 2 (43.3 KB ) - added by stargatefan 13 years ago.
usb_hid_report_descriptor_1bad_f016_0.bin (128 bytes ) - added by stargatefan 13 years ago.
usb_hid_report_descriptor_1bad_f016_0.2.bin (128 bytes ) - added by stargatefan 13 years ago.
syslog (41.6 KB ) - added by stargatefan 13 years ago.
syslog.old (512.0 KB ) - added by stargatefan 13 years ago.
usb_hid_report_descriptor_046d_c05a_0.bin (67 bytes ) - added by stargatefan 13 years ago.
syslog.2 (125.2 KB ) - added by stargatefan 13 years ago.
usb_hid_report_descriptor_1bad_f016_0.3.bin (128 bytes ) - added by stargatefan 13 years ago.
usb_hid_report_descriptor_1bad_f016_0.4.bin (128 bytes ) - added by stargatefan 13 years ago.
JProtocol.diff (1.8 KB ) - added by caz_haiku 13 years ago.

Download all attachments as: .zip

Change History (26)

comment:1 by stargatefan, 13 years ago

To note stickit and the driver in that ticket do not properly adress the 2 analog triggers or the right analog stick properly. the analog trickers are treat as buttons and the right analog stick is shown as only have 2 axis left/right when in fact is has 4 axis l/r/u/d.

Just starting this ticket to make sure it doesn't get forgotten.

comment:2 by stargatefan, 13 years ago

Component: - GeneralDrivers/USB
Owner: changed from nobody to mmlr

comment:3 by caz_haiku, 13 years ago

mmlr, An xbox360 controller usb descriptor has been created for freebsd, it can be seen here http://fxr.watson.org/fxr/source/dev/usb/uxb360gp_rdesc.h?v=FREEBSD62. You may already know about it.

by stargatefan, 13 years ago

Attachment: New text file copy 2 added

in reply to:  3 comment:4 by mmlr, 13 years ago

The reason why all those changes to usb_hid didn't make a difference: It's not a HID device (designated by the all vendor specific interfaces). Hence it is not supported by usb_hid at all. Since it provides a similar enough interrupt based input data stream a HID descriptor describing the input can be created and the device can be made to look and work like a HID device with that however. This has not been done yet though.

Replying to caz_haiku:

mmlr, An xbox360 controller usb descriptor has been created for freebsd, it can be seen here http://fxr.watson.org/fxr/source/dev/usb/uxb360gp_rdesc.h?v=FREEBSD62. You may already know about it.

Thanks for looking it up. Something along those lines is easy to create with the new HIDWriter so an actual HID descriptor can be created for that input data. The quirky device interface has to be extended a bit to specifically include devices like these in the support descriptors though.

comment:5 by mmlr, 13 years ago

I've added a quirky device entry for those controllers in hrev42003. The built report descriptor is pretty much a pure guess based on looking through the sources provided. Please test and report your findings. If it doesn't work, please attach a syslog and check if a report descriptor dump in /tmp for this device is present (which would then contain the constructed report descriptor).

by stargatefan, 13 years ago

Attachment: syslog added

by stargatefan, 13 years ago

Attachment: syslog.old added

comment:6 by stargatefan, 13 years ago

as requested controller did not work with stick it with changes in last commit.

Last edited 13 years ago by stargatefan (previous) (diff)

in reply to:  6 ; comment:7 by mmlr, 13 years ago

Replying to stargatefan:

as requested controller did not work with stick it with changes in last commit.

There seems to be something still using the old extended_joystick communication, which might just interfere with things. Do you have some old libdevice or similar laying around on that system? Or is this a hybrid build where you only updated some parts?

Can you tell me what the two first descriptors you attached belong to?

Please do not edit comments BTW, add new ones instead. As there is no notification mail sent for comment edits it's very easy for me to miss such added info.

in reply to:  7 ; comment:8 by stargatefan, 13 years ago

Replying to mmlr:

Replying to stargatefan:

as requested controller did not work with stick it with changes in last commit.

There seems to be something still using the old extended_joystick communication, which might just interfere with things. Do you have some old libdevice or similar laying around on that system? Or is this a hybrid build where you only updated some parts?

Can you tell me what the two first descriptors you attached belong to?

Please do not edit comments BTW, add new ones instead. As there is no notification mail sent for comment edits it's very easy for me to miss such added info.

Attaching syslog, and I am attaching the descriptors from a clean build. I geuss the build wasn't clean enough ?? anyways xbox 360 controller works, however stick misreports the stick and axis portions. It shows the 2 bottom triggers as the stick and the 2 sticks as axis 2-5. These should be the descriptors you asked for from boot/common/cache temp for this device. This is on the first boot on a clean build.

by stargatefan, 13 years ago

Attachment: syslog.2 added

in reply to:  8 comment:9 by mmlr, 13 years ago

Replying to stargatefan:

Attaching syslog, and I am attaching the descriptors from a clean build. I geuss the build wasn't clean enough ??

You've attached the descriptor of a mouse now (1bad_f016), but I guess you meant to attach the other one (don't bother, it'll be the same as the one already attached). But from the comment I take it it works now.

anyways xbox 360 controller works, however stick misreports the stick and axis portions. It shows the 2 bottom triggers as the stick and the 2 sticks as axis 2-5.

No. As I've already explained in #7658 there is no concept of "two axis representing a stick" in the BJoystick API. Those are all just individual axis. That StickIt draws the first two different is just StickIt guessing based on the back then common configuration. There's no actual misinterpretation (because there is no interpretation on that level in the first place). I will nevertheless adjust the code later to move X & Y (& Z) axes to the beginning as appropriate.

comment:10 by stargatefan, 13 years ago

It is generating a identical descriptor to the one I attached earlier.I really don't know what that means. I even deleted the existing descriptor and it generated a identical one by checksum.I will attach it anyways. I have a few of these controllers. Would you like one for testing ? Its no shirt of my back to give you one.

email your adress to

specialspambot at gmail dot com

Version 1, edited 13 years ago by stargatefan (previous) (next) (diff)

in reply to:  10 ; comment:11 by mmlr, 13 years ago

Replying to stargatefan:

It is generating a identical descriptor to the one I attached earlier.I really don't know what that means. I even deleted the existing descriptor and it generated a identical one by checksum.I will attach it anyways. I have a few of these controllers.

Please read more carefully!

As stated above the one you attached (again) is a report descriptor of a mouse, not the XBOX controller. And I also told you that you don't need to attach it at all anymore (as it would only be the generated one I already know how it looks like).

Would you like one for testing ? Its no shirt of my back to give you one.

Not really, the device is not so complicated, so working it out this way is no real problem. Just tell me: does it work now or not?

comment:12 by caz_haiku, 13 years ago

The xbox360 controller works, but as you have mentioned mmlr for legacy applications to be able to use at least the left stick to control games etc, the JoystickProtocolHandler should assign the first two axes USAGE X, USAGE Y found for BJoystick. I've attached my fix, it works but i don't think you will want to implement it like i have but it does solve the problem for stickit and a few apps i've tested.

by caz_haiku, 13 years ago

Attachment: JProtocol.diff added

in reply to:  11 comment:13 by stargatefan, 13 years ago

Replying to mmlr:

Please read more carefully!

As stated above the one you attached (again) is a report descriptor of a mouse, not the XBOX controller. And I also told you that you don't need to attach it at all anymore (as it would only be the generated one I already know how it looks like).

I will remove the superflous attachments.

Not really, the device is not so complicated, so working it out this way is no real problem. Just tell me: does it work now or not?

It seems to work only with stickit, it cuases besnes9x joystick setup app to crash. Not really sure why ? Just reporting what I currently know.

comment:14 by caz_haiku, 13 years ago

mmlr, I think my comment was poorly explained, axis[0] and axis[1] for BJoystick should be assigned to the first found USAGE X and USAGE Y by JoystickProtocolHandler, my patch does this and the rest of the axes are also correctly found.

stargatefan, Also the usb_descriptor for an Xbox360 pad can be modified to act as required. It just depends what functions you want the axes, d-pad etc to be hat switch for example.

comment:15 by stargatefan, 13 years ago

Go ahead and close this ticket, the controller has been working fine, there is something screwy with snes9x that seems to be cuasing the issue. Tested on all build spost A3 and several A3rc's. Works fine with several other applications.

Last edited 13 years ago by stargatefan (previous) (diff)

comment:16 by korli, 13 years ago

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.