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

dinput/xinput dualshock 4 no longer works #852

Open
orcutt989 opened this issue Aug 15, 2022 · 12 comments
Open

dinput/xinput dualshock 4 no longer works #852

orcutt989 opened this issue Aug 15, 2022 · 12 comments

Comments

@orcutt989
Copy link

orcutt989 commented Aug 15, 2022

Doesnt seem like the dinput dualshock 4 profile is working anymore via bluetooth. I have to switch the driver to sdl2 for it to work. Been using retroarch for years. This happens on stable and nightly. works when controller is plugged in but not over bluetooth on dinput driver.

i also switched the driver to xinput, and that works wired, but not over bluetooth?

@orcutt989 orcutt989 changed the title dinput dualshock 4 no longer works dinput/xinput dualshock 4 no longer works Aug 15, 2022
@offalynne
Copy link
Contributor

offalynne commented Aug 15, 2022

Edit: See #852 (comment) for the working fix

Seems like a bad Microsoft driver that comes with Windows Update may have broken DirectInput support for PS4 controllers over Bluetooth.

In Device Manager:

  • Enable View > Show hidden devices
  • Look for Wireless Controller under Sound, video and game controllers
  • In Wireless Controller Properties (right or double click)
  • Select Driver > Uninstall Device > Uninstall
  • Restart Windows
  • Pair the device again, it should work as expected

@offalynne
Copy link
Contributor

offalynne commented Aug 15, 2022

Also make sure PlayStation Configuration Support is not enabled in Steam by exiting Steam or toggling the setting Off: https://user-images.githubusercontent.com/16347732/184718063-93939c17-19a0-44fa-b9e2-8c5d50549852.png.

If improperly configured you'll have to exit/restart Steam before re-pairing the device.

You can test that the device is sending input properly by checking the Game Controllers dialog in Windows.

SDL should work regardless, since it interfaces with the device directly over HID.

@orcutt989
Copy link
Author

orcutt989 commented Aug 15, 2022

A bad Microsoft driver that comes with Windows Update has broken DirectInput support for PS4 controllers over Bluetooth.

Awesome answers thanks! I was about to figure out how to remove DirectX and reinstall to repair DirectInput as I had a hunch it had something to do with a Windows update.

However it doesnt seem to be listed under Sound, video, and game controllers.
image

There is a Wireles Controller under Bluetooth devices though.
image

You can test that the device is sending input properly by checking the Game Controllers dialog in Windows.

Yes this is how I knew something was wrong as the Dualshock4 controller over bluetooth was the only controller that wasn't showing any input from this menu.

Also make sure PlayStation Configuration Support is not enabled in Steam by exiting Steam or toggling the setting Off: https://user-images.githubusercontent.com/16347732/184718063-93939c17-19a0-44fa-b9e2-8c5d50549852.png.

Yep I have controller support disabled 💯 in Steam.

@offalynne unfortunately it seems I'm having the same problem.

  • Confirmed steam is not open, and PS4 controller support is disabled anyways.
  • No Wireless Controller under Sound video and game controllers
  • Removed from Bluetooth area in Device manager, rebooted, repaired, same problem. Controller only works on SDL2 driver in retroarch.

image

image

Nothing happens in this window so its still doing the same thing 😢

@offalynne
Copy link
Contributor

Sorry, that sucks ! I have heard similar from other users. Thankfully this solved the problem for me but it doesn't seem to be generally applicable.

However it doesnt seem to be listed under Sound, video, and game controllers.
There is a Wireles Controller under Bluetooth devices though.

I suggest trying the same (checking the driver date, uninstalling the device, restarting, re-pairing) and seeing if that helps.

@orcutt989
Copy link
Author

Sorry, that sucks ! I have heard similar from other users. Thankfully this solved the problem for me but it doesn't seem to be generally applicable.

However it doesnt seem to be listed under Sound, video, and game controllers.

There is a Wireles Controller under Bluetooth devices though.

I suggest trying the same (checking the driver date, uninstalling the device, restarting, re-pairing) and seeing if that helps.

Thanks again for the followup. That is what I did above and unfortunately same behavior. 😭

@offalynne
Copy link
Contributor

We're discussing here, if you could join to help diagnose, would appreciate: https://discord.gg/Vrd2mTFs

@hizzlekizzle
Copy link
Contributor

what a hassle! but I'm glad you guys are on the case. Keep us posted on what you find out :)

@orcutt989
Copy link
Author

We're discussing here, if you could join to help diagnose, would appreciate: https://discord.gg/Vrd2mTFs

I joined and posted in #general.

@nefarius
Copy link

I cobbled together a little API sniffer tool to investigate this case and it appears that dwm.exe (or one of its loaded DLLs) sends a packet to the DS4 switching it into "extended input report" mode which causes the observed behaviour:

image

Now to find out why it does that and if we can identify the actual culprit within dwm.exe 🤔

@nefarius
Copy link

Found it, Windows.Gaming.Input.dll is instructing the DS4 to switch to extended report, call stack:

ds4sniffer.dll+0x5291
Windows.Gaming.Input.dll!DllGetClassObject+0x3ad2c
Windows.Gaming.Input.dll!DllGetClassObject+0x323fd
Windows.Gaming.Input.dll!DllGetClassObject+0x325ce
Windows.Gaming.Input.dll!DllGetClassObject+0x30a7d
Windows.Gaming.Input.dll!DllGetClassObject+0x13689
Windows.Gaming.Input.dll!DllGetClassObject+0x133e6
Windows.Gaming.Input.dll!DllGetClassObject+0x3220c
Windows.Gaming.Input.dll!DllGetClassObject+0x1096b
Windows.Gaming.Input.dll!DllGetClassObject+0x63bb
Windows.Gaming.Input.dll!DllGetClassObject+0x6a56
Windows.Gaming.Input.dll!DllGetClassObject+0x5b2a
Windows.Gaming.Input.dll!DllGetClassObject+0x1431f
Windows.Gaming.Input.dll!DllGetClassObject+0x12e9
Windows.Gaming.Input.dll!DllGetClassObject+0x43da
Windows.Gaming.Input.dll!DllGetClassObject+0x421
Windows.Gaming.Input.dll!DllGetActivationFactory+0x208
combase.dll!CoCreateInstance+0x2376
combase.dll!RoGetActivationFactory+0x445
gameinput.dll!DllGetClassObject+0x1c8b
gameinput.dll!DllGetClassObject+0x6a9b
gameinput.dll!DllGetClassObject+0x7a1b
Windows.Gaming.Input.dll!DllGetClassObject+0x46bcf
Windows.Gaming.Input.dll+0x88c7
Windows.Gaming.Input.dll!DllGetClassObject+0x47129
Windows.Gaming.Input.dll!DllGetClassObject+0x6c04
SHCORE.dll!SHStrDupA+0x3002
SHCORE.dll!SHTaskPoolQueueTask+0x1295
SHCORE.dll!SHTaskPoolQueueTask+0x1170
SHCORE.dll!SHStrDupW+0x2a1
KERNEL32.DLL!BaseThreadInitThunk+0x14
ntdll.dll!RtlUserThreadStart+0x21

So not a driver topic but definitely something Microsoft did 😉

@orcutt989
Copy link
Author

orcutt989 commented Aug 19, 2022

Solution for me was to download HidHide https://github.com/ViGEm/HidHide, and set the following options and reconnect the controller. Downside is cannot navigate Windows Game Bar with DS4, but I have that disabled for performance reasons anyways.

How to configuer HidHide-

image

image

Thanks to everyone for the help! Especially @nefarius

@nefarius
Copy link

nefarius commented Aug 19, 2022

For those interested in the technical details: the DS4 on Bluetooth supports an alternate input report mode called extended input report which is basically a bigger packet that carries all of the controller features (touch, gyro, ...) in comparison with the default mode that only presents the face buttons and axes. To get the DS4 into this extended mode, you need to instruct it to do so by sending it a special packet. Now it appears that Windows.Gaming.Input.dll or one of its dependency libraries sends said packet to any DS4 it detects upon connection. The side effect is that any API that depends on the default, shorter report (like DirectInput) now doesn't "see" input report updates anymore because the extended report uses a different ID. Using HidHide you can block dwm.exe from accessing and sending the packet to the DS4, essentially leaving it in its default state after connection. Beware though that if you launch Steam or DS4Windows, these tools will switch the controller into extended mode again until you close them and reconnect the controller.

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

No branches or pull requests

4 participants