Sound Keeper v1.2.2 [2022/05/15]

Prevents SPDIF/HDMI digital audio playback devices from sleeping. Uses WASAPI, requires Windows 7+.

To enable autorun, copy soundkeeper.exe into the startup directory (to open it, press Win+R, enter shell:startup, press Enter). To close the program, just mute the Sound Keeper in the Volume Mixer or kill the soundkeeper.exe process.

Download: soundkeeper.7z (17KB). Source code →

Features

  • Sound Keeper is fully automatic and doesn't require any user interaction.
  • Sound Keeper can keep sound on many sound outputs simultaneously (e.g. SPDIF and HDMI).
  • Sound Keeper detects new sound outputs on the fly (e.g. when you connected a TV via HDMI).

Settings

  • Default behavior can be changed by changing file name of the Sound Keeper executable.
  • Primary audio output is used by default. Add All to executable file name to enable Sound Keeper on all outputs.
  • Inaudible stream is used by default. Add Zero to executable file name to use stream of digital zeroes (like it was in v1.0.0).

If the default inaudible stream doesn't help, try the new Sine stream type. It generates a sine wave, and can be customized. There are two parameters: F (frequency) and A (amplitude). The value goes right after the parameter character. For example, add SineF10A5 to executable file name to generate 10Hz sine wave with 5% amplitude. Low frequencies (below 20Hz) and high frequencies (above 20000Hz) with low amplitude (up to 10%) are inaudible.

Sound Keeper vs. SPDIF Keep Alive vs. SPDIF-KA

Sound Keeper v1.0 SPDIF Keep Alive v1.2 SPDIF-KA v1.4
Fully automatic: Yes No No
Multiple outputs: Yes No No
GUI: No Yes Yes
Requires .NET: No Yes Yes
Executable size: 17KB 668KB 163KB
CPU usage (on Intel Core i5 4460): 0.004% 0.06% 0.06%
RAM usage (Private Working Set): 1636KB 13704KB 10600KB

Known issue: streaming audio prevents automatic sleep mode

When a program streams any audio (even silence), the system don't go into sleep mode automatically. Sound Keeper uses the NtPowerInformation(SystemPowerInformation, ...) function to retrieve time when system is going to sleep, and disables itself right before this time. On Windows 7, it works perfectly. Windows 10 waits for 2 minutes more after any sound was streamed, so the PC goes into sleep mode after 2 minutes when Sound Keeper disabled itself. For some reason, Windows 11 always reports that the system is going to sleep in 0 seconds. The workaround had to be disabled on this OS until a better solution is found.

You can try to use the powercfg command to allow Windows go into sleep mode even when audio is streamed. To get required information about your audio driver that prevents the PC from sleeping when audio is streamed, execute the following command with administrator rights while Sound Keeper is running:

powercfg /REQUESTS

The required information about your audio device should look like this:

SYSTEM:
[DRIVER] High Definition Audio Device (HDAUDIO\FUNC_01&VEN_10EC&...)

Execute such commands (but with your data from the previous command) as administrator to add this device into the ignore list:

powercfg /REQUESTSOVERRIDE DRIVER "High Definition Audio Device" SYSTEM
powercfg /REQUESTSOVERRIDE DRIVER "HDAUDIO\FUNC_01&VEN_10EC&..." SYSTEM
powercfg /REQUESTSOVERRIDE DRIVER "High Definition Audio Device (HDAUDIO\FUNC_01&VEN_10EC&...)" SYSTEM

To verify the ignore list, execute:

powercfg /REQUESTSOVERRIDE

To revert your changes, execute:

powercfg /REQUESTSOVERRIDE DRIVER "High Definition Audio Device"
powercfg /REQUESTSOVERRIDE DRIVER "HDAUDIO\FUNC_01&VEN_10EC&..."
powercfg /REQUESTSOVERRIDE DRIVER "High Definition Audio Device (HDAUDIO\FUNC_01&VEN_10EC&...)"
  1. #201
    VEG Author

    Jonathan,

    Can I make a feature suggestion - would be useful to specify a time range for it to disable itself during that time (e.g. to let the soundbar sleep overnight if leaving the computer on).

    I think you could try to use the standard Windows Task Scheduler for this.

  2. #202
    JamesF

    So with regard to the wake lock situation - I'm using SoundKeeper in "Zero" mode because I found the default "inaudible" stream was in fact very audible when turning my system all the way up to listen to music. (I have a HTPC with a pretty powerful theater system.)

    When I run powercfg /requests (and I'm on Win11) I don't see any wake locks. If I start a YouTube video, I will see Chrome in there, so I know it's working. But with nothing but SoundKeeper64Zero.exe running, I have no wake locks.

    And yet my system will not go to sleep anyway.

    Thinking it was the "Zero" mode preventing anything from showing up in the wake locks, I tried running just the regular SoundKeeper64.exe but that didn't actually change anything.

    What could be going on here?

  3. #203
    VEG Author

    I'm using SoundKeeper in "Zero" mode because I found the default "inaudible" stream was in fact very audible when turning my system all the way up to listen to music.

    Amplitude is just 0.0000305185 in default mode when audio output is 16-bit, and it just can't be audible. Probably, some enhancements are enabled in the audio output settings? It might be that Loudness Equalization makes it much louder. What bit-depth is used for your audio output? Is there any difference if you try to switch between 16-bit/24-bit/32-bit? Maybe there is a bug in handling different bit-depths.

    When I run powercfg /requests (and I'm on Win11) I don't see any wake locks. If I start a YouTube video, I will see Chrome in there, so I know it's working. But with nothing but SoundKeeper64Zero.exe running, I have no wake locks.
    And yet my system will not go to sleep anyway.

    The suggestions about powercfg /requests were tested on Windows 10 only. I don't use Windows 11. Probably there are some behavior changes in Windows 11 I'm not aware of.

  4. #204
    VEG Author

    The debug and beta versions are updated. Fluctuate stream makes just one fluctuation per a second by default now. It should be inaudible even with the Loudness Equalization enabled. Also I added an ability to set frequency for the Fluctuate stream.

    It would be good if you help to find the reason why the old Fluctuate is audible for you. Set F to 0 to enable the old behavior (if you use the new beta or debug versions), and try to tweak with your audio output settings (changing bit depth and sample rate; toggling enhancements) to figure out if they affect audibility of this stream type on your system.

  5. #205
    JamesF

    Amplitude is just 0.0000305185 in default mode when audio output is 16-bit, and it just can't be audible. Probably, some enhancements are enabled in the audio output settings? It might be that Loudness Equalization makes it much louder. What bit-depth is used for your audio output? Is there any difference if you try to switch between 16-bit/24-bit/32-bit? Maybe there is a bug in handling different bit-depths.

    I was running at 16 bit, 48kHz. All enhancements are disabled. I switched to 24 bit, 48kHz and the noise went away. SoundKeeper64.exe is now indistinguishable from SoundKeeper64Zero.exe.

    I should note that I'm running a 7.1 channel system with about 2kW of power. So when turned up, things that are inaudible on many setups are audible on mine. I hear things like faint background noise in recordings that sound silent when listening on other devices. This noise was audible to me at 15dB below "reference" level, but seemed to fade out at -20dB. (I'm using a Denon AVR to set my volume.)

    The suggestions about powercfg /requests were tested on Windows 10 only. I don't use Windows 11. Probably there are some behavior changes in Windows 11 I'm not aware of.

    Ah, okay. Perhaps my situation is not unique then. I'd really love to find a way to get Windows 11 to sleep automatically with SoundKeeper active. I picked Windows 11 over 10 (despite my bias) because of the supposedly superior HDR video capabilities. As of right now, I must manually put my HTPC to sleep and it's a tough thing to remember after years of letting it handle that by itself. :) This new HTPC only draws about 30W of power at idle, but all the same I like to use sleep mode to keep the dust down and reduce wear and tear on the fans.

    Thanks for the feedback!

  6. #206
    VEG Author

    JamesF,

    I was running at 16 bit, 48kHz. All enhancements are disabled. I switched to 24 bit, 48kHz and the noise went away. SoundKeeper64.exe is now indistinguishable from SoundKeeper64Zero.exe.

    Interesting. Did you try the beta? Do you hear anything in the new default mode when 16-bit output is used?

  7. #207
    JamesF

    Interesting. Did you try the beta? Do you hear anything in the new default mode when 16-bit output is used?

    The beta did seem to resolve the issue in 16 bit 48kHz mode.

  8. #208
    VEG Author

    Thanks. Now I need somebody for whom Zero doesn't work, but the old Fluctuate worked fine, so we could check if the new Fluctuate still works for them =)

    Related to the going into sleep mode. You could just assign a convenient shortcuts for Sleep and Hibernate, and use them when you need. For example, the standard shortcut for locking computer is Win+L. I just added Ctrl+Win+L for sleeping and Ctrl+Shift+Win+L for hibernation using AutoHotKey:

    ; ------------------------------------------------------------------------------
    ; Sleep (Ctrl+Win+L) and Hibernate (Ctrl+Shift+Win+L) hotkeys.
    ; ------------------------------------------------------------------------------
    
    ^#L UP::DllCall("PowrProf\SetSuspendState", "int", 0, "int", 0, "int", 0)
    ^+#L UP::DllCall("PowrProf\SetSuspendState", "int", 1, "int", 0, "int", 0)
    
    ; ------------------------------------------------------------------------------

    Before I was always locking my computer using Win+L anyway. Now I just press Ctrl in addition when I know that I go somewhere and want it to be in sleep state to save some energy.