USB - SetCurrentAlternateSetting failed: Insufficient system resources exist to complete the requested service.

Fourcade, Pierre 0 Reputation points
2024-10-15T10:32:56.6866667+00:00

Dear Microsoft community,

I am reaching out for help regarding an unexpected error we have encountered using libusb on Windows.

Regarding the issue: “Randomly,” with our custom USB device, libusb reports a systematic failure when attempting to set the device to a specific alternate setting. When setting the log levels to debug, the following issue is reported: “libusb: error [winusbx_set_interface_altsetting] SetCurrentAlternateSetting failed: Insufficient system resources exist to complete the requested service.”

I have looked into existing topics regarding this issue but found none answered, at least related to USB. Usually, the issue appears to be more observable on computers that are not often turned off, but we have had the issue at least once on every computer using Windows (only tested on Windows 10).

I believe that the issue is not related to libusb itself according to the error reported but to WinUSB.

What has been tested/verified:

  • It is apparently not linked to our USB firmware since the same device plugged into two different computers (one with the issue, the other without) shows no different behavior: on the computer without the issue, with the same device, our application works fine and the firmware shows no difference in behavior compared to when plugged into a computer with the issue.
  • We have tried with libusb version 1.0.24 and the latest version 1.0.27 without any change in the issue.
  • The only solution found to fix the issue is to manually uninstall all the devices in Windows Device Manager and restart the computer afterward. After this, the problem is no longer present.
  • The issue is not reproducible (making it more fun).
  • USB enumeration and USB properties on Windows report no issue when the problem occurs.

We are looking for some explanation of what might be causing the issue, if it is known, and if there is any workaround that we could implement.

Thank you in advance for your answer.

Best regards.

Windows Hardware Performance
Windows Hardware Performance
Windows: A family of Microsoft operating systems that run across personal computers, tablets, laptops, phones, internet of things devices, self-contained mixed reality headsets, large collaboration screens, and other devices.Hardware Performance: Delivering / providing hardware or hardware systems or adjusting / adapting hardware or hardware systems.
1,626 questions
Windows Driver Kit (WDK)
Windows Driver Kit (WDK)
A set of Microsoft tools that are used to develop, test, and deploy Windows drivers.
125 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Neuvi Jiang 1,460 Reputation points Microsoft Vendor
    2024-10-17T07:10:05.57+00:00

    Hi Fourcade, Pierre,

    Thank you for posting in the Q&A Forums.

    Free up system resources:

    Restart the computer to free up memory and USB bus resources.

    Close unnecessary applications and services to reduce system resource usage.

    Update or reinstall WinUSB driver:

    Visit Device Manager, locate your USB device, right-click and select “Update Driver”.

    If updating the driver does not work, try uninstalling the device and restarting your computer to let Windows reinstall the driver.

    Check for hardware conflicts:

    Check if any of the devices are labeled as conflicting or faulty in the Device Manager.

    Try disconnecting other USB devices and connecting only your custom USB device to see if the problem persists.

    Use another USB port or computer:

    Try connecting your USB device to a different USB port or another computer to see if the problem is caused by a specific port or computer.

    Best regards

    NeuviJ

    ============================================

    If the Answer is helpful, please click "Accept Answer" and upvote it.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.