Hello everyone,
Aura has this annoying bug where LightingService.exe uses high CPU load (~15-20%+) and the lights get stuck, depending on the color effects. The only way to get it working again would be to kill the LightingService.exe process and restart Aura. My lights get stuck several times a day, and I got tired of having to manually restart it all the time. Meanwhile, Asus has not fixed this problem, even with the latest stable v1.06.17.
I saw a
post where a user "freemanone" wrote a PowerShell script and schedule it to automate this process, but it didn't work for me for some reason. So I did a bit of Google reading and wrote my own script. For anyone who's in the same situation as me, here's a temporary fix (until Asus fix their crappy software):
We will create 2 files, one is the powershell script (aura_guard.ps1) and one is a file to run the script (run_aura_guard.bat). Use Notepad or any text editor to copy the content below (changing only what is needed like file path, etc.) and make sure to save it in the proper format (In Notepad, make sure you select "All Files" for "Save as type" when you save the file, or it'll save as .txt).
aura_guard.ps1
<# Aura Guard
Code by: teiji_ishida
The purpose of this script is to restart the LightingService when it reaches an abnormally high CPU load,
so it won't cause the lights to freeze.
Notes:
$maxCpuPercent: change the value to whatever your LightningService CPU % was before the lights freeze.
$logFile: change the path & filename here to your choice.
#>
While ($true) {
$i++
$processName = “LightingService”
$cpuCores = (Get-WMIObject Win32_ComputerSystem).NumberOfLogicalProcessors
$samples = (Get-Counter “\Process($processName*)\% Processor Time”).CounterSamples
$cpuPercent = [Decimal]::Round(($samples.CookedValue / $cpuCores), 2)
$maxCpuPercent = 10
If ($cpuPercent -ge $maxCpuPercent) {
Restart-Service $processName -Force
$logFile = "C:\Users\\Documents\aura_guard_log.txt"
$logFileSize = (Get-Item $logFile).length
$data = (Get-Date).ToString() + "`t $processName was restarted at $cpuPercent%."
# Keep log file size small (ie. Only overwrites data in log file if it exceeds 500 KB)
If ($logFileSize/1KB -le 500) {Add-Content -Path $logFile -Value $data} Else {Set-Content -Path $logFile -Value $data}
}
Else {
Start-Sleep -Seconds 5
}
}
run_aura_guard.batpowershell.exe -ExecutionPolicy UnRestricted -windowstyle hidden -file C:\Users\\Documents\aura_guard.ps1
What the aura_guard.ps1 does is check if LightingService.exe exceeds the max cpu percent I allow (I set mine at 10%, but you can change it to your desired percent based on your PC in the variable $maxCpuPercent). If it does exceeds it, then the script will kill the service and restart it. If not, the script will sleep for 5 seconds, and repeat. This script is very light on my PC, using <1% (0.10 to 0.30) on my 7700K @ 4.9Ghz.
One other thing to note, when the LightingService is restarted, the script will also write in a log file (aura_guard_log.txt, which you can also change the name and path in the variable $logFile) at what date/time the service was restarted and at what percentage. I wrote the script to keep the log size at max 500 KB, but you can reduce that number if you want. Or if you don't want any logging, then just delete every lines related to log in the code.
Lastly, to automate this, just open Task Scheduler and create a task for the "run_aura_guard.bat". Set it to run when a user is logged on and run with highest privilege (the bat file needs Admin privilege). If you did everything right, every time you turn on your PC and log on, it should show "The task is currently running. (0x41301)". Note: This script won't show up in your Task Manager, but you can use
Process Explorer to verify that it's running (look for powershell.exe).