• SONAR
  • Setting Processor Affinity to Help with Some Glitches
2016/06/09 20:26:24
DRanck
[EDIT] I would recommend applying all of the normal optimization techniques before following these ideas. This is not meant to be a solution for all audio glitches, but it may help if you have done all of the usual things and still occasionally experience intermittent glitches. [END EDIT]
 
I can't take all the credit for this. I found the idea on the Cubase forums. Here's the thinking:
 
Windows or other processes sometimes can cause audio programs like Sonar to "burp" when they interrupt Sonar's processing by doing their own thing. One way to help work around that is to limit the number of cores that Sonar uses. The idea is to leave one or 2 cores for Windows, etc. to use. Some people seem to have had success with this and I'll be testing it myself.
 
I've created a batch file to start VE PRO and my DAW and set its processor affinity. Save the included text to a file with a ".bat" extension and double click on it to run the program with a particular affinity preset. Of course you need to change the affinity value to suit your system and processor cores. See http://www.eightforums.com/tutorials/40339-cpu-affinity-shortcut-program-create-windows.html  for more on setting processor affinity. http://www.howtogeek.com/121775/how-to-force-windows-applications-to-use-a-specific-cpu/ will show you how to do this manually and how to check the processor affinity.
 
Ok, here's the batch file text. Create a text file, copy this text into it and save it with a ".bat" extension.
Hope this helps someone!
 
REM -------------------------------------------------------------------------------------------------------------------
REM Starts Sonar or Cubase and VE Pro and sets a processor affinity of 0 to 6, leaving the 8th free
REM -------------------------------------------------------------------------------------------------------------------
REM
REM Change the application name and path to match your installation
REM Change the affinity hex value {7F} to one of the following or roll your own
REM Affinity is a hex value based on a binary pattern where each binary digit represents
REM a single processor core starting at core 0. So 0101 would be cores 0 and 2 and 1000 would be core 3. 1111 would be
REM cores 0,1,2 and 3
REM
REM See also:
REM http://www.howtogeek.com/...-cpu-in-windows-vista/
REM
REM Samples of Hex numbers
REM ----------------------------------------
REM Binary Hex Processors
REM ----------------------------------------
REM 1 1 0 (first)
REM 11 3 10 (0 and 1)
REM 111 7 210 ( 0, 1 and 2)
REM 1111 F 3210 (etc.)
REM 11111 1F 43210
REM 111111 3F 543210
REM 1111111 7F 6543210
REM 11111111 FF 76543210
REM 11110000 F0 7654 (4,5,6,7)
REM 11000000 C0 76 (6 and 7)
REM -----------------------------------------
REM
REM put REM in front of pause to automatically hide the console window once you have your paths correct
REM -------------------------------------------------------------------------------------------------------------------
@echo on
REM start "Vienna Ensemble Pro x64" /affinity 7F "C:\Program Files\Vienna Ensemble Pro\Vienna Ensemble Pro x64.exe" -server
REM start "Cubase8.5" /affinity 7F "C:\Program Files\Steinberg\Cubase 8.5\Cubase8.5.exe"
start "SonarPro" /affinity 7F "C:\Program Files\Cakewalk\SONAR Professional\SONARPRO.exe"
pause
2016/06/09 20:32:34
bapu
I'd sure love to hear Jim Roseberry or Noel's take on this subject.
 
2016/06/09 20:35:11
bapu
Also, I recently watched this video and my pea brain hurts trying think if the OP technique is related, or not, to the causes of stutters and pops mentioned in the video. 
 
2016/06/09 20:55:06
microapp
Without knowing the details of how VE or CB (or Sonar) are implemented, trial and error optimization of this technique  would seem more likely to introduce problems rather than solve them.
If glitches are caused by process scheduling, it might make more sense to adjust priority rather than affinity.
Also, Cubase 8/8.5 seems less efficient than Sonar in processor utilization so I would want to hear from Noel before I spend any time on this.
2016/06/09 21:56:11
microapp
FWIW, here is (I think) the original post.
https://www.steinberg.net/forums/viewtopic.php?f=226&t=97152
It looks to me like one guy has an Nvidia video card/driver issue and another has an audio device driver problem.
Here is another Steinberg thread warning about possible repercussions
https://www.steinberg.net/forums/viewtopic.php?f=226&t=72473
I would only try this fix as an absolute last resort after Windows, video, and audio driver updates and the usual power option, speed step, wifi/lan, on-board/video card audio, and thread scheduling model tweaks.
2016/06/10 00:22:13
DRanck
I don't mean this to be a panacea for all audio glitches. The guy in the second post on the Cubase forums was trying to run 2 different version of Cubase on the same workstation - not a great idea. I sincerely doubt limiting processor affinity had anything to do with his issues. All setting processor affinity does is limit the cores that a process (and its child processes) has access to. 
 
Bapu - the video you linked is an excellent video that I have bookmarked in the past. The basic idea he is expounding (and rightly so) is that more often than not, the processor is not the problem. Having a monster CPU alone will not make for a better DAW.
 
Microapp - you are correct in that it is wise to apply all of the "normal" optimization techniques first. If you are familiar with the Pareto principle, setting processor affinity definitely does not fit into the 80/20 rule. I post it here just because it was something that may help when all else has not provided the desired results. I'll edit the post to reflect that.
2016/06/11 01:27:18
kevinwal
Curious to see how this works out for you. If I recall correctly (and I might not!) One of the updates to Windows 10 monkeyed around with DPC interrupt handler processor affinity to allow network and other device interrupts to be processed on other CPUs, leaving CPU0 for audio to help reduce latency. I'm not sure that user-mode code affinity settings will buy you much if you seek to reduce audio latency since most issues are happening at the kernel level, but hey, give it a try.
© 2026 APG vNext Commercial Version 5.1

Use My Existing Forum Account

Use My Social Media Account