Skip to content

IsSlashy/USB-Guardian

Repository files navigation

USB Guardian

Monitor & Fix USB Power Issues

USB Guardian is a Windows application that monitors USB and audio device connections in real-time, detects power-related issues, and provides automatic fixes.

Features

  • Real-time USB Monitoring - Instantly detect device connections and disconnections
  • Power Analysis - View power consumption for each USB device
  • Audio Device Tracking - Monitor audio device state changes (including VoiceMeeter)
  • Intelligent Problem Detection - Automatic detection of:
    • High power consumers (>500mA)
    • Hub overload conditions
    • Frequent disconnection patterns
  • Automatic Fixes - One-click solutions for common issues:
    • Disable USB Selective Suspend
    • Disable USB Power Management
  • System Tray - Runs in background, minimizes to tray
  • Modern UI - Dark gaming theme with real-time updates

Why USB Guardian?

Many users experience random USB device disconnections, especially with:

  • RGB peripherals (keyboards, mice, LED strips)
  • Audio interfaces and microphones
  • Webcams
  • Gaming headsets

These issues are often caused by:

  1. Power management - Windows aggressively suspends USB devices
  2. Power overload - Too many high-power devices on one hub
  3. Driver issues - Outdated or conflicting drivers

USB Guardian helps identify and fix these issues automatically.

Installation

Download

Download the latest release from Releases.

Build from Source

Requirements:

  • Windows 10/11
  • Visual Studio 2022 (or Build Tools)
  • CMake 3.15+
  • Windows SDK
git clone https://github.com/yourusername/usb-guardian.git
cd usb-guardian
mkdir build && cd build
cmake ..
cmake --build . --config Release

Usage

  1. Launch USBGuardian.exe
  2. The app will scan all USB and audio devices
  3. Review the Power Overview for total consumption
  4. Check Alerts for detected issues
  5. Apply recommended Solutions with one click

Auto-Start

USB Guardian can start automatically with Windows and run in the system tray. Configure this in Settings.

Screenshots

Main Interface

  • Power overview with consumption bar
  • USB device list with power readings
  • Live event feed
  • One-click fixes

System Tray

  • Minimizes to tray on close
  • Double-click to restore
  • Right-click for menu

Technical Details

Detected Devices

  • All USB devices via Windows SetupAPI
  • Audio endpoints via Windows MMDevice API
  • Power consumption from USB descriptors

Fixes Applied

Fix Method
Disable Selective Suspend Power scheme modification
Disable Power Management Registry modification
Auto-start Registry (HKCU\Run)

Contributing

Contributions are welcome! Please feel free to submit issues and pull requests.

License

MIT License - see LICENSE file.

Credits

  • Dear ImGui - Immediate mode GUI
  • DirectX 11 - Rendering backend

Support

If USB Guardian helped you fix your USB issues, consider:

  • Starring this repo
  • Sharing with others who have similar problems
  • Contributing improvements

Made with frustration after too many USB disconnections.