Setting Processor Affinity to Help with Some Glitches

Author
DRanck
Max Output Level: -78 dBFS
  • Total Posts : 608
  • Joined: 2013/05/31 18:35:32
  • Location: Sarasota, FL USA
  • Status: offline
2016/06/09 20:26:24 (permalink)

Setting Processor Affinity to Help with Some Glitches

[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
post edited by DRanck - 2016/06/10 00:43:32

My Sound Cloud
Website
Youtube Channel
The way that I've always gone about making music, the rule of thumb, has just been to make what I love.
Amy Lee
 
Sonar Pro 64 (Newburyport), Akai Pro MPK 88, i7-4770K, ASUS Z87-PRO V,  32GB SDRAM 1866, SAMSUNG 840 EVO 500GB SSD, 2 - WD BLACK 2TB, Samsung USB 3.0 SSD, Win 10 Pro 64, Radeon R9 270 Video 2GB, Dell P2314T 23" Touchscreen, Gateway 23" monitor, Presonus USB Audio Interface, Surface Pro 2 w/ Xotopad as a control surface
#1

6 Replies Related Threads

    bapu
    Max Output Level: 0 dBFS
    • Total Posts : 86000
    • Joined: 2006/11/25 21:23:28
    • Location: Thousand Oaks, CA
    • Status: offline
    Re: Setting Processor Affinity to Help with Some Glitches 2016/06/09 20:32:34 (permalink)
    I'd sure love to hear Jim Roseberry or Noel's take on this subject.
     
    #2
    bapu
    Max Output Level: 0 dBFS
    • Total Posts : 86000
    • Joined: 2006/11/25 21:23:28
    • Location: Thousand Oaks, CA
    • Status: offline
    Re: Setting Processor Affinity to Help with Some Glitches 2016/06/09 20:35:11 (permalink)
    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. 
     
    #3
    microapp
    Max Output Level: -77 dBFS
    • Total Posts : 653
    • Joined: 2013/10/31 12:21:31
    • Location: Wondervu, CO
    • Status: offline
    Re: Setting Processor Affinity to Help with Some Glitches 2016/06/09 20:55:06 (permalink)
    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.

    Sonar Platinum, Cubase Pro 8.5, Reaper 5, Studio One 2
    Melodyne Studio 4, Finale 2012
    I7-5820K 4.5GHz, 32 GB DDR4-2800,3 monitors,Win 10 Pro
    Toshiba P75-A7100,l7-4900 2.4 Ghz/8MB Win 8.1 Pro
    Tascam FW-1884, Emu 0404USB, CMC-AI,Axiom 61
    Yamaha HS-50's, Sony SA-W2500, Sennheiser RS170's, ATH-M50
    Ibanez Jem7VWH, RG-1570
    Jackson DK2-S(Sustainiac),Les Paul Custom
    Digitech Valve-FX, GFX-1,TSR-24,RP-90
    #4
    microapp
    Max Output Level: -77 dBFS
    • Total Posts : 653
    • Joined: 2013/10/31 12:21:31
    • Location: Wondervu, CO
    • Status: offline
    Re: Setting Processor Affinity to Help with Some Glitches 2016/06/09 21:56:11 (permalink)
    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.

    Sonar Platinum, Cubase Pro 8.5, Reaper 5, Studio One 2
    Melodyne Studio 4, Finale 2012
    I7-5820K 4.5GHz, 32 GB DDR4-2800,3 monitors,Win 10 Pro
    Toshiba P75-A7100,l7-4900 2.4 Ghz/8MB Win 8.1 Pro
    Tascam FW-1884, Emu 0404USB, CMC-AI,Axiom 61
    Yamaha HS-50's, Sony SA-W2500, Sennheiser RS170's, ATH-M50
    Ibanez Jem7VWH, RG-1570
    Jackson DK2-S(Sustainiac),Les Paul Custom
    Digitech Valve-FX, GFX-1,TSR-24,RP-90
    #5
    DRanck
    Max Output Level: -78 dBFS
    • Total Posts : 608
    • Joined: 2013/05/31 18:35:32
    • Location: Sarasota, FL USA
    • Status: offline
    Re: Setting Processor Affinity to Help with Some Glitches 2016/06/10 00:22:13 (permalink)
    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.

    My Sound Cloud
    Website
    Youtube Channel
    The way that I've always gone about making music, the rule of thumb, has just been to make what I love.
    Amy Lee
     
    Sonar Pro 64 (Newburyport), Akai Pro MPK 88, i7-4770K, ASUS Z87-PRO V,  32GB SDRAM 1866, SAMSUNG 840 EVO 500GB SSD, 2 - WD BLACK 2TB, Samsung USB 3.0 SSD, Win 10 Pro 64, Radeon R9 270 Video 2GB, Dell P2314T 23" Touchscreen, Gateway 23" monitor, Presonus USB Audio Interface, Surface Pro 2 w/ Xotopad as a control surface
    #6
    kevinwal
    Max Output Level: -69 dBFS
    • Total Posts : 1066
    • Joined: 2007/07/27 19:07:43
    • Location: Rogers, AR
    • Status: offline
    Re: Setting Processor Affinity to Help with Some Glitches 2016/06/11 01:27:18 (permalink)
    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.

    Kevin Walsh
    My latest tunes are at Reverbnation, please give a listen!
     
    EVGA X58 Classified III, 24GB Kingston RAM, i7/970 6 core
    256GB SSD, 2TB HD
    Windows 10 Build 10586, Sonar Platinum, 2016.03
    MOTU 8Pre Interface
    #7
    Jump to:
    © 2025 APG vNext Commercial Version 5.1