Skip to content
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

Fix Shanwan initiation #203

Open
wants to merge 12 commits into
base: master
Choose a base branch
from
Open

Fix Shanwan initiation #203

wants to merge 12 commits into from

Conversation

Jeronimo17
Copy link

It is necessary to check if it is valid in general or if it is only valid for this model.

#119 (comment)

paroj and others added 12 commits April 18, 2022 13:24
This is based on multiple commits at https://github.com/paroj/xpad

Signed-off-by: Jasper Poppe <jgpoppe@gmail.com>
Signed-off-by: Jeremy Palmer <jpalmer@linz.govt.nz>
Signed-off-by: Ruineka <ruinairas1992@gmail.com>
Suspending and resuming the system can sometimes cause the out
URB to get hung after a reset_resume. This causes LED setting
and force feedback to break on resume. To avoid this, just drop
the reset_resume callback so the USB core rebinds xpad to the
wireless pads on resume if a reset happened.

A nice side effect of this change is the LED ring on wireless
controllers is now set correctly on system resume.

Signed-off-by: Cameron Gutman <aicommander@gmail.com>
Newer gamepads turn themselves off when the mode button is held down.
For XBOX360W gamepads we must do this in the driver.

Do not use BIT() macro for consistency within the file.

Signed-off-by: Santosh De Massari <s.demassari@gmail.com>
Signed-off-by: Daniel Tobias <dan.g.tob@gmail.com>
Signed-off-by: Daniel Tobias <dan.g.tob@gmail.com>
Signed-off-by: Jonathan <greenbigfrog@gmail.com>
Signed-off-by: Matt Sturgeon <matt@sturgeon.me.uk>
Many knockoff brands emulating the XBOX 360 controller do not properly
send data unless configured correctly. Examples include the Gamesir G3w
and the Fantech GP11 Shooter.

Protocol inspection of communication with other operating systems
reveals a sequence of control messages that can be used to initialize
the controllers sufficiently to send proper data.

Proposed-by: Darvin Delgado <dnmodder@gmail.com>
An effort has been made to support every official model and firmware
version I could track down info on. The following controllers _should_
have working paddles with this PR:
- Xbox Elite (**untested**)
- Xbox Elite Series 2 on early firmwares (**untested**)
- Xbox Elite Series 2 on v4 firmwares (Tested v4.8.1908.0)
- Xbox Elite Series 2 on v5 pre-BLE firmwares (**untested**)
- Xbox Elite Series 2 on v5 post-BLE firmwares (Tested v5.13.3143.0)

This patch also introduces correct handling for the Elite 1 controller
and properly suppresses paddle inputs when using a custom profile slot.

Starting with firmware v5.11, certain inputs for the Elite 2 were moved
to an extra packet that is not enabled by default.

We must first manually enable this extra packet in order to correctly
process paddle input data with these later firmwares.

Signed-off-by: Christopher Crockett <chaorace@gmail.com>
Add support for Dareu H101 controller (ID 260d:3002)
https://en.dareu.com/product6/309.html

Signed-off-by: Cleber de Mattos Casali <clebercasali@gmail.com>
@@ -1379,7 +1379,7 @@ static int xpad_start_xbox_360(struct usb_xpad *xpad)
status = usb_control_msg(xpad->udev,
usb_rcvctrlpipe(xpad->udev, 0),
0x1, 0xc1,
cpu_to_le16(0x100), cpu_to_le16(0x0), data, cpu_to_le16(20),
cpu_to_le16(0x100), cpu_to_le16(0x0), data, cpu_to_le16(14),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This value should be 20 or 0x14 (as that's the same numerically). This isn't a correct "fix".

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know, but I know that with that change now my game controller starts without using https://gist.github.com/dnmodder/de2df973323b7c6acf45f40dc66e8db3 the same with 0x14 also works.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so basically, this change is not needed?

Copy link
Author

@Jeronimo17 Jeronimo17 Jul 6, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Without the change, I assure you it doesn't work, and I guess it happens to more people because someone wrote fixcontroller.py.
I do not say that I change this change is correct at all, but I have based on fixcontroller.py, since with this script my game controller and that of the people who have posted there works.

Could 20 be interpreted as hex?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no, if 0x14 works, 20 must work too. So this change cannot be the fix.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's see if I can try later with different values there, as I don't have the controller here.

@VarLad

This comment was marked as off-topic.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

9 participants