RPCS3 eventually crashes after disconnecting DS3/4 controllers
Quick summary
Title pretty much sums up the issue. RPCS3 eventually closes itself if the game window is left unfocused or in background for a random period of time. I had to check the Event Viewer in order to get some information, since the emulator simply closes, no window will appear informing of the crash.
While it's such a extremely specific issue that could just be "fixed" by simply focusing the window, I think it was worth reporting.
I'll attach a log from Metal Gear Solid 4 as an example (it still happens in other games) and a screenshot of what Event Viewer says.
Details
No response
Attach a log file
Attach capture files for visual issues
No response
System configuration
OS: Windows 10 Pro 22H2 19045.3086 CPU: AMD Ryzen 7 5800X GPU: NVIDIA GeForce RTX 2060 [driver 536.23.0.0]
Other details
No response
That issue happen randomly in Linux for some games when starting in moment building spu cache too.
issues with patches applied are not allowed
Any chance this can be reopened? @Megamouse
Here's the log without patches applied: RPCS3.log
And info from event viewer:
I also made a fresh install of Windows thinking it was something system related but still happens.
After checking several builds, looks like 0.0.25-14522 is the last build not exhibiting this behaviour. Seems like #13175 introduces the issue.
I can leave 14522 in background / unfocused and it'll never crash. Been able to leave it running for over 2 hours without issues, while 14523 onwards it can crash anytime between 5m or 30m (or take even longer) for no particular reason in the same state. The times that it doesn't crash, it will if you close, giving the same errors mentioned in the comments before.
0.0.25-14522 working.log.gz 0.0.25-14523 broken.log
On the first runs I did in 14523 and 14525, instead of ntdll.dll, I got AcLayers.dll as faulty module, but on later tests it went back to ntdll.dll (still got the same exception code), don't know why:
Seems like dshidmini and DS4Windows have some sort of incompatibility issue with hidapi 0.0.13. When a controller is used wirelessly with the Idle disconnect setting enabled, it'll cause the crash, sometimes closer to the disconnect time or later.
For DS4Windows you can simply disable the setting to avoid it, dshidmini doesn't have an option to turn it off but setting the timer high enough seems to work.
Closing as it's not an issue with RPCS3.
Well, I guess I'm back with this since after asking around I got told that the issue is likely on RPCS3 side.
I had some people to test with me using the native handler RPCS3 provides for DS4 and upon disconnecting the controllers it'd almost instantly crash to desktop (just like DS4W). So I guess the problem is indeed with the handlers the emulator provides and how these handle the controller disconnects.
Also while testing I decided to use SDL as a handler, tried for 20 mins without any remapping software and double the time with DS4Windows, didn't crash at all. Same thing with DS3 (I couldn't try with the official Sony driver as the link was down, but it's not recommended either), it eventually crashes after being disconnected. I wanted to try it with SDL but I'm afraid it doesn't pick the controller.
I'm reopening and renaming the issue more accordingly, since it was never an issue with it being unfocused or in background.
Forgot to add a new log, here it is: RPCS3.log
I'm not sure if Xinput or DualSense would give similar results since I don't own a XBOX controller or a Dualsense, could try emulating Xinput if needed.
Emulated Xinput on both DS3 and DS4. Tested for a bit over an hour and neither crashed.
Meanwhile, using the native handler provided by the emulator, both crashed before the 5 min mark.
ds3 handler.log ds4 handler.log
If there's a better way to test or gather relevant information to fix this issue, let me know.
Commenting to follow and confirm I'm seeing this issue too. Games will crash after my Dualsense controller disconnects due to inactivity, but not immediately after. It takes a few minutes after the idle timeout disconnection occurs.
This is still an issue, made a video of the crash happening after disconnecting a DS4 while using the Dualshock 4 handler. Same issue with DS3 and DualSense, the rest of the handlers are unaffected.
Just as a reminder since the whole issue became convoluted back when I was trying to find what caused it:
- #13175 introduced the issue (prior builds don't exhibit the behaviour, potentially caused by the hidapi update from 0.12.0 to 0.13.0?)
- Happens without remapping software
- For DS3 it happens with the official drivers as well
Happens on Ps5 dualsense controller too ^
Had it happen on Linux as well, though it seems to take longer than Windows and also takes longer for the emulator to crash to desktop.
DS3 Handler log and Video DS4 Handler log and Video
Sped up both videos the moment the controllers are disconnected since one took 8 mins and the other 12 until it crashed.
@ItsLaguna, @all having the issue. Please test #17478, possibly on both Windows and Linux, and report in #17478 if the issue is finally fixed.