Skip to content
This repository has been archived by the owner on Jan 1, 2024. It is now read-only.

Implement 3rd party controller feature detection #2361

Closed
dogtopus opened this issue Jul 26, 2021 · 8 comments
Closed

Implement 3rd party controller feature detection #2361

dogtopus opened this issue Jul 26, 2021 · 8 comments

Comments

@dogtopus
Copy link

dogtopus commented Jul 26, 2021

Describe the bug

Currently DS4Windows uses a hardcoded VIDPID list for DS4-like controllers. However what PS4 did officially for those controllers is using the GET REPORT 0x03 to detect the controller presence and their features. The format is partially reversed (and mostly focusing on main controllers instead of steering wheels or guitars) and I'm still working on it. More info on that coming soon.

With this implemented, most licensed controllers (and their knockoffs) should be able to plug-and-play without a VIDPID list of what works and what does not.

To Reproduce

Steps to reproduce the behavior:

  1. Plug in a controller that has VID and PID DS4Windows doesn't recognize (e.g. Raspberry Pi with this running)
  2. Start DS4Windows
  3. Controller is not recognized

Expected behavior

These controllers should be recognizable with the correct feature automatically used/avoided by DS4Windows.

Screenshots and Logs

Probably not necessary since there's nothing useful in it.

Desktop (please complete the following information):

  • Controller Make and Model: Other 3rd party licensed PS4 controller or their knockoffs.
  • OS: Windows 10 20H2
  • DS4Windows Version [e.g. 3.0.3]: 3.0.13
@mika-n
Copy link
Collaborator

mika-n commented Jul 26, 2021

This would be useful. However, we probably still need the VID/PID gamepad list as a fallback solution with few special cases where the gamepad may need some tricks even when feedback report tells otherwise. Especially few Razor and Nacon gamepads need special tricks.

@nefarius
Copy link

Cool! I had no idea this existed for the DS4 as well, I stumbled upon this with the DS3 on accident and haven't yet had the motivation to attempt decoding the rather detailed returned payload.

@Ryochan7
Copy link
Owner

Don't think I have seen this documented anywhere else. That would make supporting 3rd party DS4 controllers much easier. Like mika has mentioned, there might still be a need for a known hardware list to set some feature flags for some known 3rd party DS4 controllers.

I should look at that report in Hid Report Inspector later.

@dogtopus
Copy link
Author

I had no idea this existed for the DS4 as well

To be exact, this is only seen on 3rd party PS4 controllers. That could be part of the reason why it's so obscure since those peripherals are never really popular. Even when one tries to implement say a steering wheel emulator (which no first party implementation exist IMO), they would just copy the report as-is and treat it as a constant and never attempt to understand what it truly means.

Don't think I have seen this documented anywhere else.

I always had a txt lying around that has sample responses from different controllers as well as the general structure of the report. However it's pretty messy and therefore I never posted it publicly.

@Ryochan7
Copy link
Owner

Ryochan7 commented Aug 6, 2021

Never mind. Issue #2406 shows some auto-magical solution should probably never be implemented. If anything, fewer controllers will likely be supported in DS4Windows going forward.

Also, the hid-sony Linux driver, which has been maintained by Sony for a while, still uses a hard-coded list.

https://www.phoronix.com/scan.php?page=news_item&px=Sony-HID-Official-But-Clones

@Ryochan7 Ryochan7 closed this as completed Aug 6, 2021
@dogtopus
Copy link
Author

dogtopus commented Aug 6, 2021

While also being a fan of "official and nothing else" (see the mess also known as *cough* hid-nintendo *cough*. That thing never gets merged into mainline because it's "not ready"), I have to partially disagree with you. If we can fully understand the report format of 0x03 (or just study it well enough), plus the certification process by $**¥, we should see a pretty good result with officially licensed controllers while be able to remove a big chunk of quirks from the quirk table. For knockoffs it will of course be "best effort" instead, like if it breaks it breaks.

The reason for why hid-sony doesn't have 3rd party controller support is unknown to me either, but I guess it's probably because of the "already messy" codebase and probably also have something to do with $**¥'s licensing terms, or just peripheral manufacturers agree on "consumers should buy our PC peripherals if they want to use it on PC" and be able to convince $**¥ (see e.g. L***T*** steering wheels)

But I guess on the other hand, there aren't many licensed peripherals for PS4 to begin with so a quirk table is still somewhat manageable. Maybe with PS5 this will change a bit but it ultimately depends on whether or not you want to adopt it.

@nefarius
Copy link

nefarius commented Aug 6, 2021

Users need to understand that it is not the responsibility of people like @Ryochan7 to provide free fixes for screwed up firmware of counterfeit hardware manufacturers who themselves couldn't give less of a damn about helping community software flourish. They produce that ASIC crap as cheap as possible and invest into scamming tricking customers into thinking it's legit hardware and then offload all the issues to someone else, like us. No, just a big fat no. If you buy counterfeit hardware, you support these clowns and make our lives miserable by flooding pointless support requests. Stop giving these leeches your money and stop opening issues about it. My two cents.

@dogtopus
Copy link
Author

dogtopus commented Aug 6, 2021

Well I mostly have a love-hate relationship with those bootleggers. Sure they cause a lot of problems and redirect the blames, but they also provided cheap 90% OK clones that I can potentially repurpose (swapping PCBs, etc.) or gave insights on how some "less known" parts of the controller really work. Ironically due to lack of quality control and thus security it's sometimes easier to hack them and get the firmware than official controllers. Again this is uncertain since they are bootlegs but they more or less widen the attack surface.

But still bottom line: this has nothing to do with consumers. Consumers should be informed and stop buying knockoff peripherals.

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

No branches or pull requests

4 participants