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

Can u add PS3 #7

Closed
oxley192 opened this issue Aug 27, 2020 · 72 comments
Closed

Can u add PS3 #7

oxley192 opened this issue Aug 27, 2020 · 72 comments

Comments

@oxley192
Copy link

Would you please had support for PS3 controllers

@ndeadly
Copy link
Owner

ndeadly commented Aug 27, 2020

It's on my list of things to do. PS3 controllers use a non-standard pairing process that's different to the other supported controllers and involves having to connect a USB cable first. More research is required to determine whether support is feasible without compromising the bluetooth service.

@Irgendwer01
Copy link

would it be possible to connect it asfirst via hid-mitm https://github.com/jakibaki/hid-mitm and then connect it via MissionControl?

@ndeadly
Copy link
Owner

ndeadly commented Aug 28, 2020

If you can connect it via hid-mitm, then you don't need MissionControl. This wouldn't work anyway as hid fetches the controller data from bluetooth, not the other way around

@ndeadly ndeadly added the feature request New feature or request label Aug 28, 2020
@brenodantas10
Copy link

I'm curious, how is the switch reacting if we use sixpair.c to swap the ps3 controller target mac with switch's bt address and try to press PS button while in change grip/order on the switch? Also, how do I find the Switch's bt mac address?

@ndeadly
Copy link
Owner

ndeadly commented Aug 28, 2020

That would be interesting to try. I'm busy with some other stuff at the moment. If you have the means and want to try it, I can add the switch host bd address to the output of btdb.nro if you want.

@brenodantas10
Copy link

I would love to contribute somehow

@ndeadly
Copy link
Owner

ndeadly commented Aug 28, 2020

There you go. Let me know if you find anything interesting. I haven't made a handler for DS3 yet, so don't expect it to connect with the console just yet. If it's successful at pairing, the controller may end up in the device database though.

btdb.zip

@brenodantas10
Copy link

brenodantas10 commented Aug 28, 2020

Yeah, it didn't paired. But if the switch is on the blinking lights of ps3 controller goes off for less time than if the switch off or sleeping. I'm gonna check the duration of the blinking on both cases and share

@ndeadly
Copy link
Owner

ndeadly commented Aug 28, 2020

Also, I think the DS3 uses Bluetooth legacy pairing like the Wii controllers. From memory it uses the default 0000 pincode but you might want to check that. If it's anything other than that then it definitely won't pair.

@brenodantas10
Copy link

i'm gonna check on others devices then

@brenodantas10
Copy link

None of 0000, 1234, 1111 and 9999 works... maybe none of the pin codes works

@ndeadly
Copy link
Owner

ndeadly commented Aug 28, 2020

Where are you trying this? MissionControl will only send 0000 (Wii controllers excepted) for now FYI.

@brenodantas10
Copy link

I'm trying on my phone (android), it doesn't pair with any pin codes that i provide

@brenodantas10
Copy link

Is there a way to create a fake record at database? Where does the switch saves this info?

@ndeadly
Copy link
Owner

ndeadly commented Aug 28, 2020

It's possible, but there's no point. Nothing interesting will happen if you fake it, as the database stores the link key which is negotiated between the controller and the host during pairing. You need the key to be stored in controller memory too for the connection to be established.

@brenodantas10
Copy link

Understood, i will try to investigate more

@Irgendwer01
Copy link

Irgendwer01 commented Aug 29, 2020

the PS3 Controller needs to allow the Switch Bluetooth to connect to it but it needs somehow to be connected before that it works
EDIT: u can use a special software that edits the PS3 paired bluetooth mac adress that allows the switch to connect https://sixaxispairtool.en.lo4d.com/windows

@brenodantas10
Copy link

brenodantas10 commented Aug 29, 2020

Yeah, I've done that (using sixpair.c) but if didn't create any info on database and didn't pair.
When I tried on an android phone it asks a pin code (but doesn't accept any).
But if I use bluetoothctl with connect command at a linux computer (ubuntu 20.04.1) It connects (without asking for a pin code) and can use as a joystick (but the system doesn't know the name somehow)

@Irgendwer01
Copy link

@brenodantas10 do u have tried adding via sixpair.c the bluetooth mac address from ur phone and then connecting?

@brenodantas10
Copy link

Yes I did, it asks for a pin code. But, unfortunately, 0000, 1234 and others default pin codes doesn't pair the controller. The phone is not rooted though, I might try that later (although I don't think it matters if it's going to try to connect via Pin Code, but I want to try other ways)

@ndeadly
Copy link
Owner

ndeadly commented Sep 13, 2020

I tried sixpair.c earlier today myself. No luck with getting it connected, it didn't even show up in device discovery logs. This gives me a bad feeling the bluetooth driver may need to be patched.

I seem to remember reading somewhere that the ds3 uses 0000 as a pincode, but not certain on that.

@brenodantas10
Copy link

i found this page a while ago PS3-Information. It gives some info about the controller and references, but unfortunately few of the reference links are broken...

I hope it helps somehow.

@KAMELCOLTD
Copy link

Yo i was thinking how about pairing the ds3 before startup
i mean plug the controller with usb while the device is power off then power on .. maybe i just give an idea that maybe works .. 😁

@ndeadly
Copy link
Owner

ndeadly commented Sep 17, 2020

@KAMELCOLTD the controller still needs to complete the pairing process with the console via Bluetooth to exchange link keys. The problem is that the DS3 is currently not even showing up to the Switch.

@KAMELCOLTD
Copy link

One more thing
in sixaxis before pairing you need to plug the controller with usb .
i managed it to work without pluging the usb.
in non otg device i just manualy edit the mac address and it work's.
maybe if you can edit the nro app read and edit or even add manualy maybe we can help with testing with every single possible steps.
Or where the mac address stored exactly so i can do my best to make it work.

@ndeadly
Copy link
Owner

ndeadly commented Sep 17, 2020

I don't think the mac address is the problem. I set it successfully using a modified sixpair.c where I manually inserted my console mac. I think the issue is that some non-standard stuff needs to be done at lower levels of the bluetooth driver than we have direct access to.

If you want to play around with it, the latest version of my btdb.nro applet will print your console mac address to the screen.

@KAMELCOLTD
Copy link

Great but i mean where to put the controller address not the console or if i can edit the already paired mac.

i will work with debug step by step and find out what happen when pairing ds3 with pc and android and also 8bit adapter to find the low level of how it really paired .

one more thing did you try to press the reset button while trying to pair ?
The reset button located beside L2 button.

i will start testing now i hope i can find the missing block.

@ndeadly
Copy link
Owner

ndeadly commented Sep 17, 2020

The Switch stores the controller address alongside other info to the database after successfully pairing with it. As I said earlier in this thread, manually inserting the controller mac address into the database is useless without the two devices having exchanged keys.

Yeah I tried the reset button. I think it only serves to make the controller forget existing pairings anyway.

@KAMELCOLTD
Copy link

Yo good morning
What i did so far
i paired the ds3 to android without pin code or usb just bluetooth .. i edit the master host of the controller to fit the mac of my phone and it works without any more steps.

Next i changed my phone bluetooth mac into the NS so both had the same mac address

Trying to pair but it wont i even tried to pair the joy-con to my phone but it won't so i try to pair all controllers at same time to phone and the console .. non of ds3 or joy-con paired lol 😂😂😂

Next i try to pair the joy-con to pc it works no pin needed no 3rd party app used too.

for the DS3 it asks for pin but nothing works....

Here is the idea

When i try to pair the the ds3 to my phone it works without asking for pin.

" there is something about the driver it self.
sixaxis always install a driver before pairing and it always works no pin no usb needed."

Thats what i came with i hope my bad english was enough to make the idea.

@KAMELCOLTD
Copy link

I will still try to add database dumping/restoring features when I have time as this may be useful for the Xbox One Elite V2 controller. I'll post it here for you to try when it's working, but don't get your hopes up.

New hope thank you we all waiting here .
and you are right all other method's to pairing ds3 needed a custom driver.

One more thing i tried to pair fake ds3 in Lakka but it didn't work's .. original one works perfectly just like i you pairing it to ps3..

so i hope all of testers trying with original ds3.

Thank you

@Masamune3210
Copy link

If I remember correctly back from the old ScpToolkit, it took a modified bluetooth stack plus programming into the controller through usb the host's bluetooth MAC if that helps at all

@Masamune3210
Copy link

Although the whole 'modified bluetooth stack' thing will likely be the showstopper unfortunately unless there is a way around it

@justinkb
Copy link

justinkb commented Oct 14, 2020

it's definitely possible to pair a sixaxis controller on linux on the mainline kernel, I've done it, so the exact source code for the device driver should be available to peruse. BlueZ, the linux bluetooth stack, is fully open source as well. This goal should not be unattainable

@ndeadly
Copy link
Owner

ndeadly commented Oct 14, 2020

it's definitely possible to pair a sixaxis controller on linux on the mainline kernel, I've done it, so the exact source code for the device driver should be available to peruse. BlueZ, the linux bluetooth stack, is fully open source as well. This goal should not be unattainable

Yeah, I know it's doable on linux. If you look into it further, you'll see on newer kernels it works because of a plugin for Bluez. The problem over here in Switch-land is that we have neither an open source driver or a plugin system for it. We also don't have a means to call into the low level functions that are present. Adding this kind of support would likely require a lot more RE'ing and hooking of the bluetooth driver, maintaining offsets for each firmware etc. Or alternatively, a complete open source reimplementation of the bluetooth service. A lot of work to support just one controller (that I don't even personally own).

@brenodantas10
Copy link

@ndeadly , does the switch at least receive the payload sent from the ps3 controller when the controller tries to connect? I remember I tried to modify the GetEventInfo just to log the payloads it receives on an older version of MissionControl but it didn't saw Events from the ps3 controller even though it had the host address set to switch's bluetooth mac address.

Maybe I just didn't know what I was doing.

@ndeadly
Copy link
Owner

ndeadly commented Oct 14, 2020

@brenodantas10 no, nothing is seen at all by the rest of the switch OS. I think the connection is silently rejected somewhere within the lower levels of the bluetooth service, or maybe not even seen as a valid device in the first place.

@Masamune3210
Copy link

The DS3 uses a pretty heavily modified Bluetooth spec if I remember correctly, so it just might be too out of spec for the Switch to accept it

@ndeadly
Copy link
Owner

ndeadly commented Oct 14, 2020

The DS3 uses a pretty heavily modified Bluetooth spec if I remember correctly, so it just might be too out of spec for the Switch to accept it

Yes, this is pretty much what I understand the problem to be. My point above was that whatever communication might be taking place is happening between the DS3 and the chip/driver at a low level where we have no influence. The driver only signals high-level connection events to the rest of the OS.

@KAMELCOLTD
Copy link

KAMELCOLTD commented Oct 29, 2020

Atm 15 is out with new mesosphere kernel hoping for new features. ;)

@KAMELCOLTD
Copy link

just thinking how swich could pair a pro controller with usb? i search but found nothing.
and thinking how sys-con works maybe if you check it out you could make any supported controller pairing it self!

@ndeadly
Copy link
Owner

ndeadly commented Nov 4, 2020

@KAMELCOLTD pairing is a Bluetooth concept and is not needed for USB devices. sys-con just detects the controller and sends its inputs to a virtual gamepad. For official switch controllers the controller firmware probably has a function to perform the bluetooth authentication via USB. This is not a standard feature of HID devices. Even if other controllers also had such a feature, you would need to reverse engineer how it's done and write code to handle each controller. Much easier to let the controller do it via standard Bluetooth.

In any case, even if this were possible for the DS3, it would not solve the root Bluetooth problem.

@KAMELCOLTD
Copy link

hi yo ndeadly how are you doing it's been 1 year almost , i don't really want this but i am so care about the possibility of supporting DS3 after the new update since it's support more Bluetooth stuff .

sorry if i disturb you , have a nice day ♥

@ndeadly
Copy link
Owner

ndeadly commented Sep 20, 2021

The core problem is that the DS3 relies on a custom Bluetooth implementation that doesn't follow the standard. No update to Nintendo's Bluetooth driver is going to change this. Platforms that are able to support DS3 do so either by loading alternate drivers specifically written to support the controller, or via a driver extension module or similar. Since we don't control the source code for the Switch driver, this is just not possible without a full reimplementation - an absurd amount of work that is very unlikely to ever take place.

As I've said before, the only feasible option we have is to attempt to patch the Bluetooth driver to change its behaviour. This itself is a huge undertaking and is not something I am really willing to invest the time into right now (if at all) with no guarantee that it can be done without breaking Bluetooth for all other devices.

@SylvainSalgatHEIG
Copy link

Hi ndeadly, first of all thank you so much for your amazing work. One of the best Switch Homebrews out there. I was so pissed when I learned that my Wii U Pro Controller would not be officially compatible with the Switch.

Obviously, just like everyone here, I'd love to see the DS3 become compatible with your homebrew. It's the cheapest controller out there when bought second hand, and I'd love to play SSBU with 8 controllers haha.

I understand that wireless DS3 compatibility would be really tough and time-consuming to implement. But what about wired implementation ? We could used a HUB, and mini-USB cables are really cheap aswell. Would that be possible ? Thanks so much for your answer :)

@ndeadly
Copy link
Owner

ndeadly commented Mar 16, 2022

@SylvainSalgatHEIG DS3 support via USB is definitely possible. USB support within mission control is currently in the works, but I've hit a bit of a roadblock so not actively working on it for now. You should be able to use sys-con to connect USB controllers for the time being.

@ndeadly
Copy link
Owner

ndeadly commented Apr 8, 2023

Here's a little Easter present for you guys ( ͡° ͜ʖ ͡°)

To pair the controller, you will need to connect it to the console via USB cable at the usual Change Grip/Order screen. Once the LEDs start flashing, remove the USB cable and hit the PS button. The controller should show up as paired. This doesn't seem to always work on the first try, so if it doesn't work try a few more times.

Motion controls are currently ignored, but everything else should be functional. Feedback welcome, I'll make a release once it's confirmed stable and working correctly.

Since this build now interacts with USB, there is a possibility that it interferes with or is incompatible with sysmodules like sys-con. I would appreciate feedback on this also so I can try to minimise any negative impact.

MissionControl-0.9.0-dualshock3-support-a7933f9.zip

@Irgendwer01
Copy link

Since this build now interacts with USB, there is a possibility that it interferes with or is incompatible with sysmodules like sys-con
@ndeadly If you're going to add USB-Support anyways, wouldnt this Kind of superseed sys-con?

@ndeadly
Copy link
Owner

ndeadly commented Apr 9, 2023

Yes it would, but we're a way off that being a reality. This is not full USB support for controllers we have here, just issuing a few commands to do the out-of-band pairing of the DS3.

These changes would also potentially interfere with my own USB controller support implementation.

@ndeadly
Copy link
Owner

ndeadly commented Apr 18, 2023

Dualshock 3 support has finally been added! Grab it here https://github.com/ndeadly/MissionControl/releases/tag/v0.9.1

@ndeadly ndeadly closed this as completed Apr 18, 2023
@justinkb
Copy link

justinkb commented Apr 18, 2023 via email

@brenodantas10
Copy link

Wow, I just saw the update in my email box and was quite surprised. Now I can finally use my beloved controller!!!

Thx for the hardwork, ndeadly!!

@KAMELCOLTD
Copy link

Hi it's been long time lol.
AND Yes it's working even with MyFakeDS3 thank you Ndeadly ✋✋✋❤

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

No branches or pull requests

9 participants