Ryochan7 / DS4Windows

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

DS4Windows(?) continuously glitches my PC #1049

Closed AugmentedAntics closed 3 years ago

AugmentedAntics commented 4 years ago

This is a problem I've been having for the last several months with no answers in sight. Sometimes, after playing a game using my DS4, a laundry list of problems will begin to happen. USB ports will seemingly stop working if I dare disconnect any devices from them (but for some reason will continue to work as long as I don't), apps that use the controller refuse to open if the DS4 is plugged in or DS4Windows is running, and whenever this happens, I'm forced to do a hard shutdown with the power switch because Windows gets stuck on the sign-out screen if I try to shut it down through the Start menu. The DS4 itself will continue to function through all of this, but if I disconnect and reconnect it, it's out until a reboot. Also, when I check the Device Manager, it claims the Xbox 360 drivers aren't installed (even though they should be) until a reboot. DS4Windows also doesn't start with Windows even though I have the option ticked. It feels as if some interaction between the controller, DS4Windows, and my games is making my PC implode. It's seemingly random when this happens--it could happen once a day, or it could happen after maybe a week.

So far, I've tried many things I could think of: uninstalling and reinstalling the driver, a system restore, rolling back DS4Windows and its drivers, turning off Exclusive Mode; pretty much everything short of reinstalling the entire OS. No matter what I do, this issue continues to persist and it's been a constant source of frustration since this past summer despite having zero issues with DS4Windows from 2015 and until then.

mika-n commented 4 years ago

Do you still have the old ScpVBus drivers installed alongside the newer VigEm driver (nowadays used by DS4Windows on this site)? Surely you are not using the ancient JayKings version anymore with ScpVBus driver? https://github.com/Ryochan7/DS4Windows/releases

Anyway. Try to uninstall old ScpVBus drivers if you are using the DS4Windows from this site. It is a pain to get rid of all traces of ScpVBus driver. It may cause all sort of weird conflicts with other gamepad and BT/usb drivers. https://forums.vigem.org/topic/250/scptoolkit-removal-guide

AugmentedAntics commented 4 years ago

I should note that this a PC I've had for only a couple of years, and I've been using this DS4Windows since day 1. The old abandoned one has never been anywhere near this PC. However, I did use Driver Store Explorer and saw multiple instances of the newer driver for some reason. I uninstalled them and reinstalled straight from DS4Windows, but I don't know if this will fix the issue.

Corrodias commented 4 years ago

I've been having a similar issue. It may be a ViGEmBus driver bug. However, I have not yet narrowed it down to being caused by the driver. In my case, it seems to be after about 3 days every time. See also: https://github.com/ViGEm/ViGEmBus/issues/22

I don't believe the SCP driver was ever installed on that PC, but I'll check.

AugmentedAntics commented 4 years ago

That's the exact problem I've been having, and funny enough, that was posted around the same time I started having the issue.

mika-n commented 4 years ago

Do you use "auto-profile" feature of DS4Windows or manually regularly switch DS4Windows profiles? And are some of those profiles in xbox360 mode and other dualshock4 mode?

There has been cases in the past where Vigem driver (or client library) had bugs when a virtual controller was disconnected and re-connected. It didn't always cleanup itself properly (RAM leaks, thread leaks). In DS4Windows switching between different type of output controller profiles makes "Disconnect Vigem controller - Connect ViGem controller" sequences. However, if the old and the new profile are both using the same output controller type then DS4Windows app doesn't close and re-open ViGem controller objects.

Maybe this is causing some problems when ViGem controller object is closed/re-opened while the PC is running for days.

AugmentedAntics commented 4 years ago

I use auto-profiles all the time, but all of them use Xbox360 mode. Also, for me, it usually doesn't matter how many days my PC has been up. It could happen after one day since the last reboot, or one week. It also only seems to happen during gameplay, not when the controller isn't in use. Citra and PCSX2 usually seem to be the programs that trigger the issue the most, in my experience.

Corrodias commented 4 years ago

I don't use profile switching at all, it's just always connected with one profile.

Corrodias commented 4 years ago

@AugmentedAntics Do you happen to be using any sort of adapter to connect your DS4 to the PC? I'm using one, and I'll probably try not using it in order to identify or eliminate it as a possible trigger for this problem.

AugmentedAntics commented 4 years ago

No, I'm just using a regular USB cable.

AugmentedAntics commented 4 years ago

Well, now I have another issue with this: so, recently, I tried running DS4Windows as a Task rather than a Program. This time, whenever the driver deadlock occurs, I can close DS4Windows and reopen it, and it seems to find the controller. However, when I do this, DS4Windows spikes my CPU like crazy, games don't see the controller, and still, my PC refuses to reconnect any disconnected USB devices until a reboot.

Corrodias commented 4 years ago

That is basically identical to how it works for me, sometimes. Exactly how it works varies. Seems to be a driver problem, but it doesn't look like nefarius can make progress on diagnosing it until someone gets a kernel memory dump, and I'm reluctant to enable kernel debugging because I fear a performance impact, not to mention that it's a pain in the ass to get a dump.

Corrodias commented 4 years ago

I mention kernel debugging mode only because my PC refuses to do a memory dump to disk when it crashes for any reason. Most computers don't have this problem, and I am not sure why mine does.

@AugmentedAntics If yours cooperates better than mine does, I'd be very appreciative if you'd submit one for us so we can finally make progress on this problem.

Step 1: enable kernel memory dumps on halts https://docs.microsoft.com/en-us/windows-hardware/drivers/debugger/enabling-a-kernel-mode-dump-file

(Step 1.5: reboot, as it mentions on that page)

Step 2: wait for the problem to happen

Step 3: Force a BSOD using NotMyFault https://docs.microsoft.com/en-us/sysinternals/downloads/notmyfault

Step 4: Submit the kernel memory dump to nefarius at their email address listed on their GitHub profile. https://github.com/nefarius

Step 5: Comment on this issue stating that you've done so. https://github.com/ViGEm/ViGEmBus/issues/22

AugmentedAntics commented 4 years ago

I haven't had the deadlock happen to me in quite a while, and I'm not sure why. I think my "workaround" involves uninstalling and reinstalling the driver every time I restart my computer. Once I started doing that, it hasn't happened since. However, I'm still watching and waiting, because this could simply be a fluke and I'm just getting lucky that it hasn't been happening lately.

Ryochan7 commented 4 years ago

I would assume that it is just a lucky fluke. I'm sorry about the inconvenience but I don't think that DS4Windows is doing anything inherently wrong that would cause ViGEmBus to have issues. The last time I ran into an issue with ViGEmBus was when I switched to a "Use DInput Only" profile. After about 10 seconds, the switch to an Xbox 360 emulation profile did not expose a virtual Xbox 360 controller and the system got a BSOD when attempting to reboot; DS4Windows had already been closed.

I have not played around with the ViGemClient code nor the actual ViGEmBus driver code in some time. The last time I dealt with Nefarius he seemed pretty burnt out.

mika-n commented 3 years ago

closed as "nothing DS4Windows app can do about it". We can only hope that new versions of ViGen and/or HidGuardian solves those rare corner cases.

Corrodias commented 3 years ago

It's not solved yet, but there are two workarounds if this is still giving you (or any reader of this) trouble. One is to "stop" DS4Windows (thus disconnecting from the driver) when you're not actively using it. The other is to change your 360 controller driver to an older version, seen here. https://github.com/ViGEm/ViGEmBus/issues/22#issuecomment-753328936