Laptop Whine Killer

Background: Lenovo’s W510 laptops produce two kinds of high-pitched noises. One of those is especially prominent and irritating. It appears mainly when the laptop is running on battery power in a near-idle state.

Solution: Searching on the Internet produced this 2-year old thread on Lenovo’s support forums.
The only working solution to this embarrassing whine was to start an audio playback, so that the CPU would not enter a deep power-saving state. The other alternative was to disable power management in BIOS. Disabling power management is not desirable as it negatively affects battery consumption, while silent sound playback has almost no negative impact.
I put together a small system tray program, which does just that – it will play an embedded silent 1-second long WAV file in an indefinite loop. This will effectively stop the whine at the cost of a slightly shorter battery life. The effective CPU usage while running the suppression is less than 0.1%.
The program can automatically sense if your laptop runs on AC power and disable the whine suppression loop. This feature is not enabled by default as there is still some whine present when on AC power. It is possible to adjust the settings from the system tray context menu.

[Source code]

Version history:
1.00 – 03.07.2012 – Initial release.
1.01 – 04.07.2012 – Save automatic detection setting state to the registry. Improve power state detection reliability.
1.02 – 04.07.2012 – Allow only one instance of running application.
1.10 – 25.04.2013 – Added an option to auto-launch the program together with Windows.

The icon used in this program comes from Icon Archive.