CTD when I switch/disconnect keyboard and/or mouse or USB device

That wouldn’t explain it freezing when i connect / disconnect my mouse, or any other USB device (phone, keyboard, headset stand, etc).

I can launch MSFS with no sound devices connected or enabled, no problem. It doesn’t make a difference to it freezing on device connection / disconnection.

The fact this has been going on since Oct 2022, and has apparently been fixed (clearly hasn’t), is a joke.

I’ve found that the freezes have started occurring even when not connecting / disconnecting any devices. As this is very annoying, I actually sat down today and spent some time trying to figure out what’s going on here. As I’m a software developer, I used Visual Studio to connect the debugger to FlightSimulator.exe and see what it’s freezing on.

In my case at least, it’s freezing on hid.dll!DeviceIoControlHelper:

It seemed likely that this was caused by a dodgy USB device that doesn’t respond to HID requests in a timely fashion. With this pointer in mind, I started disconnecting various USB HID devices I had to try and work out what is causing the issue for me.

In my case, this seems to be entirely caused by my USB DAC (HIFIME SABRE 9018) that I was using in place of my motherboard’s sound ‘card’. Disabling that device has resolved all my issues and I can now connect new devices with just a 1 second pause.

If you’re still having the freezes, I suggest you go through your devices one by one, seeing if removing (or just disabling them in Device Manager) fixes the issue.

3 Likes

Welcome to using WASM when it comes to USB device disconnects. This issue is not going to be fixed as per W3C (world wide web consortium) that defines the standards for WASM.

WASM was a BIG mistake, it should never have been used in a flight simulator as it abstract from the hardware (such as USB devices). To comply with WASM the USB hardware vendor would need to make changes both firmware and driver … that’s not going to happen for a game like MSFS.

I’m not sure why you think this has anything to do with WASM? It’s the simulator itself that is freezing, and it’s doing that through a call to DirectInput. DirectInput then does HID device enumeration that causes the issue with one device on my system. It’s a very rare game that would be developed for Windows without using some sort of hardware abstraction like DirectInput, XInput or similar!

I’ve created a little tool that people can use to check if they’re suffering the same problem that I was. It’s available at Releases · ngreatorex/DIED · GitHub. Obviously, usual warning about running executables found on the Internet applies! If you’re paranoid you can instead clone the code repository and build it with the .NET SDK.

If you run that program and then connect/disconnect a USB device, AND you’re suffering the same issue I had, then you should see a line logged that the enumeration took more than 1000ms (in my case it was around 5000ms):

image

If you do see a similar line, then I would suggest disabling your USB devices in Device Manager one by one until you can connect/disconnect USB devices without getting a line in the window of my app. I’d suggest starting with devices listed under Human Interface Devices, but don’t accidentally disable your keyboard and mouse!

It’s worth noting that connecting/disconnecting the device that was causing my problem did NOT create a line in my program - only connecting/disconnecting a separate device (like my TCA sidestick) while the problematic device was enabled would produce the line.

Hope this helps someone :slight_smile:

1 Like

Still getting the complete crash when connecting a Logitech Virtuoso Wireless Headset via USB receiver. The fact this is still happening several years after release is ridiculous.

A post was split to a new topic: CTD code c0000409

It is even in 2025 a problem
09.01.2025 19:34.12 (disconnecting Jabra Link 400)
Fehlerbucket 1689286712178778829, Typ 4

07.01.2025 21:08:30
Fehlerbucket 1517695789080119333, Typ 4

5 years and still not fixed! Even P3D doesn’t crash on a USB device disconnect. This game is lame!