4

I have a Dell Precision 5520 (laptop) and as it's my only Windows PC I'm unable to see if it's a Dell or Windows problem.

I use various types of hardware such as CAN bus analyzers, MCU programmers and various others which each has their own software.

The problem I have is that if the PC sleeps, upon wake up the software sees the hardware as disconnected. Some software crashes and some I have to reconfigure or mess around to get it to work again.

Is there a way I can get the PC to sleep without disconnecting USB devices?

Run5k
  • 16,463
  • 24
  • 53
  • 67

4 Answers4

5

Perhaps you can try this:

Refer to the following steps.

  1. Open Control panel, and click view by to select small icons
  2. Click Power Options
  3. Find the current plans (in my PC is Balanced)
  4. Click Change plan settings
  5. Click Change advanced power settings in the new Window
  6. In the new Window, click Change settings that are current unavailable
  7. Then find USB settings -> USB selective suspend settings
  8. Disable it

Hope it can help you.

OOOO
  • 1,270
5

OOOO's answer is great but in some circumstances Windows might hide the Change settings that are current unavailable option. It is possible to change the USB selective suspend settings via the command line:

  1. Enable the power plan you wish to change
  2. Open cmd
  3. To disable:
REM (On battery: Disabled)
powercfg /SETDCVALUEINDEX SCHEME_CURRENT 2a737441-1930-4402-8d77-b2bebba308a3 48e6b7a6-50f5-4782-a5d4-53bb8f07e226 0
REM (Plugged in: Disabled)
powercfg /SETACVALUEINDEX SCHEME_CURRENT 2a737441-1930-4402-8d77-b2bebba308a3 48e6b7a6-50f5-4782-a5d4-53bb8f07e226 0
  1. To re-enable:
REM  (On battery: Enabled) - Default
powercfg /SETDCVALUEINDEX SCHEME_CURRENT 2a737441-1930-4402-8d77-b2bebba308a3 48e6b7a6-50f5-4782-a5d4-53bb8f07e226 1
REM (Plugged in: Enabled) - Default
powercfg /SETACVALUEINDEX SCHEME_CURRENT 2a737441-1930-4402-8d77-b2bebba308a3 48e6b7a6-50f5-4782-a5d4-53bb8f07e226 1

Adapted from: How to Turn On or Off USB Selective Suspend in Windows 10

Note: The GUIDs are well known GUIDs defined by Windows:

> powercfg -list
> powercfg -query <your_power_plan_GUID>

[...] Subgroup GUID: 2a737441-1930-4402-8d77-b2bebba308a3 (USB settings) Power Setting GUID: 48e6b7a6-50f5-4782-a5d4-53bb8f07e226 (USB selective suspend setting) Possible Setting Index: 000 Possible Setting Friendly Name: Disabled Possible Setting Index: 001 Possible Setting Friendly Name: Enabled [...]

3

Start the Device Manager (devmgmt.msc) in System Control.

Most USB devices have configurable energy settings. You can change them to disallow energy saving in sleep mode.

enter image description here

This post might also be relevant.

OOOO
  • 1,270
Axel Kemper
  • 4,038
2

The other answers aren't bad, but in my experience the rabbit hole can go *much* more deeper:

  • first, every recent laptop supports modern standby, and that can definitively influence USB power states

  • secondly, Windows 10 has this new option where it explicitly turns off USB devices on sleep

  • thirdly each individual device driver may have its specific preferences (even though you'd certainly expect them to be appropriate OOTB for whatever their use case is)

  • and if we continue to dig further, there are then all the different kinds of hidden knobs that piled up during the years within the drivers of the OS's USB stack

  • which some suggest that you could look into replacing altogether

  • last but not least, there are the bios, firmware and hardware levels

  • mindful most of them just eventually set some USB Controller register, you could try to edit them directly with tools such as RWEverything

mirh
  • 1,172