![]() ![]() |
Audio Asylum Thread Printer Get a view of an entire thread on one page |
For Sale Ads |
198.8.3.35
In Reply to: Only run second "?.bat" (which calls foobar.bat) posted by cics on May 12, 2007 at 03:49:02:
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.
![]()
Follow Ups:
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.
| ||||||||||||
|
This post is made possible by the generous support of people like you and our sponsors: