Prevent disconnects - turn off USB Selective Suspend

Discussion in 'Frequently Asked Questions (Public)' started by Colin Haig, Nov 9, 2020.

  1. Colin Haig

    Colin Haig Staff Member

    Joined:
    Oct 27, 2014
    Messages:
    7,962
    Location:
    Earth
    Is your camera or other device disconnecting randomly ?
    Did it stop responding for no apparent reason?

    Windows Power Management may be contributing to the problem. It will shut down devices to save energy. Normally, saving energy is a good thing.
    However, if Windows powers off a device or hub, this can disrupt communications between software and observing equipment.

    There are a couple of things to check:

    Windows Power Management - USB Selective Suspend
    Go into the Windows Power and Sleep settings - Advanced.
    Find the USB Selective Suspend option by expanding the list until you find it.

    USB Selective Suspend should be turned OFF.
    Here's how to turn it off in Windows 10 version 1909:
    usb_suspend.png

    Windows Device Manager - Power Management
    Each device in your system may have some power-saving settings.
    For all devices in the hierarchy of USB hardware, you need to check that the power management settings are off.
    Start the Windows Device Manager.
    Look at the list of USB devices.
    Check their properties, and the Power Management tab.
    Disable (uncheck) the option [] Allow the computer to turn off the device to save power.
    USB_power.png
    You need to do this for all USB devices, USB hubs, USB root hubs, and PCIe devices.
    You can also View Devices by Connection, and expand it out, something like this:
    usb_dev_hierach.png

    Typically you will see something like PCI Express - USB Host Controller - USB root hub - USB hub - Device.
    Turn power management off for each of them.

    USB to Serial Adapters and RS232 COM Ports
    Devices such as a focuser, telescope mount, weather sensor, dew controller or power switch may be set up with an RS232 serial communication port, and your PC may use a USB-to-Serial adapter to make the connection.

    Different vendors have different settings. Here's an example from an FTDIchip USB-to-serial adapter.
    Turn OFF (Uncheck) the USB Selective Suspend setting - this prevents unexpected powering off.

    Turn OFF (uncheck) the Serial Enumerator setting if this is an option - this prevents the computer from thinking a Microsoft Serial Mouse is on this port. This can give you an uncontrollable systems with random mouse clicks if it thinks your GPS or mount or some other device is a mouse.
    usb_serial.png


    Windows Power Plan
    You may wish to save a new Windows Power Plan with these settings. It might make it easier to restore things in the future. The power plan may not save all of this, so if you suspect a problem, check the above tips again.

    Be Mindful of Updates and Upgrades
    Things that worked fine may suddenly seem broken after a Windows Update, Upgrade, or Feature pack etc.
    If you (or the automatic update) installs one, it is especially important to check these power management settings are still correct - sometimes they revert to the wrong settings.

    If you are running off a battery-operated system like a laptop, you may wish to experiment a bit to see the best reliability versus energy savings.
     
    Last edited: Nov 9, 2020
  2. Colin Haig

    Colin Haig Staff Member

    Joined:
    Oct 27, 2014
    Messages:
    7,962
    Location:
    Earth
    Last edited: Sep 19, 2024
  3. Colin Haig

    Colin Haig Staff Member

    Joined:
    Oct 27, 2014
    Messages:
    7,962
    Location:
    Earth
    FTDIchip Serial Devices
    A recent Windows update cycle installed an updated set of WHQL FTDIchip drivers. The new drivers are 2.12.36.4.
    This may reset the settings of the drivers, and cause the Serial Mouse or Serial Ball Mouse problem again, which leads to erratic operation of the computer.
    Here's the stuff you need to check:
    serialportproblem.png
    and here is the correct settings:
    serialportproblemfix.png
    Check each port individually.
    After a reboot, if you see the Serial Mouse is back, you will need to Disable it by Right-Clicking, and Disable Device.
     
    Last edited: Sep 19, 2024
  4. Colin Haig

    Colin Haig Staff Member

    Joined:
    Oct 27, 2014
    Messages:
    7,962
    Location:
    Earth
    Thunderbolt Ports
    Does your computer have any Thunderbolt(TM) ports?
    Often they look like the USB C connectors, with a small Thunderbolt symbol beside them.

    Launch the Windows Device Manager.
    Look under System Devices for the Thunderbolt controllers.
    For each controller, go to the properties, Power Management tab.
    You need to Uncheck (turn off, disable) the setting: [ ] Allow the computer to turn off this device to save power.

    Here is an example of a computer with 2 Thunderbolt ports. You need to disable the setting for each controller.
    thunderbolt_power.png
     
  5. Colin Haig

    Colin Haig Staff Member

    Joined:
    Oct 27, 2014
    Messages:
    7,962
    Location:
    Earth
    Remote Desktop Connection
    Do you connect to your observatory computer with Remote Desktop?
    If you use the Microsoft Windows 11 Professional feature called Remote Desktop Connection, you may wish to make a change to your system.
    Windows 10 Pro has something similar.
    Turn off the feature where it will check for Manufacturer Apps and Device Icons.

    How to fix:
    Run sysdm.cpl
    This brings up the system properties.
    Select the Hardware tab.
    Click the [Device Installation Settings], choose "No", and click [Save Changes].
    It may warn you. Proceed anyway. You can always change it back if you need to in future.
    sysdm_cpl.png
    That's it - you're done.

    Technical:
    For computer folks - here's what seems to be happening. The rest of you can skip this section.

    Why make this change? RDP Host adds and updates devices, and that takes a while.

    Remote Desktop runs a set of services on the Host Server (your observatory PC that controls the telescope).
    When the connection is established, a component called DeviceSetupManager sets up a number of new devices on your machine.
    e.g. it will add Remote devices for the Display Adapter, Keyboard, Mouse, Camera (webcam), Device Redirector, USB hub.
    rdp_devices.png
    This can take a few seconds, and can interrupt activities running on the computer.
    It can briefly disrupt the operation of USB and Thunderbolt ports, keyboard, mouse, printer, displays, and other attached devices - including your observatory equipment.

    Further, it may attempt to contact Microsoft servers to see if there are app, icon, or maybe driver updates, for existing, physical devices and this can take many additional seconds.
    You can eliminate this extra attempt by making the change.

    If you want to see what is going on, have a look at Event Viewer.
    Applications and Services Logs - Microsoft - Windows - DeviceSetupManager - Admin
    ev_dsm.png
    So in my example, you can see DSM was busy for many seconds.
    The Error messages in my example were "Metadata staging failed, result=0x80070490 for container" and then the GUID tied to a device.
    I found all kinds of things were being checked and update attempts by DSM.
    Making the change above stopped these errors and sped the whole process up.

    It went from:
    DSM Service shutting down. Service uptime was 67 seconds, active worktime was 3802 MilliSeconds.
    to
    DSM Service shutting down. Service uptime was 45 seconds, active worktime was 94 MilliSeconds.

    Is this a "good solution"? I don't know, but it eliminated disconnects that were happening around the time of RDP logins.
     

Share This Page