View Single Post
  #1  
Old 06-05-2018, 11:38 PM
GaryPuttsinburg GaryPuttsinburg is offline
Registered User
GaryPuttsinburg's PC Specs
 
Join Date: Jun 2018
Posts: 2
POST ID # = 957769
GaryPuttsinburg Reputation: 10
Important How To Reduce Corsair Link Stuttering By Changing Process Priority

I installed LL RGB fans with the Corsair Link software system and noticed stuttering and high CPU usage while it runs in the background. To get around this, I've created a windows PowerShell script which sets the two process priorities to their lowest levels which runs every time my machine starts up. Maybe this will help someone else too.

Script Pseudocode:
  • Store a log file with full path in a variable
  • Store both corsair processes in variables
  • Set maximum number of try attempts
  • try to get the first process
  • while the process is not found, try again until max try attempts is reached, sleeping for 2 seconds after each try
  • if the process is found, set its priority to "idle", otherwise log that the process was not found
  • reset try and repeat same logic for second corsair process.

Below is the script and how to install it:
  • Open a blank notepad document and paste the code below. Save the file as myscript.ps1 in the a safe place that won't get deleted (a folder in your documents, perhaps). You may have to change the file type from .txt to "all files".

Code:
$outFile = "C:\Users\<USER>\Documents\<CUSTOM_FOLDER>\customlog.txt"
$now = (Get-Date).ToUniversalTime() 
"Starting corsair priority droop: $now" > $outFile
$CorsairP1 = "CorsairLink4"
$CorsairP2 = "CorsairLink4.Service"
$maxtrys = 20
#try to get process number 1
$process = Get-Process -Name $CorsairP1 -ErrorAction SilentlyContinue
$trys = 0
while(!$process -And $trys -le $maxtrys)
{
	"$CorsairP1 not found: $trys" >> $outFile
	$trys++
	Start-Sleep -s 2
	$process = Get-Process -Name $CorsairP1 -ErrorAction SilentlyContinue
}
if($process)
{
    "$process found after try [$trys]" >> $outFile
    $process.PriorityClass = 'IDLE' 
    "$process set to IDLE" >> $outFile
}
else
{
    "$process did not start in time" >> $outFile
}

#try to get process number 2
$trys = 0
$process = Get-Process -Name $CorsairP2  -ErrorAction SilentlyContinue
while(!$process -And $trys -le $maxtrys)
{
	"$CorsairP2 not found: $trys" >> $outFile
	$trys++
	Start-Sleep -s 2
	$process = Get-Process -Name $CorsairP2  -ErrorAction SilentlyContinue
}
if($process)
{
    "$process found after try [$trys]" >> $outFile
    $process.PriorityClass = 'IDLE'
    "$process set to IDLE" >> $outFile
}
else
{
    "$process did not start in time" >> $outFile
}
  • Replace <USER> with your windows username
  • Replace <CUSTOM_FOLDER> with a folder where you'd like the script log to be saved.

Assign the script in the Local Group Policy Editor
  1. From the start menu search " Edit Group Policy"
  2. In the console tree, click Scripts (Startup/Shutdown) . The path is Computer Configuration\Windows Settings\Scripts (Startup/Shutdown) .
  3. In the right window pane, double-click Startup.
  4. Choose the PowerShell Scripts tab at the top, click Add.
  5. Click Browse and find for the myscript.ps1 script file you saved above.
  6. Click Ok, then Ok again to close the "Startup Properties" box.
  7. Close the Local Group Policy Editor, you're done.

Restart and check the log file to make sure both processes were found and their priority levels were lowered. You can also verify the script worked by checking their priorities in the Task Manager (right click each corsair process, click "go to details", click "set priority", see that it is at its lowest value)

Resources:
Assign Computer Startup Scripts
How to Write and Run PowerShell Scripts
Reply With Quote