Skip to content

Instantly share code, notes, and snippets.

@skrimix
Last active April 3, 2021 12:14
Show Gist options
  • Save skrimix/f07755db70a3010b599daa48bfa234ee to your computer and use it in GitHub Desktop.
Save skrimix/f07755db70a3010b599daa48bfa234ee to your computer and use it in GitHub Desktop.
Lowers audio delay/pop on some laptops with Realtek audio by disabling inactivity timer for audio outputs
Get-ChildItem -path "HKLM:\SYSTEM\CurrentControlSet\Control\Class\{4d36e96c-e325-11ce-bfc1-08002be10318}" -ErrorAction SilentlyContinue | ForEach-Object {
$key = $_
if (($Key.GetValueNames() | % { $Key.GetValue($_) }) -match "Realtek High Definition Audio")
{
"Fixing output " + $key.Name
$power_subkey_path = $key.Name + "\PowerSettings"
[microsoft.win32.registry]::SetValue($power_subkey_path, "ConservationIdleTime", [byte[]](0xFF,0xFF,0xFF, 0xFF))
[microsoft.win32.registry]::SetValue($power_subkey_path, "IdlePowerState", [byte[]](0x00,0x00,0x00, 0x00))
[microsoft.win32.registry]::SetValue($power_subkey_path, "PerformanceIdleTime", [byte[]](0xFF,0xFF,0xFF, 0xFF))
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment