First action
Update/reinstall the device driver.
Use the error code as a Windows device-state clue. It does not by itself identify the exact failed component inside the hardware.
Do not stop at the code disappearing
- 1
Restart and retest.
- 2
If Code 31 persists, use the hardware manufacturer's support path.
After Windows reports the device normally, run the matching DeviceOK test when one exists—for example camera, microphone, keyboard, mouse, controller or audio—to confirm the user-facing function works.