Stop Windows switching off your USB gear

Discuss how to use FL Studio

Return to “FL Studio Users Forum (Looptalk)”

Forum rules
Please read them here.
[You can only see part of this thread as you are not logged in to the forums]
Yearofthegoat
Tue May 11, 2021 11:35 pm

x

Stop Windows switching off your USB gear

Thought I'd post this up in case it helps someone.

You might be aware that Windows will/can switch off USB-connected kit to save power. Fair enough, but you might not want it to do this to your USB MIDI keyboard or your audio interface etc. while you go for a cup of tea.

You can disable this behaviour in Device Manager - right-click the device, select Properties, then the Power Management tab. Then deselect the 'Allow the computer to turn off this device to save power' option. This is fine for one device on the odd occasion, but having it happen regularly on multiple devices was a right old PITA.

(The only downside I've come across doing this was with a wifi adapter - turning off that option resulted in Windows not turning the wifi card back on after resuming from hibernation or sleep. The option may be badly named and seems to mean 'manage power' not just 'let Windows turn it off').

I found a useful little PowerShell script here:
https://community.spiceworks.com/topic/2190400-disable-usb-hub-allow-computer-turn-off-save-power

that switches off all those USB power management settings for me. It needs PowerShell with Admin rights or it won't work:

Code: Select all

$USBHubs = Get-WmiObject -Class Win32_USBHub
$PowerMgmt = Get-WmiObject -Class MSPower_DeviceEnable -Namespace root\wmi

ForEach ($Hub in $USBHubs) {
    Write-Host
    Write-Host -Object "Checking USB Hub '$($Hub.Name)'..."
    $VarPowerSettings = $PowerMgmt | Where {$_.InstanceName -like "*$($Hub.DeviceID)*"}
    If (($VarPowerSettings | Measure).Count -eq 1) {
        If (($VarPowerSettings | Select -ExpandProperty Enable) -eq $False) {Write-Host -Object "USB Hub '$($Hub.Name)' already has power saving disabled" -ForegroundColor Green}
        Else {
            Try {
                $VarPowerSettings.Enable = $False
                $Null = $VarPowerSettings.psbase.Put()
                Write-Host -Object "Disabled power saving features for USB Hub '$($Hub.Name)'" -ForegroundColor Green
            }
            Catch {Write-Warning -Message "One or more exceptions occurred when trying to set power saving settings for USB Hub '$($Hub.Name)'"}
        }
    }
    ElseIf (($VarPowerSettings | Measure).Count -gt 1) {Write-Warning -Message "More than one WMI object representing power settings was found for '$($Hub.Name)', no settings have been changed for this device"}
    Else {Write-Warning -Message "No power settings were found for '$($Hub.Name)', please check if the device supports power saving features"}
}
pause

Annoyingly, Windows updates can re-set your settings. This has happened to me several times: with Windows Feature Updates, e.g. going from 1909 to 2004, 2004 to 20H2 etc. Also happens when Windows decides to install an updated device driver. I guess it means well but it can cause problems. Like resetting the USB power settings, for one.

So, I now have 'get device drivers from Windows Update' turned off. I did that via the Group Policy Editor which is available in Windows 10 Pro:
  • WinKey+R, type gpedit.msc
  • Select Computer Configuration, Administrative Templates, Windows Components, Windows Update
  • Enable 'Configure Automatic Updates' - lets you take (some) control of Windows Update
  • Enable 'Do not include drivers with Windows Updates'
  • Exit the Group Policy Editor

Since I set the USB settings and disabled driver updates, so far no changes. The last lot of changes (2004-20H2) were easily reversed with the script.

So I hope that helps anyone that, like me, gets fed up with the mighty M$ switching off their USB gear. Take back control! At least a little bit anyway.

Return to “FL Studio Users Forum (Looptalk)”