Automatically set safe volume levels, limits, and device-specific presets whenever headphones, Bluetooth headsets, USB-C DACs, IEMs, or speakers connect on Windows 10 and Windows 11.
Windows frequently resets or mismanages playback volume across hardware switches:
- Bluetooth Absolute Volume Blasts (100% Volume Spikes): Connecting Bluetooth earbuds, AirPods, or wireless headsets to Windows often defaults to maximum volume, risking sudden ear discomfort or damage to sensitive In-Ear Monitors (IEMs) and DACs.
- Switching Between Phone and PC: Bluetooth devices paired to both a phone and Windows often reconnect at overly quiet or inconsistent levels.
- Multiple Output Hardware: Switching between desk speakers (
50%), a USB DAC (35%), and headphones (25%) requires manually adjusting the volume slider after every plug-in or output switch. - Unwanted Output Switching: Plugging in a monitor, USB-C DAC, 3.5mm AUX cable, or Bluetooth device causes Windows to force-switch your default audio output automatically.
Safe Device Volume Presets solves this using event-driven Windows Core Audio notifications (IMMNotificationClient) with zero polling and zero idle CPU usage.
- Minimum Volume Safety Limit (Floor Clamping): Automatically raise audio endpoints that reconnect too quietly (such as Bluetooth earbuds reconnecting after phone use) up to a safe minimum floor. When Apply to all devices by default is disabled, devices already inside your
[Minimum, Maximum]range remain untouched. - Max Volume Safety Limit (Ceiling Cap): Enforce an upper ceiling (
0-100%) at connection time so neither custom rules nor defaults can exceed your safe threshold, protecting sensitive In-Ear Monitors (IEMs) and ears. - Prevent Auto-Switching Audio Output (Optional Toggle, Off by Default): Keep your previously selected default playback device active when Windows detects a newly connected Type-C DAC, 3.5mm AUX jack, monitor audio, or Bluetooth headset, while still allowing manual output switching anytime.
- Per-Device Keyword & Token Matching: Configure rules using short keywords (for example
AirPods,Sony,FiiO,DAC,Speakers) or exact device names. Direct substring matches run first, followed by filtered token matching. - Silent Connected Device Detection: Toggle Detect and Copy Connected Audio Devices in settings and click Save to scan active playback devices in the background and copy their full names, current volumes, and suggested rule keywords directly to your clipboard (plus Windhawk mod logs).
- Global Fallback, Auto-Unmute & Startup Support: Optionally apply a fallback default volume to unrecognized devices, unmute endpoints on connection, apply presets at startup, and debounce duplicate Windows notifications (
1.5s). - Two Deployment Options: Runs inside Windhawk as an isolated tool process (
windhawk.exe), or completely standalone without Windhawk using the portable tray executable instandalone/.
- Install Windhawk.
- Open Windhawk and search for Safe Device Volume Presets (or Audio Hardware Volume Preset, ID
audio-hardware-volume-preset). - Click Install.
- (For the latest
v1.5.0source from this repository) Enable Developer mode in Windhawk settings, create a new mod, paste the contents ofaudio-hardware-volume-preset.wh.cpp, and click Compile and inject.
If you prefer not to install Windhawk, a lightweight native Win32 system tray version (~160 KB) is available in standalone/:
- Configure rules in
standalone/config.ini. - Toggle Run at Windows Startup directly from the tray icon menu.
- See
standalone/README.mdfor usage and build instructions.
| Setting | Default | Description |
|---|---|---|
| Detect and Copy Connected Audio Devices | false |
Turn on and click Save to silently scan connected render devices and copy their names and suggested keywords to your clipboard (and log output). Toggle off and save before running again. |
| Default Volume (%) | 30 |
Fallback volume (0-100) applied on connect when no custom rule matches and Apply to all devices by default is enabled. |
| Minimum Volume Safety Limit (%) | 0 |
Minimum volume floor (0-100) enforced on connect so quiet or Bluetooth devices are boosted to at least this level (must not exceed Max Volume Safety Limit; 0 disables). |
| Max Volume Safety Limit (%) | 100 |
Maximum volume ceiling (0-100) enforced on connect. Takes priority over Minimum Volume if set lower, and does not restrict manual adjustments afterward. |
| Apply to all devices by default | true |
If enabled, unmatched devices use Default Volume. If disabled, unmatched devices keep their current volume unless outside the Minimum/Maximum Safety Limits. |
| Unmute on connect | true |
Automatically unmutes the playback endpoint when adjusting its volume. |
| Apply on mod startup | true |
Applies matching presets or safety limits to the current default output device when the mod initializes. |
| Prevent auto-switching audio output | false |
Keeps your previously selected default playback device active when Windows tries to switch to a newly plugged-in Type-C DAC, AUX, or Bluetooth device. |
| Custom Device Presets | [] |
Ordered list of { Device Name or Keyword, Volume (%) } rules. Place more specific rules above general ones; the first match wins. |
+-----------------------------------------------------------------------+
| Windows Core Audio Service (MMDevice API) |
| Fires OnDeviceAdded / OnDeviceStateChanged / OnDefaultDeviceChanged |
+-----------------------------------+-----------------------------------+
| (Non-blocking QueueAudioEvent)
v
+-----------------------------------------------------------------------+
| Dedicated Tool Process (windhawk.exe -tool-mod) |
| Worker Thread (MTA COM) -> Role Tracking -> Auto-Switch Guard |
| (IPolicyConfig::SetDefaultEndpoint restores previous default if on) |
+-----------------------------------+-----------------------------------+
|
+--------------------------+--------------------------+
| |
v v
Pass 1 & 2: Rule Match Unmatched Fallback
(Substring -> Filtered Tokens) (Default Vol or Read Current)
| |
+--------------------------+--------------------------+
|
v
Clamp [Min Limit, Max Limit] -> IAudioEndpointVolume
(SetMasterVolumeLevelScalar + Optional SetMute)
- Target Process:
windhawk.exe(dedicated standalone tool process; does not inject intoexplorer.exeor media apps) - Windows APIs:
IMMDeviceEnumerator,IMMNotificationClient,IAudioEndpointVolume,IPropertyStore - Compiler Flags: Clang / MinGW-w64 with
-lole32 -lshell32 -luser32
Found a bug or have a feature request? Open an issue at GitHub Issues.
Distributed under the MIT License. Copyright (c) 2026 Dev-StudioCode.