PS4 controller detected twice on 2022.2

Hey everyone.
I’m posting here because I’m running out of ideas.

I’m working on a local coop game (PC), up to 3 players, and I support different type of gamepads (xbox variants, ps4, ps5, switch).

Everything was working fine for years.
I could use whatever type of pad, detecting the type properly, etc.
But for convenience in the last couple of months (because I’m also using my PS4 pads with my PS4), I was mostly testing with xbox pads only.

Recently, I retried with a PS4 pad, and here is the issue: the PS4 pad is well detected in Unity, but is also detected as an xbox controller.

Basically if I have a xbox pad connected and a PS4 pad connected, Gamepad.all is giving me 3 gamepads, instead of 2.

  • The thing is that I don’t have ds4windows or ds4tools installed (which I know could cause this problem).

  • My PS4 pad is connected via USB (not bluetooth, and I don’t have the adapter anyway).

  • Windows is not detecting any virtual pad (I have 2 pads only in the device list).

  • And an old version of my project running on 2020.2.3f1 doesn’t have this issue.
    Gamepad.all is giving me the correct amount of pads.

I know it was working on 2022.x.x at some point, but can’t figure out which version, since I retried with my PS4 pad just recently.
The only thing I know is that it was at least happening on 2022.2.5f1, and updating to latest (2022.2.19f1) doesn’t fix any issue.

If anyone have any idea, I would gladly appreciate the support.
Thank you so much in advance, and have a wonderful day.

Might be the steam controller overlay getting in the middle.

Hey thanks for your answer.

I’ve think of that, but steam is not started and I haven’t installed the steam API in my project

Do you think it can happen anyway?

It definitely has global effects. Try excluding the controller type in the big picture settings. Im not 100% sure this is your problem but its worth checking.

Did an update for the xbox game bar itself but still the same.
No solution so far :confused:

Still running out of idea :confused:
I’m not alone with that issue apparently: Switch Pro Controller is registered as Two Controllers at the same time (mixed A/B- and X/Y- events)

Something must have change recently in gamepad.all, creating those fake xbox controllers.

Yes, as mentioned above i Do have the same Problem, but with a switch pro Controller. I also have an older Projekt where everything was working fine.
I would also appreciate a solution…

I’ve tested by creating a project from scratch, just using Input System and displaying gamepad.all via debug.log.
It’s also happening, so it confirmed that it’s coming from a change in the editor / package at least.

I’ve reported a bug.
We’ll see.

Are you able to provide a link to the bug tracker? We are having the same issue as well.

It’s asking not to share the link publicly in the reporting portal for now.
But I can give you an update once I have one or if they create a Jira ticket, I’ll share the link for sure!

Seems to also be showing up ocassionally for Caves of Qud in our beta rollout of the input manager, fwiw.

No problem, in that case I’ll keep an eye on this thread so just an update here will suffice. Thanks.

QA is looking at it.
So far the tester can’t repro, but I don’t know which version he is using (waiting for that info).

I’ve provided repro by video and tested on another computer, and I can repro 100% on my side.
I’ll keep you posted.

1 Like

Thanks for keeping us updated. As already mentioned in this thread, some of us have this (or similar) problem with Switch Pro controller. As an ugly workaround I used this “method of detecting” this and disabling duplicate:

// We execute this code on `playerInput.onControlsChanged`
if (gamepad is UnityEngine.InputSystem.Switch.SwitchProControllerHID) {
    foreach (var item in Gamepad.all) {
       if ((item is UnityEngine.InputSystem.XInput.XInputController) && (Math.Abs(item.lastUpdateTime - gamepad.lastUpdateTime) < 0.1)) {
            Debug.Log($"Switch Pro controller detected and a copy of XInput was active at almost the same time. Disabling XInput device. `{gamepad}`; `{item}`");
            InputSystem.DisableDevice(item);
        }
    }
}

I shared this on the other thread some days ago, but realised it might be useful for other people here as well.

Thanks for the info.
I tried something similar myself, but sometimes, I got the “xinput version” of my PS4 pad being detected just before the real PS4 pad.

Kind of random.
So I couldn’t rely on update time unfortunately.

Hm, I think this is the case for our case as well – xinput is “detected” first, BUT, at least in our case, the inputs switch from one to another and back all the time, so at some point (usually very soon) this code “catches” them as the same.

Got another answer from the QA

Hi,
Thanks for getting in touch, we actually know about this issue internally, but sadly since the issue is internal and not public, we cannot provide you with the issue tracker link.
Please reach out to me if I can answer any questions or be of further help.

They closed my ticket as duplicate.
So I guess we wait.

1 Like

Thanks for the Update. Its a shame that we dont have any hint as to when a fix might be provided. I guess we have to keep the input-System in Our projects uptodate until suddenly the Bug is fixed :confused:

Pretty much yeah :confused:

Heaving the same issue since upgrading from 2021 LTS to 2022 LTS.

Very frustrating. It took me 3 hours to find out that the issue is not on my side. There are 2 issues though:

  • A/B X/Y swap
  • having two instances of controllers from one physical device - each triggering input

Just “watched” this thread to get latest infos. Please keep us updated if anyone knows more. I´ll wait until than with you guys and probably will use “zledas” solution.