Ryochan7 / DS4Windows

Like those other ds4tools, but sexier
https://ryochan7.github.io/ds4windows-site/
GNU General Public License v3.0
6.93k stars 802 forks source link

Genshin Impact doesn't detect DualSense Controller that is connected via Virtual DualShock 4 #1632

Closed Animus120 closed 3 years ago

Animus120 commented 3 years ago

Describe the bug I'm trying to play Genshin Impact using my DualSense that is emulating a Virtual DualShock 4 so I can get the PlayStation prompt instead of the Xbox in-game. This does not work. Genshin will detect DualSense IF it is running on HIDGuardian using Virtual 360. I have attached a logfile to help detecting what is up and how to fix this. Genshin DualSense.txt

Desktop (please complete the following information):

Additional context Genshin can detect DualSense as DualShock 4 without the need of DS4Windows, but I really like that we can customize the CREATE button on the DualSense as a shortcut for my application to take screenshot in-game. Also, I can use custom lightbar colors during gameplay, which reduce the battery drain of DualSense.

mika-n commented 3 years ago

Are you using Steam? Maybe the issue described below? At some point the simple solution was to rename DS4Windows.exe as for example DPadApp.exe (and DPadApp.exe.config), but these days there are more and more games where even this doesn't work. Some games deliberately ignore virtual output devices (I guess as part of multiplayer "cheat checks" to fight against some players using macro engine to do super fast Fortnite building). https://github.com/Ryochan7/DS4Windows/wiki/Troubleshooting#steam-doesnt-see-the-virtual-output-controller-if-a-profile-uses-the-dualshock4-output-type-steam-sees-the-ds4-controller-only-if-ds4windows-uses-xbox360-output-controller-type

Animus120 commented 3 years ago

Are you using Steam? Maybe the issue described below? At some point the simple solution was to rename DS4Windows.exe as for example DPadApp.exe (and DPadApp.exe.config), but these days there are more and more games where event this doesn't work. Some games deliberately ignore virtual output devices (I guess as part of multiplayer "cheat checks" to fight against some players using macro engine to do super fast Fortnite building). https://github.com/Ryochan7/DS4Windows/wiki/Troubleshooting#steam-doesnt-see-the-virtual-output-controller-if-a-profile-uses-the-dualshock4-output-type-steam-sees-the-ds4-controller-only-if-ds4windows-uses-xbox360-output-controller-type

Yes, I am running Steam when I launch Genshin, but I don't use the Steam build-in Controller Support. Upon seeing the link you linked, I'll give that a shot once I return from work and report back if this does solves it.

Ryochan7 commented 3 years ago

I'm not entirely sure it is true but PCGamingWiki claims that Genshin Impact supports the DS4 v.2 (USB and BT) with no mention of DS4 v.1 support. ViGEmBus emulates a USB connected DS4 v.1 in DualShock 4 emulation mode.

https://www.pcgamingwiki.com/wiki/Genshin_Impact

Animus120 commented 3 years ago

I'm not entirely sure it is true but PCGamingWiki claims that Genshin Impact supports the DS4 v.2 (USB and BT) with no mention of DS4 v.1 support. ViGEmBus emulates a USB connected DS4 v.1 in DualShock 4 emulation mode.

https://www.pcgamingwiki.com/wiki/Genshin_Impact

Interesting. I finally managed to get DS4Windows to run while playing Genshin, but now lies a weird problem: it seems that whatever custom command I use on DS4W under DS4 emulation, it just doesn't work. Further clarification: I tried to use the CREATE button on my DualSense to take screenshot with NVIDIA Experience, the macro is Alt+F1 for me. The macro doesn't work on Genshin, yet it works on any other game. What could possibly cause this?

Serfrost commented 3 years ago

I have the same controller model as you, DualSense set to emulate DS4 within DS4Windows; it works in Genshin just fine. Please make sure you don't have Hide DS4 enabled in DS4Windows settings. Secondly, ensure you've updated DS4Windows in addition to your Vidgembus installation.

Animus120 commented 3 years ago

I have the same controller model as you, DualSense set to emulate DS4 within DS4Windows; it works in Genshin just fine. Please make sure you don't have Hide DS4 enabled in DS4Windows settings. Secondly, ensure you've updated DS4Windows in addition to your Vidgembus installation.

Ah, it works now, I just have to update my DS4W. But it seems that the vibration is not working?

Serfrost commented 3 years ago

@Animus120 Ah, it works now, I just have to update my DS4W. But it seems that the vibration is not working?

Are you aware of when the game is normally supposed to vibrate?

Regardless - within your current DS4Windows Controller Profile, go to the [Other] tab, make sure [Enable output data to DS4] is enabled. If it was disabled, enable it. You must then save the profile, then disconnect and reconnect your controller.

You can also check within DS4Window's Settings tab, within the [Device Settings] option, ensure DualSense Rumble Emulation is enabled and decide what Rumble Strength you want.

Vibration works fine on my end; including the [Test Heavy] and [Test Light] settings at the top of [Other]

Serfrost commented 3 years ago

Considering the nature of this Issue's title, I'd recommend closing this issue since it seems you already got it resolved.

Animus120 commented 3 years ago

@Animus120 Ah, it works now, I just have to update my DS4W. But it seems that the vibration is not working?

Are you aware of when the game is normally supposed to vibrate?

Regardless - within your current DS4Windows Controller Profile, go to the [Other] tab, make sure [Enable output data to DS4] is enabled. If it was disabled, enable it. You must then save the profile, then disconnect and reconnect your controller.

You can also check within DS4Window's Settings tab, within the [Device Settings] option, ensure DualSense Rumble Emulation is enabled and decide what Rumble Strength you want.

Vibration works fine on my end; including the [Test Heavy] and [Test Light] settings at the top of [Other]

Yes, I am aware of when it's supposed to vibrate because I used a X1 controller to play Genshin prior to getting my DualSense. I checked the setting you mentioned and it's all on. I'm currently at work right now so I'll test it out when I got back home to see if playing Genshin via DS4 Emulation will vibrate in-game. But yes, I'll close the issue now because it's playable now. Thanks!

Serfrost commented 3 years ago

I don't think I tested rumble with DS4 Emulation, actually. I did have rumble working with X360 Emulation though. If you test this and it results in only X360 working, that's when I would open up a new issue. Take care.

Animus120 commented 3 years ago

I don't think I tested rumble with DS4 Emulation, actually. I did have rumble working with X360 Emulation though. If you test this and it results in only X360 working, that's when I would open up a new issue. Take care.

That's exactly what happens. The rumble will work while playing Genshin on my DualSense if it's running via X360 emulation. I'll check it out later tonight to see if playing Genshin with my DualSense via DS4 emulation will rumble or not, but if it doesn't, then I'll open up a new issue.

mika-n commented 3 years ago

are you sure the game supports rumble with a native physical DS4 gamepad? Someone with Genshin and DS4 gamepad probably should test it (without DS4Windows app) and verify that the game supports rumble over dinput interface.

Serfrost commented 3 years ago

@mika-n Good call, I can confirm that Genshin doesn't provide rumble feedback to a native physical DS4 gamepad (this, of course, was with DS4Windows turned off as suggested.) It seems rumble only works if you use DS4Windows and set it to X360 emulation, which I guess can be expected at this point.

@Animus120 I think it's safe to say this isn't a DS4Windows issue, rather it's just how the game behaves with Dinput devices.

Animus120 commented 3 years ago

Thank you for clarification! I can safely put this issue to a close now.

kin-patsu commented 3 years ago

I'm not sure of what got changed with latest two updates (or even if it's an issue with Genshin), but now my DualSense stopped working as it should with the game. I haven't changed anything, profile-wise, yet Genshin detects my controller as an Xbox controller (normally it'd show PS Button Prompts). The game also registers the right stick always pointing up, moving the camera and making it virtually impossible to play, and additionally, L2 seems to be bound to d-pad down and while also lowering the camera. EDIT: I just cross checked and apparently this seems to be an issue with the latest Genshin update, not some fault with DS4Windows

Serfrost commented 3 years ago

@kin-patsu

  1. Set your DualSense to run as an emulated DS4 in DS4Windows instead of Xbox 360. It's at the bottom of one of the tabs for your current Controller Profile. Save and close your profile.

  2. At the settings tab of DS4 Windows, enable the Hide DS4 option.

  3. Afterwards, open a Windows Run prompt and run Joy.cpl

  4. Make sure Genshin isn't running. Stop DS4Windows. Unplug your controller.

  5. Check Joy.cpl, make sure no controllers are showing up. If a controller is shown, get it to be removed. You might have to restart your computer if you can't get it to go away.

  6. Start DS4Windows and then plug in your DualSense again. Joy.cpl should only show one controller. This means Hide DS4 is working.

  7. Now you can run Genshin and it should show the PS Buttons. Make sure not to disconnect your controller while Genshin is on or Genshin will hijack the controller before DS4Windows can hook to it in exclusive mode.

The problem appears to be having two controller instances in Joy.cpl and Genshin trying to use both of them. As long as only one instance is shown, it should work fine. I had the same problem yesterday.

kin-patsu commented 3 years ago

@Serfrost That worked flawlessly, thanks a lot. I got somewhat stuck at point 6 while doing it, as something was interfering with DS4W Exclusive Mode, but ultimately I managed to get it to work

mika-n commented 3 years ago

That worked flawlessly, thanks a lot. I got somewhat stuck at point 6 while doing it, as something was interfering with DS4W Exclusive Mode, but ultimately I managed to get it to work

Other apps can easily interfere with exclusive mode (=Hide DS4 Controller option in DS4Windows app). Reasons are beyond the app and if tips in the following page would not help then there is nothing DS4Windows app can do about it. HidGuardian would be the next option. https://github.com/Ryochan7/DS4Windows/wiki/Exclusive-Mode-(Hide-DS4-Controller-config-option)-tips-and-issues

Serfrost commented 3 years ago

@kin-patsu as @mika-n stated, HIDGuardian is your best bet here so you never have to worry about this again unless you update Windows.

I just got it set up using the Test Installer in mika-n's link and it's working perfectly. You will need the HIDHideTest helper application in that section to hide your DualSense, as the DualSense isn't hidden by default unlike a DS4. It should be relatively easy to figure out the HIDHideTest helper application.

You might have to enable Windows Test Mode Driver Signing for HIDGuardian to be installed.

For me, after HIDGuardian installation....

  1. Disabled DS4Window's Hide DS4 option.
  2. Closed DS4Windows entirely, unplugged & re-plugged my DualSense controller.
  3. Opened the HIDHideTest app.
  4. Selected the [Wireless Controller] entry (if there isn't one, make sure your controller is plugged in, and then restart the HIDHideTest helper tool.)
  5. Then selected the [HID\VID_054C&PID_0CE6&MI_03] entry & clicked [Add].
  6. Afterwards I opened & started DS4Windows.

If it's all set up correctly, your controller in DS4Windows should have a Key Icon - this signifies exclusive access to the controller with HIDGuardian was granted to DS4Windows. You should also check Joy.cpl for the regular "Wireless Controller" instance within joy.cpl; it should not exist anymore, unless:

If a Wireless Controller is shown in joy.cpl, it should only be while DS4Windows is in use, by using the "Emulated Controller: DualShock4" option for the controller profile in the [Other] tab -- otherwise the only controller entry in joy.cpl should be an Xbox 360 gamepad which is from "Emulated Controller: Xbox 360"

Edit: If joy.cpl shows no controller at all while DS4Windows is in use with "Emulated Controller: DualShock 4", please refer to the comments below.

I recommend keeping the TestInstaller and HIDHideTest helper saved in DS4Window's home folder. You may need to adjust it at some point.

Animus120 commented 3 years ago

Thanks for the nice writeup @Serfrost , been trying to setup HIDGuardian but it always fails for my DualSense (thus why I defer to Hide DS4 option since it's simpler). Will try that later for a more permanent solution.

kin-patsu commented 3 years ago

@Serfrost I just tried what you wrote, the key icon does show in DS4Windows so the controller definitely is in exclusive mode, however Genshin will detect it only as a 360 controller (even though it's setup to emulate a DS4) and will refuse most inputs unless I change my profile to emulate a 360 controller

~~EDIT: After rebooting my PC Genshin totally refuses to even see the controller. Nothing will show under joy.cpl, and likewise the controller won't show up in gamepad-tester.com This seems to only happen when the current profile is set to DS4 mode, while when set as a 360 controller everything shows up just fine. In this case, the controller is displayed as "Controller (XBOX 360 For Windows)" in joy.cpl~~

EDIT 2: I figured out why it didn't work. After running some tests, after using the Test Installer and HIDHideTest, my DualSense stopped working everywhere unless set as 360 controller. So I gave a better look at HIDHideTest, which by default comes with a few pre-included entries for what I think is the DS4. Removing those and leaving only the DualSense (HID\VID_054C&PID_0CE6&MI_03) makes everything work perfectly

mika-n commented 3 years ago

When DS4Windows profile is set to output events via a virtual DS4 gamepad then ViGem driver creates that devices as DS4 revision1 (DS4v1). Now, if HidGuardian AffectedDevices list has a DS4v1 hardware type ID then HidGuardian will hide both the physical DualSence gamepad AND the virtual output DS4v1 gamepad. This is why it didn't work because by default HidGuardian/TestInstaller lists both DS4v1 and DS4v2 hardware type IDs.

If you have a physical DS4v2 gamepad or DualSense gamepad then by removing DS4v1 from HidGuardian affectedDevices registry setting makes the virtual ds4v1 gamepad visible for games.

Serfrost commented 3 years ago

@kin-patsu So I gave a better look at HIDHideTest, which by default comes with a few pre-included entries for what I think is the DS4. Removing those [...] makes everything work perfectly

Peculiar, I didn't have to do this on my end from what I remember, but that's good information to have. mika-n's explanation addresses why this will occur though and explains why you had the problem.

In either case, I'm glad you got it working. Enjoy.