o0Zz / sys-con

Nintendo Switch sysmodule that allows support for third-party controllers (XBox, PSX, PC, ...)
GNU General Public License v3.0
72 stars 5 forks source link

Original Nintendo Switch: Pro Controller not working #31

Closed texita closed 2 months ago

texita commented 2 months ago

Atmosphere version: 1.7.1 Switch OS version: 17.0.1 Syscon version: 1.2.2 + 1.2.2+19 Controller: Original Nintendo switch pro controller ( HACAFSSKA ) https://www.amazon.com/Nintendo-Switch-Pro-Controller/dp/B01NAWKYZ0/

VID-PID: [057e-2009] Controller has been recognized and auto added. In sync menu i can see it, but no buttons are working. i tried both discovery mode 0 and 1. Tryed with version 1.2.2 and latest 1.2.2+19 All logs are in trace mode Made a wireshark dump (anyway this pad in windows is not working, i can see the buttons in joy.cpl but if pressed nothing happen)

in the logs you will also see the VID/PID of my hori battle pad, was only to try the controllers in sync menu.

EDIT: without sys-con enabled or with the old sys-con from Cathery, is not working, i mean it works only in wireless mode.

logs-config-wsdump.zip

EDIT: I opened this only for testing pourpose, i'm borrowing this pad from a friend and just want to made some tests on sys-con, we are using it always in wireless mode, so if you want to close this ticket as incompatible is not a problem for me :)

o0Zz commented 2 months ago

Nice catch. I didn't realized it was possible to connect switch controller PRO via USB - I though it was only for charging. It was funny to see nintendo expose an HID on their controller but it's a "garbage" HID that doesn't match real data. That's the reason why your windows and sys-con was stucks. At the end I end up by creating a specific driver for nintendo switch controllers. Here is the version -> sys-con-1.2.2+27-ATMOSPHERE-1.7.x.zip

texita commented 2 months ago

I will get the controller back and try. Can i use the latest 1.3.0 or i need this specific one 1.2.2+27 you sent here?

o0Zz commented 2 months ago

1.3.0 is the same binary thus you can use the 1.3.0 version without any problem

texita commented 2 months ago

Just tested, at the end is still not working, so what i've done for the logs:

Reboot the switch, went in sync menu, docked the switch and connect the usb to the pad, after some seconds the pad popped up automatically in sync menu and on the pad the green light is showing that is connected in wireless mode. At this ponit i've pressed A to quit the sync menu, just pressed sometimes button B to see something in the logs. anyway in sync menu now you will always see 1 pad and not 2 as before. I think there is no way to really test it, because this pad always wanna work in wireless mode, just by pressing any button it tries to connect to the switch.

logs are in trace mode log.log

EDIT: I tried the switch with this settings to see if i can prevent the pad from connecting in wireless mode: In System settings - Controller and sensors i've enabled the Communication via cable for the pro controller, then i've deleted all the controllers with the last option "disconect the controllers" rebooted the switch and try again what i've done above. Now no controllers pops up in the sync menu, tryed to disconnect and reconnect while in sync menu, i can feel the vibration on the controller like it's connected, tryed L+R and some more buttons, but nothing happened. No green light on the controller.

Here the new logs log.log

EDIT2: I've tried without sys-con enabled but with the setting "Communication via cable for the pro controller" enabled and...it's working in USB mode. what happened while i was in the sync menu, and connected the controller: first thing a notification in top left corner that say controller is sincronized (because before i've disconnected all controllers with "disconect the controllers" option) and then it popped up the controller, and it was usb connected not in wireless mode. So need to correct my first post, it is working without sys-con enabled and USB mode. With the old sys-con same behavior of without sys-con

EDIT3: Also tried with discovery mode 1, nothing changed.

Plus after all those tests I've got a question, as said here https://github.com/o0Zz/sys-con/issues/2#issuecomment-2185305263 shouldn't the discovery mode1 act as the old sys-con? With the old sys-con this controller is working. I think i will try the gc adapter in gc mode with discovery mode 1 to see if it's working, but this is another topic :)

o0Zz commented 2 months ago

Thanks for the detailed tests. Discovery_mode=1 should be the equivalent of the old sys-con since this mode disable the detection of HID devices, it will only detect XBOX devices, thus theorirically it should be exactly the same.

In all your tests we can see that sys-con took control of your switch pro controller

image

And it forced the controller to behave as "USB" - this is the purpose of the 2nd buffer: 0x80 0x04. However, I can see in your tests that the controller never send any data. while on my side (I also have an official pro controller) when I'm doing the same test, the controller send data to sys-con.

Maybe one difference one my side, I never ever pair this controller to my switch (This controller is used only with the Officiel Switch FW) and I never paired it with atmosphere version - That one of the difference

texita commented 2 months ago

Just tried with a new formatted SD. Put only atmsphere 1.7.1 and sys-con 1.3.0 both redownloaded from github now, same result :(

I'm trying with no controllers and pro wired communication off (tried also with on, same result)

2024082101330200-57B4628D2267231D57E0FC1078C0596D

2024082101323200-57B4628D2267231D57E0FC1078C0596D 2024082101325100-57B4628D2267231D57E0FC1078C0596D

As you see in the last image i've only 2 controllers paired with the original HOS (the 2 joycons on the switch)

In this way i can't use anymore the pro controller. If i want to i have to disable sys-con, connect with USB for the first time and it will be paired, then i can use again in wireless mode or usb (with pro wired communication on) and now i can re-enable sys-con and use the controller (not in USB mode for now). This part is very important for every sys-con user that own a pro controller or wanna buy one!

So i think now we can exclude the HOS, atmosphere and other plugins conficts

EDIT: also tryed with 3 different USB-A to USB-C cables. I'm gonna try with another controller the same as this one, and another switch where i put sys-con 1.3.0...After these i think i'll be out of ideas :) On the pc anyway i got it working by using this https://github.com/Davidobot/BetterJoy maybe can be useful to others, and at this point can't be the usb cable :)

EDIT2: As said in EDIT1 i've tested another controller in another switch, and same result. To recap: 2 pro controllers in 2 different consoles, both of them with sys-con 1.3.0.

EDIT3: After i understand how discovery_mode=1 works, i've tried the pro controller, and everything is working! Pairing etc..

o0Zz commented 2 months ago

I'm not sure to understand the difference between your setup and mine. (I retried just right now and everything is working on my side) In fact, I'm relying on this -> https://gist.github.com/ToadKing/30d65150410df13763f26f45abbd3700 This code is the minimal code needed for the pro controller to talk to the host.

I wondering if the issue is not related to a timing issue. Could you try this new version, I'm trying to read controller output between 2 commands: (0x80, 0x02) and (0x80, 0x04). We will see if it change something.

sys-con-1.3.0+6-ATMOSPHERE-1.7.x.zip

Thanks

texita commented 2 months ago

Well..You made this controller working even in discovery_mode=0 with this version! Great :) I attach logs if needed log.log

OT: This pro controller is not working in windows without drivers, but like the gc WUP-028 it was working only in discovery_mode=1 i've seen that the same dev has made these drivers https://github.com/ToadKing/wii-u-gc-adapter do you think it will be possible to add support for discovery_mode=0 even for WUP-028 or is totally different?

o0Zz commented 2 months ago

Good news! ;), thank you for your tests

Regarding your question, no, it's 2 different issues and I agree it's weird to have these differences.

For the WUP-028, the switch kernel takes ownership of this controller and when sys-con tries to open the interface, it is rejected by the switch. So sys-con has no chance to take control of this controller. And this is actually the same problem with all controllers that simulate official switch controllers. My guess is that if the switch kernel sees an official switch controller, it will take it, otherwise it will skip it.

With the pro controller, It's a different story this controller fake a HID device and the switch will not immediately take control on this controller. This is why sys-con can open the controller and use it. In fact this controller in USB mode is not supported by the switch, the switch only use USB mode to automatically pair the controller but once the controller is paired then all data will go through Bluetooth and not USB. Sys-con changes this behaviour and asks the controller to send data via USB.

texita commented 2 months ago

Everything is clear, thanks :)