-
Notifications
You must be signed in to change notification settings - Fork 807
DS4Windows hangs when disconnecting USB controller #3
Comments
Thanks for pointing out this problem. The underlying file stream being used goes into an invalid state when the USB controller is disconnected and the final call to close the stream caused the problem. The old code did not use the FileStream class for reading so this was not an issue before. I will get a new build up soon. |
Really really thanks Ryo, I'm glad that someone is updating ds4windows. Hope that with the new windows ds4windows will work without administrator permission. |
There are only two areas where DS4Windows should need administrator privileges. Exclusive mode would be one and there is no way around that problem. Security features in Windows require that an administrator account be used to disable and re-enable a device in order to be able to use a device in exclusive mode. I believe DS4Windows already checks if it can open a device in exclusive mode first before it attempts to disable and re-enable the device so there isn't much more that DS4Windows can do in that regard. The other area would be for KB+M emulation in games that run as the administrator; one example of a game in my collection that runs as the administrator is Mass Effect 1. There is no way to work around that problem using the native SendInput API and running DS4Windows as the administrator won't work in all scenarios such as UAC prompts. Paying for an expensive signing certification could work around the UAC problem but DS4Windows would still have to be run as the administrator. The only way, that I know of, to truly work around the problem of needed to run DS4Windows as the admin in this scenario would be to use the vmulti virtual KB+M driver within DS4Windows. It works around all those problems and it even works when playing games that use anti-cheat software, such as HackShield, without any major worry about getting your account flagged. |
Hi Ryochan, I'm not sure if it's possible to reopen this issue or if I need to create a new one, but I'm meeting the same problem on Windows 7 Ultimate (64-bit) with all versions of DS4Windows from 1.4.54 to 1.4.67. The driver works well but it crashes every time I unplug my controller from the mini USB cable. The only version that doesn't crash is the 1.4.53 build (which is incidentally the only one with 32-bit support, although I'm not sure it's relevant). |
That would be the version before overlapped IO was implemented. Is there any error log when the app crashes that you could post? I would assume that the error is due to some exception not getting caught when attempting to close an invalid file handle but the only relevant exception that I know of is currently being caught. I am usually against doing a grand catch of all exceptions so it would be nice to isolate the exact exception causing problems. In the meantime, I will re-open this issue. |
.NET does post some error information when an application crashes. You have to open the Event Viewer from Control Panel > System and Security > Administrative Tools > Event Viewer. Expand Windows Logs, selection Application and look for an error with a source of .NET Runtime. Here is an example showing an error message in the Event Viewer; this error would occur when closing a filestream if the exception is not caught.
|
Alright, I think I've spotted to relevant logs happening two seconds apart. Hope it helps! Event 1026, .NET Runtime
Event 1000, Application Error
|
Can you give the following test build a try? https://drive.google.com/open?id=0B6yGHDx0CFzDS21QNVlpWVFlaTA |
I quickly tested this build by unplugging and replugging the controller a dozen times, without a single crash. I didn't notice any performance regression ingame either. I will test it further tomorrow, but so far it looks very stable. Thank you! :) |
As far as I can tell, this build works great so far. Thanks for your continous support! |
Can't get bluetooth mode working at all with .68 build. |
shinra358 try remove the device (from bluetooth and other devices) and install again. I had the same problem. |
ok, that did the trick. thanks. |
Update to Version 1.4.70
Whenever I pull out the USB cable of a controller, DS4Windows hangs/crashes. (Win10 x64)
Happens in both shared and exclusive modes.
The text was updated successfully, but these errors were encountered: