Giter Site home page Giter Site logo

vrubleg / soundkeeper Goto Github PK

View Code? Open in Web Editor NEW
209.0 4.0 9.0 1.05 MB

Prevents SPDIF/HDMI digital audio playback devices from sleeping.

Home Page: https://veg.by/projects/soundkeeper/

License: MIT License

C++ 86.54% C# 12.36% Batchfile 1.09%
audio wasapi windows

soundkeeper's Introduction

Sound Keeper v1.3.4 [2024/xx/xx]
https://veg.by/projects/soundkeeper/

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

The program doesn't have GUI. It starts to do its job right after the process is started.
To close the program, just kill the soundkeeper.exe process.
To autorun, copy soundkeeper.exe into the startup directory (to open it, press Win+R, enter "shell:startup").

Default behavior can be changed by adding settings to the Sound Keeper executable file name or by passing them
as command line arguments. Setting names are case insensitive.

Supported device type settings:
- "Primary" keeps on primary audio output only. Used by default.
- "All" keeps on all enabled audio outputs.
- "Digital" keeps on all enabled SPDIF and HDMI audio outputs (like it was in Sound Keeper v1.0).
- "Analog" keeps on all enabled audio outputs except SPDIF and HDMI.

Supported stream type settings:
- "OpenOnly" opens audio output, but doesn't play anything. Sometimes it helps.
- "Zero" plays stream of zeroes. It may be not enough for some hardware.
- "Fluctuate" plays stream of zeroes with the smallest non-zero samples once in a second. Used by default.
- "Sine" plays 1Hz sine wave at 1% volume. The frequency and amplitude can be changed. Useful for analog outputs.
- "White", "Brown", or "Pink" play named noise, with the same parameters as the sine (except frequency).

Sine and noise stream parameters:
- F is frequency. Default: 1Hz for Sine and 50Hz for Fluctuate. Applicable for: Fluctuate, Sine.
- A is amplitude. Default: 1%. If you want to use inaudible noise, set it to 0.1%. Applicable for: Sine, Noise.
- L is length of sound (in seconds). Default: infinite.
- W is waiting time between sounds if L is set. Use to enable periodic sound.
- T is transition or fading time. Default: 0.1 second. Applicable for: Sine, Noise.

Examples:
- SoundKeeperZeroAll.exe generates zero amplitude stream on all enabled audio outputs.
- SoundKeeperAll.exe generates default inaudible stream on all enabled audio outputs.
- SoundKeeperSineF10A5.exe generates 10Hz sine wave with 5% amplitude on primary audio output. It is inaudible.
- SoundKeeperSineF1000A100.exe generates 1000Hz sine wave with 100% amplitude. It is audible! Use it for testing.
- "SoundKeeper.exe brown -a 0.1" (settings are command line arguments) generates brown noise with 0.1% amplitude.

What's new

v1.3.4 [2024/xx/xx]:
- Tune the WASAPI memory leak workaround to make it working for longer time.

v1.3.3 [2023/08/19]:
- Fixed arguments parsing bug: "All" or "Analog" after specifying stream type led to amplitude set to 0.

v1.3.2 [2023/08/18]:
- "Fluctuate" treats 32-bit output format as 24-bit since WASAPI reports 24-bit as 32-bit for some reason.
- "Fluctuate" generates 50 fluctuations per second by default. It helps in many more cases.
- Sound Keeper doesn't exit when it is muted.

v1.3.1 [2023/01/30]:
- A potential deadlock when audio devices are added or removed has been fixed.
- "Fluctuate" treats non-PCM output formats (like Dolby Atmos) as 24-bit instead of 16-bit.
- Frequency parameter is limited by half of current sample rate to avoid generation of unexpected noise.
- More detailed logs in debug builds. Debug output is flushed immediately, so it can be redirected to a file.

v1.3.0 [2022/07/28]:
- "Fluctuate" is 1 fluctuation per second by default. Frequency can be changed using the F parameter.
- Periodic playing of a sine sound with optional fading.
- "White", "Brown", and "Pink" noise signal types.
- Self kill command is added. Run "soundkeeper kill" to stop running Sound Keeper instance.
- "Analog" switch was added. It works as the opposite of "Digital".
- Ignores remote desktop audio device (this feature can be disabled using the "Remote" switch).
- New "OpenOnly" mode that just opens audio output, but doesn't stream anything.
- New "NoSleep" switch which disables PC sleep detection (Windows 7-10).
- The program is not confused anymore when PC auto sleep is disabled on Windows 10.

v1.2.2 [2022/05/15]:
- Work as a dummy when no suitable devices found.
- Sound Keeper shouldn't prevent PC from automatic going into sleep mode on Windows 10.

v1.2.1 [2021/11/05]:
- Sound Keeper works on Windows 11.
- The workaround that allowed PC to sleep had to be disabled on Windows 11.

v1.2.0 [2021/10/30]:
- Sound Keeper doesn't prevent PC from automatic going into sleep mode on Windows 7.
- New "Sine" stream type which can be useful for analog outputs or too smart digital outputs.
- When a user starts a new Sound Keeper instance, the previous one is stopped automatically.
- "Fluctuate" stream type considers sample format of the output (16/24/32-bit integer, and 32-bit float).
- Command line arguments are supported. Example: "soundkeeper sine -f 1000 -a 10".
- The workaround for the Audio Service memory leak is enabled on affected Windows versions only (8, 8.1, and 10).

v1.1.0 [2020/07/18]:
- Default behavior can be changed by adding options to the Sound Keeper executable file name.
- Primary audio output is used by default.
- Inaudible stream is used by default.
- Workaround for a Windows 10 bug which causes a memory leak in the Audio Service when audio output is busy.

v1.0.4 [2020/03/14]: Fixed a potential memory leak when another program uses audio output in exclusive mode.
v1.0.3 [2019/07/14]: Exclusive mode doesn't prevent Sound Keeper from working.
v1.0.2 [2017/12/23]: 64-bit version is added.
v1.0.1 [2017/12/21]: Waking PC up after sleeping doesn't prevent Sound Keeper from working.
v1.0.0 [2014/12/24]: Initial release.

(c) 2014-2024 Evgeny Vrublevsky <[email protected]>

soundkeeper's People

Contributors

analogic76 avatar vrubleg avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

soundkeeper's Issues

Re-bind "occasionally"?

Your app works, but audio devices change (USB, HDMI connect, disconnect), and as far as I can tell it only keeps the devices alive that it saw on startup. Perhaps keep an eye on new devices and/or rescan every xyzseconds?

soundkeeper exits sometimes

It seems that sometimes, usually after one day (probably because I close the tv and av) the soundkeeper.exe exists.
I wanted to look in the logs, but it seems you only write to stdoutput so I cannot access that.
Can you add ability to write to a log file?

thanks.

Make releases available

Right now, I can't download any binaries to run this daemon because the veg.by domain is down.

Can you upload the latest release to GitHub so users can still try Soundkeeper out for now?

Not working with realtek drivers

I'm running an Asus Maximus X Code motherboard with the latest realtek driver 6.0.8746.1 provided on my motherboard driver page. It was working great without any realtek driver but now the program refuses to work. Currently using spdif-ka to workaround the issue but would like to use the software that is more frequently updated and has more features.

Never mind the "sine" option fixes it. Sorry about that.

@vrubleg BTW what is the default frequency and amplitude for just the regular sine file name? Also are there values I can use that are lower than F1A1 and the default that would still work potentially? Or a different type of noise that is more pleasing than the sine default sound.

bluetooth headset works with Primary but not with All

I have a bluetooth headset which soft-disconnects from windows (bluetooth settings still shows "Connected" but not showing "Connected voice, music" anymore, and no sound is played through the headset until a power-recycle) after 6 SECONDS! Unbelivable. You finish watching a youtube video, and really dont have time to start another one.

Soundkeeper helps fixing that, even with the OpenOnly setting, but All does not work, i have to use Primary.

You asked for logs using the debug version, please see attached.

soundkeeper-debug-Acme_BH203-openonly-primary.log
soundkeeper-debug-Acme_BH203-openonly-all.log
soundkeeper-debug-Acme_BH203-openonly-analog.log
soundkeeper-debug-Acme_BH203-white-primary.log
soundkeeper-debug-Acme_BH203-white-all.log
soundkeeper-debug-Acme_BH203-white-analog.log

measurement method:

  1. using administrator powershell
  2. powering off the bluetooth headset
  3. waiting ~10 seconds
  4. executing soundkeeper
  5. waiting ~10 seconds
  6. powering on bluetooth headset
  7. waiting ~20 seconds
  8. killing soundkeeper

Stopped working today with asio bridge after win 10 update

I using it with my creative g6 (horrible sound card that I will sell someday, I already bought x7), and it was fine, but today my win 10 was updated and it suddenly stopped working with hi fi cable asio bridge. I use it since it makes horrible g6 clicks a little more bearable (it is the worst sound card in the world basically). It works fine without asio bridge.

Microphone support?

Hi there,

Thanks for writing this software, it’s incredible and works really well!

I was just wondering if it would be possible to extend the functionality of this software to include microphones?

The reason I ask is because with my current set of headphones, the microphone turns off after a period of inactivity, and takes a few seconds of me speaking into the device for it to register my voice.

This is very irritating when trying to use the microphone for anything other than sound recording. The 2 second delay before the microphone registers my voice means my voice is cut-off for that initial period, so it’s useless for things like Teams/Zoom/Skype, etc.

One current workaround that works is to leave the Sound control panel open and not minimised, but this is obviously a very sub-optimal solution, and I figured it would be worth asking you seeing as your software works so well for keeping my headphones alive at all times.

Another solution I have seen is to enable mic monitoring in Windows, but again this is sub-optimal as I don’t want to hear my own voice in my headphones at all.

I am willing to donate to you for your time if you think you can manage this as it is very important to me to keep my microphone awake at all times.

I’m running Windows 10 x64, if that matters at all.

Concerns about (false) positives on virustotal.com

It is awesome that you provide the source code for soundkeeper. Unfortunately, compiling the source is not an easy task for most people 😁

I was wondering if some (crappy) anti-virus engines detect soundkeeper as a trojan because it is running in the background, without a GUI or CLI? Would it help to add a simple tray icon with an exit button?

SoundKeeperSineF10A5 not inaudible (aka total audible) on SoudBlaster Z

Just FYI

On SoundBlaster Z using Dolby Digital encoder with Logitech Dolby Digital speakers SineF10A5 is audible as low rumble. This was not the case on sound blaster X4 (USB device) doing encoding. As such seems specific to one type of SoundBlaster doing DD or DTS encoding.

SineF10A0 was silent and worked.

Not sure you care, but just an FYI incase anyone else insists it is audible but cant articulate why :-)

Stops working after exclusive mode on Windows 10

Hello VEG, hope you're doing good!

Thank you very much for this superb utility. It really is a great solution for my current setup.

I encounter a weird problem that I have trouble replicating. It seems to happen when the Netflix application is ran, but only after a while. Basically, when the problem happens, it's like Soundkeeper doesn't work anymore and I get the audio delay when I start a video (aka same behavior as if SoundKeeper is not started). The process is ongoing and visible in task manager.

My setup is a NUC win10 plugged to TV by HDMI and TV plugged to Samsung soundbar by HDMI.

I tried to run the software with:

  • SoundKeeperAll
  • SoundKeeperDigitalOpenOnly

Here's the log of the debug soft when the problem happened: problem.log

The program normally logs a lot when Netflix is open without playing but as the log shows, it stopped at some point with Leave rendering thread. Return code: 0.

I also tried to run the soft again to see if it corrected the first one but it didn't work:

2024/01/08 22:03:56.056 [15228] Sound Keeper v1.3.3.0 [2023/08/19]
22:03:56.056 [15228] Enter main thread.
22:03:56.056 [15228] Windows Build Number: 19045 (leaky WASAPI).
22:03:56.056 [15228] Exe File Name: SoundKeeperDigitalOpenOnlyd.exe.
22:03:56.056 [15228] Remaining time to sleeping: -2 seconds.
22:03:56.056 [15228] Device Type: Digital.
22:03:56.056 [15228] Stream Type: None (Open Only).
22:03:56.056 [15228] Periodicity: Disabled.
22:03:56.056 [15228] Stopping another instance...

The first instance was not stopping and the new one just closed its window.

The Netflix app has all those DRM related specifications and I'm wondering if this could cause the problem. If you need me to run any test or any different options, I'll gladly do it as I'm really interest in this tool and ways to help you better it!

I'll try more options and update this post if it's relevant.

Thanks a lot for your help.

Windows 11 powercfg Requestsoverride not working to allow sleep

Hi, after installing SoundKeeper my sound issues are gone, but my PC won't go to sleep. I've run powercg -requestsoverride and made sure that I have the correct driver listed, but it still prevents sleep no matter what (even after doing the override the driver keeps appearing in the powercg -requests command. Any other ideas for workarounds?

Feature Suggestion: Kill SoundKeeper on Workstation Lock, Start it again on Workstation Unlock

I have a feature suggestion to perhaps help with sleep issues.
Perhaps an option can be added for SoundKeeper to create two scheduled tasks in Task Scheduler. One to kill the process on workstation lock, to help with automatic sleep issues and another to start SoundKeeper back up on Workstation Unlock.

I've done this manually with two batch files and it works quite well. At least with Windows 11 the screen will automatically shut off if audio is playing allowing the workstation to lock and SoundKeeper to be killed. Once the workstation is unlocked SoundKeeper will start up again. At least on Windows 11 this should help with sleep issues.

Allow soundkeeper to start at specified volume

My sound device is AGGRESSIVE in its low volume cutting out, what i have to do is run sound keeper as SoundKeeper64AllSineF1A100, but when i do and it starts there is audible popping and i always have to set the volume down to 5 or something after which the hdmi stays active. Would it be possible to get the program to somehow launch at that low volume so i dont have to do it manually every time?

Unable to access site - most likely an SSL cert expired

Unable to access https://veg.by/en/projects/soundkeeper/ site - reported error is Impersonation / Malware (ISP)

I had to use an alternative ISP which has no smart protection in order to access the site and download the .zip file.

Suggestion

Create a release e.g. v1.3.3 on this repository itself and upload zip file directly to the GitHub repository - I've done the same on a fork of this repository on my account.

Audio periodically drops for a second

Hello,

This is an awesome tool, makes listening to different media much nicer since there is no 2s delay every time you play audio from a new source.

I have encountered a new problem from SoundKeeper, which is that every 10m or so, audio drops for 1s. Has anyone reported/experienced this before?

Thank you.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.