14

I have installed a USB 3.0 hub on my desktop computer.

I use it to connect an external USB 3.0 disk for backup purposes, and I have a problem: Windows 7 enables by default power saving for said hub, which causes the disk to disconnect during intense I/O operations (e.g. my scheduled backup at 8 p.m.).

I can disable this setting by doing the following:
Go to the Device Manager > Right click on the hub > Properties > Power management > Uncheck Allow the computer to turn off this device to save power

Too bad, every time I restart the computer, the box is checked again. Is there a way to disable this setting permanently?

EDIT: I edited my question with the actual English names for the settings above (it wasn't very clear before).

EDIT: Peter Fitzgerald's answer describes exactly what I've been doing so far. Every time I reboot the checkbox is marked again, I'm looking for a way to disable it permanently.

EDIT: after reading Synetech's answer, I was able to track down the registry entry that is changed when I change the setting, which is:

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\FLUSB\ROOT_HUB_FL30\5&f0b5d82&1\Device Parameters\WDF\IdleInWorkingState (DWORD)

This key is changed by the Management Console whenever I unset the checkbox, and also when I deactivate & reactivate the device by process System. Too bad, any setting in the authorizations is misteriously ignored, and even by denying every privilege to everyone the key is always set to 1.

I tried searching online, and I found this Microsoft guide. Trying to set every single key they described did not help, it seems these keys are ignored. I even tried to copy the right path for the keys from existing .INF found online (which keys to put under /WDF and which keys to put under the parent), like this, but I got nothing.

Other useful information:

  • under HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\FLUSB\ROOT_HUB_FL30\, I also have these two voices: 5&f0b5d82&0 and 5&21f33a01&0, which seems to mirror the configuration of the key above. The only IdleInWorkingState changing, though, is the one described above.
  • when I manually edit the register, the value of the checkbox in the Device Manager doesn't change, it has to be cached somewhere.
16
  • Is the USB selective suspend setting enabled?
    – and31415
    May 5, 2014 at 21:17
  • @and31415: no, it is not. I had to disable that as well a quite ago, but it stays that way after reboot.
    – 0x5C91
    May 5, 2014 at 22:01
  • Is this set to Disabled : Control Panel -> Power Options -> Change plan settings -> Change advanced power settings -> USB settings -> USB selective suspend setting.
    – harrymc
    Jun 12, 2014 at 17:23
  • @harrymc, if you read the 2 comments above you'll see that I've already disabled it.
    – 0x5C91
    Jun 12, 2014 at 17:32
  • What make is your USB3? Mine doesn't have a "Power management" tab at all and it never powers off completely.
    – harrymc
    Jun 12, 2014 at 18:12

6 Answers 6

7
+50

Power Requirements

> I have installed a USB 3.0 hub on my desktop computer. I use it to connect an external USB 3.0 disk for backup purposes, and I have a problem: Windows 7 enables by default power saving for said hub, which causes the disk to disconnect during intense I/O operations

Are you sure the drive is shutting down to power-management and not simply because it is trying to draw too much power? You can check the power draw on your USB hub via the Device Manager (figures 1 and 2). Verify that the power that the hub can provide per port is sufficient for the external drive. If not, you may be able to use a USB Y-adapter (figures 3 and 4) to draw power from two ports. (High-draw external drives usually come with a Y-adapter specifically for this purpose, so double-check the box and manual.)

Tracking Down the Disease

> I can disable this setting by doing the following: Go to the Device Manager > Right click on the hub > Properties > Power management > Uncheck Allow the computer to turn off this device to save power > > Too bad, every time I restart the computer, the box is checked again. Is there a way to disable this setting permanently?

If disabling that setting does actually solve the problem at hand, then the problem now is getting it to stick and not revert. One option is to use something like Process Monitor with a filter set to the relevant registry entry (HcDisableSelectiveSuspend) to see what program changes it so that the option is turned off (it should be set to 1 to disable power-management).

That would be the ideal method because it tracks down the actual cause of the setting reverting. Unfortunately that only finds the cause; actually fixing it may not be easy or even possible. For example, Windows may automatically revert it on shutdown, or more likely, sets it to the default during boot up when it detects hardware.

Defining “Device”; Check USB Port

Incidentally, are you plugging the drive into different USB ports? As far as Windows is concerned, a “known device” is a *pairing* of **device+port**, so if you have previously plugged a device into port A and let Windows install drivers for it, then you later plug the save device into port B, Windows will see it as a new device and (re-)install drivers for it along with the *default settings*. Therefore, you must re-set all settings when you plug it into a new port. After that, Windows should remember the settings for both the new and old port. You may want to plug your drive(s) once into each USB port and configure them so that you can be sure they are all configured in the future no matter which port you plug them into. (The same goes for drive letters, but those tend to be a little less reliable due to the ephemeral nature of drive letters for removable volumes.

Treating the Symptom

One way to prevent Windows from reverting the setting is to simply deny access to the setting. This requires using the registry-editor which can be risky if you aren’t careful, so take the usual backup precautions and double-check before making a change (especially when deleting anything—which you should not be doing here anyway).
  1. First you’ll need to find the relevant device-ID:

  2. Open the USB Root Hub Properties dialog for your hub in Device Manager (figure 1), then switch to the Power Management tab

  3. Change the value of the Allow to turn off checkbox (it doesn’t matter to what, just change it), but do not click OK (figure 5)

  4. Run Process Manager and set a filter (figure 6):

  5. Ctrl+L

  6. Set for Path, contains, DisableSelectiveSuspend, Include

  7. Click Add

  8. Set another filter for Operation, contains, setvalue, Include

  9. Add

  10. Click OK

  11. Clear the current capture (Ctrl+X) and start (Ctrl+E) if it’s not already running

  12. Switch back to the Device Manager dialog box and click OK

  13. Switch back to Process Monitor and stop capture (Ctrl+E)

  14. Note down the four-digit device ID after the GUID (figure 7); in this example, 0055:

     HKLM\System\CurrentControlSet\Control\Class\{36FC9E60-C465-11CF-8056-444553540000}\0055\HcDisableSelectiveSuspend
    
  15. Click the line in Process Monitor, the press Ctrl+J to open Regedit and navigate directly to the key (if that doesn’t work, then open Regedit and manually navigate to the key)

  16. Configure the setting to what you want it to be one last time (un-check the box in the Power Management tab and click OK)

  17. Now lock that setting in and block access to the key (figure 8):

  18. Right-click the key in the left pane of Regedit

  19. Select Permissions

  20. Click Advanced

  21. Un-check the Inherit from parent box, then click Copy and OK

  22. Back in the regular (non-advanced) permissions dialog, click each of the groups and users listed in the top list and for each one, un-check the Full Control box in the bottom list

Now nobody, not you, not even the system itself will be able to modify the setting (but they can still read it), so it should always stay at what you set it before setting it to read-only. (If needed, you can restore write-access by removing the item-specific permissions in the Advanced Security Settings dialog and re-checking the Inherit from parent box.

Of course, you’ll need to reboot afterwards to make sure the setting sticks.

Last Resort

If the drive is *still* shutting down, try setting `HKLM\System\CurrentControlSet\Services\usb\DisableSelectiveSuspend` to `1` and making it read-only as above. This setting is not present in a normal system, [nor is it documented][4] like [HcDisableSelectiveSuspend][5] is (the only references to it are on community pages), but Windows does seem to query this value before `HcDisableSelectiveSuspend` (figure 7), so it is worth a shot.

Sherlock Holmes

At this point, if you want, you can go back and diagnose the underlying problem instead of just treating the symptom. You can use the above filter to have Process Monitor log write-access to the registry entry during startup (*Options → Enable Boot Logging*) and during [shutdown][6] (which is [slightly trickier][7]) to find out exactly what is changing it. Then you can cross your fingers and hope there is a way to prevent it.

Illustrations

Figure 1: Screenshot of USB hub in Device Manager

Screenshot of USB hub in Device Manager

Figure 2: Screenshot of power draws on a USB hub

Screenshot of power draws on a USB hub

Figure 3: Photo of a USB Y-adapter

Photo of a USB Y-adapter

Figure 4: Diagram of USB Y-adapter usage

Diagram of USB Y-adapter usage

Figure 5: Screenshot of Power Management tab of USB hub

Screenshot of Power Management tab of USB hub

Figure 6: Necessary Process Monitor filters

Screenshot of required Process Monitor filters

Figure 7: Screenshot of relevant registry entry in Process Monitor results

Screenshot of relevant registry entry in Process Monitor results

Figure 8: Flow-diagram of setting a registry key to read-only

Flow-diagram of setting a registry key to read-only

1
  • First of all, thanks for your awesome answer, it definitely is in pole position for the bounty. I followed your advice, and even though I have discovered additional details, the problem is not solved yet. I edited my question accordingly, I hope you can gain additional information from my edit.
    – 0x5C91
    Jun 15, 2014 at 10:04
3

Since none of the other solutions have worked, I solved with the following workaround:

Powershell script to disable the setting

Editing a script found on the Internet, I built this:

C:\powerMgmt.ps1

$hubs = Get-WmiObject Win32_USBHub
$powerMgmt = Get-WmiObject MSPower_DeviceEnable -Namespace root\wmi | where {$_.InstanceName.Contains($hubs.PNPDeviceID)}

foreach ($p in $powerMgmt)
{
    $p.Enable = $False
    $p.psbase.Put()
}

Executing at startup with elevated privileges

The above script requires elevated privileges, so I created a task in the Task Scheduler of Windows 7 to run the following script (as user Administrator) when I login with my user:

C:\powerMgmt.cmd

powershell -file C:\powerMgmt.ps1

This whole thing is a bit of a hack; it's not elegant and it doesn't help me understand the problem, but it solves it.

1

Go into Device Manager, expand the tree list under "Universal Serial Bus Controllers," right click on the entry for the device, and select properties.

enter image description here

Go to the "Power Management" tab in the properties dialogue and uncheck the box for "Allow the computer to turn off this device to save power."

enter image description here

If you're using a laptop, you may also need to go into your advanced power plan settings and disable the option that allows Windows to cut power to devices when they are not in use.

2
  • Thanks for your answer. I'm sorry if it was not clear from my question (I use Win 7 in Italian and I tried to translate on the fly), but that's exactly what I've been doing so far.
    – 0x5C91
    May 5, 2014 at 21:59
  • I edited my question. Thanks again, but it appears the solution is not this easy.
    – 0x5C91
    May 5, 2014 at 22:05
0

You'll want to edit your registry.

  1. open regedit.exe and run as administrator.

    a) click start > then type regedit in the search box > right click on regedit.exe > select "run as administrator

  2. Uncollapse [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\

    a) right click on services > hover over "new" and select "key"

    b) enter "USB"

    c) Navigate to "USB" > right click on USB

    d) hover over "new" and select "DWORD (32-bit) Value

    e) change the defaut value to "DisableSelectiveSuspend"

    f) Select DisableSelectiveSuspend > click "Edit">"Modify"

    g) under "Value data:"> change the 0 to a 1 > click okay.

  3. Reboot your computer. Your problem should be solved.

If you are uncomfortable editing your registry. You can open notepad and cut and paste the text below into notepad and save the file with any name, say "temp.reg" it must have the ".reg" extension and not a ".txt" extension. If you save the file in your "Documents" folder then you need to double click on the file from windows explorer and the registry values will be created for you. Here is the text to paste into notepad, include everything between the lines.


Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\USB] "DisableSelectiveSuspend\""=dword:00000001


If you use the .reg file method, reboot your computer and your problem should be solved.

1
  • Thanks for trying, but it didn't work.
    – 0x5C91
    Jun 14, 2014 at 17:07
0

You might try to completely delete the driver and clear out stale USB information :

  1. Goto Device Manager, open "Universal Serial Bus Controllers", right-click the USB Root Hub and choose Uninstall.

  2. Use regedit to delete HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\FLUSB.
    In case of permissions error see How to take full control of Windows Registry keys (including the comments). The free utility RegOwnit might help here (I myself never used it).

  3. Reboot.

Create first a system restore point, just in case.

Another solution would be to use an older driver, which can be combined with the above procedure.

Here are two that I found :
3.5.36.0,A01
Fresco Logic USB 3.0 Driver 3.5.93.0

0
0

You can have multiple different power management schemes set up, but you have one selected (such as "Balanced" or "High Performance"). Windows is probably loading your power management scheme you have selected, and there you likely do not have the USB power management disabled.

In the start menu, type "edit power plan" and select the option for that which the start menu finds. There are some other ways to get to this window too, such as through the personalization settings where you set your screen saver.

Once you are there, you need to "Change advanced power settings."

Then go down to "USB Settings", then to "USB selective suspend setting," and change the setting here.

Here is an article that someone else wrote about your problem. In it are similar instructions and pictures.

1
  • Thanks for answering, but although I'm not sure I mentioned here, that's the first thing I tried. It didn't work. Currently the only solution that works is the one I posted, with the Powershell script disabling the setting at login.
    – 0x5C91
    Feb 2, 2015 at 7:40

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .