-
Notifications
You must be signed in to change notification settings - Fork 256
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for original xbox gamepads and SBC hardware via USB passthrough with libusb #2290
Conversation
Co-authored-by: Fred Hallock <specialfred453@gmail.com>
8a78a0d
to
bd9997f
Compare
seems fine except rumble... either both left and right motors are active when testing the right or the left is just dead(worked in the other incarnation) |
@medievil1 I think I found the problem and added a workaround for it. Can you retest to see if it helps? |
I'll take a look at this with my SBC later to verify that it works |
@faha223 A note about the SBC. We are currently using a subtype of 0x2 for the virtual SBC, and that's wrong according to the xboxdevwiki which reports a subtype of 0x1 instead. We can know the correct value by looking at the bSubType member of the xid descriptor of the controller, which is dumped to the kernel log when you select the "libusb" logging option at info level. So, can you also report that value as well please? |
da61b7b
to
6f82719
Compare
I'm seeing this in the logfile: So it looks like a real Steel Battalion Controller will have subtype of 0x01. Inputs seem to all work, but LEDs don't. I had expected either they'd work perfectly, or they'd be off by 2 bytes but they're not working at all. |
Also, rumble doesn't work on any of my OEM Xbox controllers. Edit: Even built from source I'm getting no rumble |
@faha223 Yes, I discovered the rumble pointer I was passing was off by two bytes. I also disabled the rumble workaround I added in the previous commit. If it still doesn't work, I'll add it back. |
Rumble works now. SBC LEDs still don't. If I switch from libusb_control_transfer to libusb_interrupt_transfer or libusb_bulk_transfer when writing the data to the device then it works fine. It seems that either the parameters for libusb_control_transfer are wrong for the SBC out endpoint, or libusb_control_transfer is the wrong function to use to write to the SBC out endpoint. |
Rumble working correctly now..... |
5e44997
to
8f28962
Compare
SBC LEDs are working perfectly now |
rumble still good to go as well |
8f28962
to
047621e
Compare
I switched to interrupt transfers directly instead of control transfer, in an attempt to simplify |
022f225
to
2425406
Compare
I installed the WinUSB driver using Zadig to get it working, since libusb on Windows is a wrapper around WinUSB. @medievil1 said he used xb2xinput and that worked too. Edit: I've only tried it with my various xbox controllers and my SBC, but I think you can install the WinUSB driver for just about any USB device. There's probably a way to do it within Device Manager but I just used Zadig so I don't know for certain |
My Xbox Controller S still works (including Rumble), and my SBC still works (including LEDs) |
d2721d8
to
8fc244e
Compare
s controller still works fine (rumble too) via the xb2xinput driver method..which is just libusb pretty much...lol |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I made some local modification to see how it react to unfiltered usb devices. It cause a crash which I didn't investigate where as it's not that important at this time.
So, since my Xbox 360 Wireless Controller meet WinUSB compliant driver support. I went with non-standard PC controller to see if at least one title able to detect my inputs. Turns out only one button have response whilst other buttons has no response. However, this was only a test to see how xbox title's may response to "emulated" controller type for non-xbox controller.
The code's functionality looks good to me. Just have some nits here and there.
…ved rumble hack + switched to interrupt transfers
0e49859
to
7791c9d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit review remarks are done.
Base on two reports, I believe it is safe to merge.
Mostly the same as #2289, but with better code.
It's a draft because I don't have a SBC to test, so I have no idea if this actually works or it has bugs and/or crashes.