|
Audio Asylum Thread Printer Get a view of an entire thread on one page |
For Sale Ads |
198.54.202.195
In Reply to: Have you tried changing affinity? posted by edward on April 18, 2007 at 12:07:27:
Hello Edward,Nothing whacky when it comes to Windows (unrelated stuff can affect sound). I’ve tried using affinity setting in Task Manager but can’t say there’s an improvement. You can automate this (without going through Task Manager) using process utility (link below) as used for bypassing Windows Explorer. This way, you can set affinities in .bat file (e.g. start /wait c:\process.exe –a foobar2000.exe 01). Beware of increasing CPU’s core voltage (more RF radiation & power consumption) with this – I’ve seen this increase to 1.28V (from 1.13V low).
On your setup, add Zalman TNN-300 case (~$700), Biostar mobo ($55) and do SATA RAID 0 with 2 laptop SATA drives. You’ll save on case and PSU (~$350). On version 0.1 setup and these additional changes, my system (computer transport > AA Prestige SE > Levinson 33H > JMLab Nova Utopia Be) is getting closer to benchmark reference system (based on turntable front-end with nothing left to chance – this setup costs ~$400k)!
Follow Ups:
Here is what I have been using for the past year in my dell dual core:
Sysinternals.com Process Explorer (find it with google..free dl)
It allows you to change priority and affinity for all processes, including those the windows task manager will not let you modify...winlogon.exe smss.exe, services.exe, etc...It takes a long time, so adding these to any batch fiile (which I don't have yet) would be a big time saver. I select everything other than foobar and change the priority to IDLE and gave affinity for only one processor. I'm not sure yet if one sounds better over the other, but I was using 1. Then, I set foobar to priority=realtime and use both processors.
Now that we have all these improvements to make by avoiding the windows explorer, it may be time for me to revisit which settings sound best..but that's what I was doing in the past.
I am looing forward to removing windows explorer from the chain to see how that sounds.
Last night I did some testing with affinity and processor settings and this is what I thought sounded best.
This is done just after running the batch file described in another section of this thread so that explorer is killed, and smss and winlogon are suspended. I used a start command in the batch file for the "process explorer" program so I could set these values for cmd.exe, which is the batch file program that stays running while foobar plays.I have System and foobar running at realtime, with every other process, including the cmd.exe program, smss.exe/winlogon.exe and their child processes, etc...etc..set to idle.
I have foobar affinity to set to processor 1 only, and everything else set to processor 0 only, including system.
Lastly, I kill the process explorer once I have made these setting changes.
Unless your system works differently, I think you will hear a smoother and more true-to-life soundstage. Please confirm.
Here's the full automation - no need to change anything manually. This time, 2 .bat files are needed. This first must be called foobar.bat and stored in c:\ (root directory). These settings don't increase CPU's core voltage which remains at lowest setting of 1.13V.As before, you can use either Task Manager or Process Explorer (just add/remove 'rem ' prefix under rem #5 of ?.bat). Also, you can change your soundcard driver setup utility (replace [SOUNDCARD] with correct process name, eg. hdsp32 and remove 'rem '). Note Task Manager or Process Explorer is set for normal priority and runs on CPU 0. Only Foobar2000 runs on CPU 1.
*** 1. FOOBAR.BAT (C:\) ***
@echo off
rem #1 Start Foobar2000 in RealTime
start /wait /REALTIME c:\progra~1\foobar2000\foobar2000.exerem #2 Resume Windows, Restore affinities & priorities, and Start UI
start /b /wait c:\process.exe -r winlogon.exe
start /b /wait c:\process.exe -r smss.exe
start /b /wait c:\process.exe -p system Normal
start /b /wait c:\process.exe -p csrss.exe Normal
start /b /wait c:\process.exe -p services.exe Normal
start /b /wait c:\process.exe -p svchost.exe Normal
start /b /wait c:\process.exe -p lsass.exe Normal
rem start /b /wait c:\process.exe -p [SOUNDCARD].exe Normal
start /b /wait c:\process.exe -a system 11
start /b /wait c:\process.exe -a csrss.exe 11
start /b /wait c:\process.exe -a services.exe 11
start /b /wait c:\process.exe -a svchost.exe 11
start /b /wait c:\process.exe -a lsass.exe 11
rem start /b /wait c:\process.exe -a [SOUNDCARD].exe 11
start /b c:\windows\explorer.exe
exit
*** 2. ?.BAT ***
@echo off
rem #1 Kill UI
start /b /wait c:\process.exe -k explorer.exerem #2 Suspend Windows
start /b /wait c:\process.exe -s smss.exe
start /b /wait c:\process.exe -s winlogon.exerem #3 Start Foobar2000
start /b /wait c:\process.exe -a cmd.exe 01
start /LOW c:\foobar.batrem #4 Adjust priorities, eg. High, RealTime, BelowNormal, Low;
rem # and Set Affinities
start /b /wait c:\process.exe -p system RealTime
start /b /wait c:\process.exe -p csrss.exe Low
start /b /wait c:\process.exe -p services.exe Low
start /b /wait c:\process.exe -p svchost.exe Low
start /b /wait c:\process.exe -p lsass.exe Low
rem start /b /wait c:\process.exe -p [SOUNDCARD].exe Low
start /b /wait c:\process.exe -a system 01
start /b /wait c:\process.exe -a csrss.exe 01
start /b /wait c:\process.exe -a services.exe 01
start /b /wait c:\process.exe -a svchost.exe 01
start /b /wait c:\process.exe -a lsass.exe 01
rem start /b /wait c:\process.exe -a [SOUNDCARD].exe 01
start /b /wait c:\process.exe -a foobar2000.exe 10rem #5 Start Task Manager or Process Explorer
start /b C:\WINDOWS\system32\taskmgr.exe
start /b /wait c:\process.exe -p taskmgr.exe Normal
rem start /b c:\procexp.exe /p:n
exit
.
I keep "?.bat" on my desktop and simply double-click it to get full optimizations.
These batch files work well. I'd still like to see winlogon and smss.exe set to low and one processor, even though they are suspended, just for piece of mind. These new batch files will save me a lot of time after rebooting.
This also restores windows priorities & affinities to original settings.Here's the revised commands:
*** 1. FOOBAR.BAT (C:\) ***
@echo off
rem #1 Start Foobar2000 in RealTime
start /wait /REALTIME c:\progra~1\foobar2000\foobar2000.exerem #2 Resume Windows, Restore affinities & priorities, and Start UI
start /b /wait c:\process.exe -r winlogon.exe
start /b /wait c:\process.exe -r smss.exe
start /b /wait c:\process.exe -p smss.exe AboveNormal
start /b /wait c:\process.exe -p winlogon.exe High
start /b /wait c:\process.exe -p system Normal
start /b /wait c:\process.exe -p csrss.exe High
start /b /wait c:\process.exe -p services.exe Normal
start /b /wait c:\process.exe -p svchost.exe Normal
start /b /wait c:\process.exe -p lsass.exe Normal
rem start /b /wait c:\process.exe -p [SOUNDCARD].exe Normal
start /b /wait c:\process.exe -a smss.exe 11
start /b /wait c:\process.exe -a winlogon.exe 11
start /b /wait c:\process.exe -a system 11
start /b /wait c:\process.exe -a csrss.exe 11
start /b /wait c:\process.exe -a services.exe 11
start /b /wait c:\process.exe -a svchost.exe 11
start /b /wait c:\process.exe -a lsass.exe 11
rem start /b /wait c:\process.exe -a [SOUNDCARD].exe 11
start /b /wait c:\process.exe -a cmd.exe 11
start /b c:\windows\explorer.exe
exit
*** 2. ?.BAT ***
@echo off
rem #1 Kill UI
start /b /wait c:\process.exe -k explorer.exerem #2 Suspend Windows
start /b /wait c:\process.exe -p smss.exe Low
start /b /wait c:\process.exe -p winlogon.exe Low
start /b /wait c:\process.exe -a smss.exe 01
start /b /wait c:\process.exe -a winlogon.exe 01
start /b /wait c:\process.exe -s smss.exe
start /b /wait c:\process.exe -s winlogon.exerem #3 Start Foobar2000
start /b /wait c:\process.exe -a cmd.exe 01
start /LOW c:\foobar.batrem #4 Adjust priorities, eg. High, RealTime, BelowNormal, Low;
rem # and Set Affinities
start /b /wait c:\process.exe -p system RealTime
start /b /wait c:\process.exe -p csrss.exe Low
start /b /wait c:\process.exe -p services.exe Low
start /b /wait c:\process.exe -p svchost.exe Low
start /b /wait c:\process.exe -p lsass.exe Low
rem start /b /wait c:\process.exe -p [SOUNDCARD].exe Low
start /b /wait c:\process.exe -a system 01
start /b /wait c:\process.exe -a csrss.exe 01
start /b /wait c:\process.exe -a services.exe 01
start /b /wait c:\process.exe -a svchost.exe 01
start /b /wait c:\process.exe -a lsass.exe 01
rem start /b /wait c:\process.exe -a [SOUNDCARD].exe 01
start /b /wait c:\process.exe -a foobar2000.exe 10rem #5 Start Task Manager or Process Explorer
start /b C:\WINDOWS\system32\taskmgr.exe
start /b /wait c:\process.exe -p taskmgr.exe Normal
rem start /b c:\procexp.exe /p:n
exit
In ?.bat under rem #4, last command reads:start /b /wait c:\process.exe -a foobar2000.exe 10
change this to:
start /b /wait c:\process.exe -a foobar2000.exe 11
This sets Foobar to operate on both CPUs. I find this to be better and you'll notice context switches (CS) drop to normal levels. Setting to either CPU adds another 1000-1200 CS per second. This is unnecessary overheads.
In process explorer, set interval to 1 second, double-click Foobar2000.exe, select Threads TAB. Column 'CSwitch Delta' gives CS per interval. Also, when using ASIO, foobar will have 3 threads (UI, Playback & ASIO Output).
Last night I changed this setting to have System running on both processors instad of one and at at Normal priority instead of realtime. I did not try low, so I'll try that next time.
In ?.bat under rem #4, System priority command reads:
start /b /wait c:\process.exe -p system RealTime
change this to:
start /b /wait c:\process.exe -p system Low
This change helped with my new E2140 processor.
I've never used Process Explorer before, so can you just clarify for me please. Provide as many details as you can.Where are you looking to see the CS levels that you say add another 1000-1200 per second?
I looked at the Threads TAB and at the CSwitch Delta column and the values did not change depending on whether I had affinity set to 1 CPU or both. One of the items was around 15-30 and the other item was around 850. (The third item had no value)
I did however look at the System Information, and there the Context Switches was around 2500 with affinity set to one CPU and around 4500 when set to both CPUs.
So any clarification as to what I'm supposed to be looking at, and what the optimal values should be, would be much appreciated.
Context Switch Delta in System Information refers to CS per internal for entire system. In Process Explorer, set interval in View > Update Speed. You're correct for Threads TAB on foobar. Why you have different CS could be due to version 0.8. I'm using 0.9.In foobar, thread ending with 0x962ed is for UI which for you would be the 15-30 CS per second. Thread 0x44f30 is for playback (including DSP stack) and the other in my case is for ASIO output. It seems that your playback thread shows 850. You can test this by individually suspending the thread - Suspend button is on Threads TAB. Optimal would be lower CS for UI and playback threads. However, in your case, as you lower latency, playback thread could increase CS - which is correct. Check which process is causing increase in CS when you have both CPUs active. You can add the CS Delta column via View > Select Columns > Process Performance. Let me know.
I get ~1100 CS increase on playback thread. Normal is 15 for UI, 70 for Playback and 3000 for ASIO. ASIO correlates to buffer size of 32 samples which gives 3000 buffers per second (96000/32). At 64 samples, CS is 1500. So for 0.9, optimal is low CS for UI & Playback whilst ASIO is determined by buffer size. CS for overall system is ~6600.
OK - Here's what I got:First of all, I do need to reiterate - I'm using foobar v0.8.3 and an exe version of the ASIO dll (this creates a separate process) - and no DSPs.
Here are the processes which change CSwitch Delta depending on whether affinity is set to one processor or two:
System Idle Process 1=420 2=1840
csrss 1=70 2=125
foobar 1=850 2=900
-ASIO 1=1025 2=1025
-UI 1=15 2=35Total CS is around 1=2400 2=4000
I should also mention that this is based on playing 24/96 WAVs. When I play 16/44 then foobar reduces to 560 and ASIO reduces to 710 (for one processor)
I do have foobar (v0.9.4.3) installed on another machine and CS Delta for foobar is around 70 for playback and around 500 for ASIO.
So it's interesting that for me, most of the values go up when switching affinity to both processors and the biggest culprit is the System Idle Process. Does that matter?
I’ve tested this on another PC and get similar behavior. PC uses onboard sound (@16/48). With KS, foobar uses 2 threads. ASIO4ALL allows for lower buffer settings (down to 64 samples - see image) and foobar in this case uses 4 threads. With either CPU, playback thread increases CS from ~138 to 170. One of the ASIO threads responds directly to buffer setting, i.e. lower samples gives more CS whilst other ASIO thread stays at ~5 CS.
It seems in your setup, its best when only 1 CPU is used. This may be foobar 0.8…
So, I installed foobar 0.8.3 with standard SSRC upsampler and no ASIO output. Playing 16/48, I get similar results as yours. Overall their are 6 foobar threads: UI (0x38c81), playback (0x204f6), output (foo_out_std) and 3 other threads which do minimal work. With foobar active on both CPUs, playback thread (0x204f6) increases CS from ~67 to ~105. This means optimal setup with foobar 0.8.3 is one CPU.
Yes, I've been setting affinity the same way you describe, as well as priority for foobar (REALTIME). However, I have all the remaining processes at NORMAL. What do you mean by setting to idle? The lowest option I see is "LOW". Is that the same?
Low=idle
What are you using to change the priority?
If you try to use Windows task Manager, it will not let you change the ones we suspend, or SYSTEM, which I especially think sounds better when changed form Normal to REALTIME. I do not really use Windows task Manager much.
Instead, use this free and safe program, which lets you change priority for all processes. It uses the term Idle instead of low.
http://www.microsoft.com/technet/sysinternals/utilities/ProcessExplorer.mspx
I put in my batch file so I can change the priority of the cmd.exe also
Yes I was trying to change these with Task Manager. Thanks for these recommendations. I'm going to the in-laws for Mother's Day weekend - I'll try this Process Explorer when I get back.
| ||||||||||||
|
This post is made possible by the generous support of people like you and our sponsors: