cathery / sys-con

Nintendo Switch sysmodule that allows support for third-party controllers
GNU General Public License v3.0
959 stars 62 forks source link

Xbox 360 dongle support #11

Closed mzino closed 4 years ago

mzino commented 4 years ago

I don't know if it's technically possible, but it would be great to have compatibility with the official Xbox 360 dongle for PC. Right now it lights up but the controller isn't recognized.

cathery commented 4 years ago

It seems the dongle requires installing software, so i can't support it unless i get my hands on it. I made a build of the sysmodule that tries to recognize the wireless adapter as an xbox 360 controller - it's a shot in the dark, but you can try it.

https://files.catbox.moe/pwrpyl.rar

mzino commented 4 years ago

AFAIK the drivers for the dongle are the same that you would use for the USB version of the controller, so it was worth trying. This build unfortunately still doesn't work.

mzino commented 4 years ago

If you need logs or other info such as hardware ids etc... ask away.

cathery commented 4 years ago

There's not much to be done right now. If you can find the vendor + product IDs of your dongle it'd be greatly appreciated

mzino commented 4 years ago

Vendor is 045E and PID is 0719. Official MS dongle.

mzino commented 4 years ago

Also, once paired the controller has VID 045E and PID 02A1, which I see is different from the one currently in your source for Xbox 360 USB.

gilest commented 4 years ago

I also have a dongle. Can compile and debug if this is helpful to you

Skirlez commented 4 years ago

I would do anything to make the dongle work. I can also test it, if you need it.

gilest commented 4 years ago

Not sure if this is helpful, but I found a C++ implementation of the Xbox 360 Wireless Receiver in the ogx360 project

This project is GPL ๐Ÿ‘

Ntemis commented 4 years ago

Dongle is about $7 on AliExpress. I have been using those for years now without any issues

cathery commented 4 years ago

Can you guys launch this applet and send me a screenshot of your scanned dongles? https://files.catbox.moe/re60qo.rar

AnthonyTorres58 commented 4 years ago

2019110719102700-DB1426D1DFD034027CECDE9C2DD914B8

gilest commented 4 years ago

Dongle unplugged

2019110813222700-69AA450BB058D7C0F3FABB7FC7C2DBA2

Dongle plugged

2019110813221100-69AA450BB058D7C0F3FABB7FC7C2DBA2

lukedoomer commented 4 years ago

Please add support for the popular and unofficial xbox 360 dongles as well. Vendor:045e Product:0291 It use totally same driver with the offical one.

gilest commented 4 years ago

@lukedoomer I think that might be the one that @AnthonyTorres58 scanned. Mine is official Microsoft one I believe. Hopefully all compatible Vendor and Product ID combinations can be loaded in ๐Ÿ˜„

cathery commented 4 years ago

Thank you all for your feedback. It seems that the dongle is using the same interface as the wireless 360 controller, which might take a while until it's implemented. Stay tuned

orbstar8 commented 4 years ago

IMG_20191107_233005

I share my results with the inserted adapter, apparently it gave the same results as @gilest , tested with original Xbox 360 controller

Ntemis commented 4 years ago

@cathery note that this adapter can connect to 4 individual controllers. Also adding force feedback is mandatory for many people :)

cathery commented 4 years ago

Can someone test if this works on their 360 wireless? https://files.catbox.moe/aw2au7.rar

cathery commented 4 years ago

Can you send me the log? It's located at sdmc:/config/sys-con/log.txt

cathery commented 4 years ago

So the dongle works fine if you just plug it and unplug it?

cathery commented 4 years ago

Lemme know if this one works https://files.catbox.moe/30byxg.rar

orbstar8 commented 4 years ago

Lemme know if this one works https://files.catbox.moe/30byxg.rar

It does. Kinda. After pairing my controller, I can move the stick and it does move, however all the buttons do not function. Also, the controller still is blinking, as if I've just turned it on. but the stick still works. As a side effect of it blinking, It will turn itself off after a while. UPDATE: Tried to use 2 controllers, doesn't work. it only listens to one and also, its detecting the controller as a USB controller. forgot to mention that. The same results here, At least he recognizes it ๐Ÿ’ƒ , and some reason, the Y button is left in the stick

alvarin8219 commented 4 years ago

gracias por trabajar en esto, de verdad se aprecia mucho tu esfuerzo, y estamos a la espera de que funcione correctamente, gracias.

cathery commented 4 years ago

Thanks for your feedback everyone. It's a challenge to support multiple controllers under current circumstances, I'd like to make sure it works first. Please tell me if this works: https://files.catbox.moe/7htzfr.rar

alvarin8219 commented 4 years ago

Wow, a probar, esperemos se pueda hacer algo con mรบltiples controles, eres genial

alvarin8219 commented 4 years ago

Please, support to 2 controllers

orbstar8 commented 4 years ago

It works perfectly! It also provides the analogs in the switch options and also everything perfect! thanks for your great work <3 Edit : Another thing to try is to play a rhythm game to see if there was an input lag and nothing!

SageAlchemia commented 4 years ago

Works perfectly for me too! Outstanding! 0 Input lag. The only "problem" is the blinking light... But for me is just perfect. It would be amazing insert various controllers in 1 dongle.

Ntemis commented 4 years ago

Great progress for one day @cathery You've done well! Dont know if this is of any help to nail the blinking bug but here it is anw: https://github.com/torvalds/linux/blob/master/drivers/input/joystick/xpad.c Also look for the Force Feedback init lines: static int xpad_init_ff(struct usb_xpad *xpad) { if (xpad->xtype == XTYPE_UNKNOWN) return 0;

input_set_capability(xpad->dev, EV_FF, FF_RUMBLE);

return input_ff_create_memless(xpad->dev, NULL, xpad_play_effect);

}

else

static int xpad_init_ff(struct usb_xpad *xpad) { return 0; }

endif

and https://github.com/torvalds/linux/blob/master/drivers/input/joystick/xpad.c#L1209 (CONFIG_JOYSTICK_XPAD_FF)

cathery commented 4 years ago

Can someone check if this works with multiple controllers / at all? https://files.catbox.moe/l5v1mf.rar

gilest commented 4 years ago

That seems to work with two controllers!

cathery commented 4 years ago

How does it work? Does it immediately connect 4 separate controllers, or only one per pairing? Does it remove the controller when unpaired?

gilest commented 4 years ago

One per pairing. All buttons work on both controllers in the input test.

cathery commented 4 years ago

What about the LED?

gilest commented 4 years ago

Both flashing but I don't mind personally.

gilest commented 4 years ago

After pairing second controller:

2019110912240900-1E95E5926F1CB99A87326D927F27B47E

Just tested in game and it works perfectly also.

cathery commented 4 years ago

cool cool, does this version do anything to the LEDs? https://files.catbox.moe/t8x3ew.rar

gilest commented 4 years ago

No change to LEDs. I removed and re-added the controllers and they still behave the same.

cathery commented 4 years ago

Try this one https://files.catbox.moe/r94v38.rar

gilest commented 4 years ago

One thing to note:

When disconnecting (removing battery) controllers after they are paired, they still show under controllers.

They can be reconnected and will continue working as normal.

Removing and plugging in the dongle again resets to "No other controllers are connected".

The controllers can then be switched back on, and they will show up under controllers as they pair with the dongle.

In my opinion this is totally OK ๐Ÿ‘

Will try the new build now

gilest commented 4 years ago

LED behaviour is unchanged in the new build.

alvarin8219 commented 4 years ago

Wow, Youre amazing IMG_20191108_174401077

cathery commented 4 years ago

@gilest Alright, can you try this version? https://files.catbox.moe/7u3zh5.rar Also, after unpairing the controllers, can you wait a little and see it they get disconnected under controllers?

gilest commented 4 years ago

I waited for quite a while, I'm pretty sure that they don't. Will leave it extra long next time to make sure. Edit: I'm sure.

Rebooting into new build now ๐Ÿš€

gilest commented 4 years ago

LED behaviour is unchanged.

cathery commented 4 years ago

Let's try this one https://files.catbox.moe/sw6h4l.rar

Ntemis commented 4 years ago

Omg so much dedication! Kudos man.

gilest commented 4 years ago

LED's are the same.

If it's helpful I can take a video of pairing one, there are some intermediate states like [looking, pairing, paired] or something.

cathery commented 4 years ago

That's a shame. I don't think I can fix the LEDs or the disconnect for now. But I'll consider the dongle supported and close the issue.