Skip to content

v1.1.1

Choose a tag to compare

@AmrZriek AmrZriek released this 17 Sep 21:31
· 7 commits to main since this release

Protection could be undone by Windows itself

This is the release to install if you have ever taken a full-volume blast right after plugging in a dongle.

Windows restores an endpoint's previous volume a few hundred milliseconds after the device appears. EarGuard applied the plug-in limit once, at detection, so that restore simply overwrote it. Worse, if the restored value landed below your ceiling, nothing else caught it and the device stayed loud all session.

The plug-in limit now holds for three seconds after a device appears. Callbacks and the 100 ms watchdog keep pulling the level back down through that window, so late restores are covered as well. Resume from sleep renews the same window, and a disconnect and reconnect between scans no longer slips past it. After the three seconds your normal ceiling takes over, and a restored value below that ceiling is left alone.

Overlapping adjustments could undo a quieter setting

Every endpoint write now goes through one locked read-compare-write routine, so a watchdog tick, a hardware callback, and a change from the window cannot interleave and leave the louder value in place.

One device change used to cost about 30 rescans

A single hardware notification re-scanned every 100 ms for the whole three-second window. Each scan finished by writing settings.json and raising DevicesChanged, which rebuilt the device list in the window. One plug-in produced roughly 29 events and 29 file writes. Scans are now 500 ms apart, stop as soon as they find the endpoint, and publish only when the device set or the default endpoint actually changed.

Measured on real hardware, one notification that finds nothing new: 0 events, 0 writes (was 29 and 29). One that does find a late endpoint: 2 scans, both capped correctly.

Settings

  • Non-finite ceilings (NaN, ±Infinity) in settings.json are normalized instead of reaching the audio engine.
  • Null entries in the device list are dropped on load, so nothing downstream dereferences them.
  • Device names containing backslashes, quotes, or commas survive a save and reload.

Build fixes

  • csc @EarGuard.rsp failed for everyone. Forward slashes in the response file's globs made the compiler resolve src\Audio\*.cs against the current directory, so all 17 sources were reported missing. The globs use backslashes now.
  • The C# 5 compiler inside .NET Framework could not build the new result struct (CS0843), which broke the documented no-build-tools path. Fixed by using explicit readonly fields.
  • build.ps1 produces byte-identical binaries under Roslyn, so you can check a download against the hash below. The script passes /deterministic+ only when Roslyn is present, since the in-box compiler rejects the switch.

Removed

The Test Clamp button is gone. It raised volume 2% above your ceiling to prove the callback fired, and a tool built to protect your hearing should not write a louder value to your hardware. The README screenshot that advertised it has been replaced.

Install

Download EarGuard.exe below. Single portable executable, .NET Framework 4.8, no installer, no prerequisites. Run it, pick your DAC, set a ceiling.

SHA-256  f66267ab2e3a968013b84add6aab45f9b6586ad221f31cda3e82796c233aaa02
Size     82,432 bytes

EarGuard lowers endpoint volume above your limit; it cannot guarantee hearing safety. Brief spikes can get through before it responds. Keep your listening level low.