<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Scritch, scratch</title><link>http://blogs.msdn.com/dcook/archive/2007/10/30/scritch-scratch.aspx</link><description>Steve Ball posted an article about some "glitching" issues in Vista . I can't resist adding my two cents. For me, Vista definitely glitches a LOT more than previous versions of Windows. As a fairly experienced developer, I think I understand the reasons</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>re: Scritch, scratch</title><link>http://blogs.msdn.com/dcook/archive/2007/10/30/scritch-scratch.aspx#5795918</link><pubDate>Wed, 31 Oct 2007 12:44:21 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:5795918</guid><dc:creator>Luciano</dc:creator><description>&lt;p&gt;Are you kidding? A mulitcore cpu CAN'T do what a 486 was doing flawlessy?&lt;/p&gt;
</description></item><item><title>re: Scritch, scratch</title><link>http://blogs.msdn.com/dcook/archive/2007/10/30/scritch-scratch.aspx#5805284</link><pubDate>Thu, 01 Nov 2007 00:33:10 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:5805284</guid><dc:creator>dcook</dc:creator><description>&lt;p&gt;Like I said before, this has nothing to do with processor speed, cores, or scheduling. It has to do with motherboard chipsets, drivers, and latency. The 486 didn't have the aggressive power saving modes that modern CPUs have.&lt;/p&gt;
&lt;p&gt;If you have a system with a good chipset and good drivers, you'll be fine with any modern CPU (100 MHz or higher). If you have a driver that takes too long to do its thing, it doesn't matter how fast your CPU is -- the driver still takes too long.&lt;/p&gt;
</description></item><item><title>re: Scritch, scratch</title><link>http://blogs.msdn.com/dcook/archive/2007/10/30/scritch-scratch.aspx#5821234</link><pubDate>Fri, 02 Nov 2007 00:44:02 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:5821234</guid><dc:creator>Wesley</dc:creator><description>&lt;p&gt;I am actually writing about your comment on Ben's site re serial ports. I am not sure what you need to do with your ports and maybe you already understand the following, however VBScript can be used to configure your ports on the fly. While the following sample is written with VS in mind, Ben's blog shows how you can set up a VPC to respond to VBScript. I use the script to assign a port and cpu resources to the current window. The source for the following is from his book.&lt;/p&gt;
&lt;p&gt;Option Explicit&lt;/p&gt;
&lt;p&gt;CONST vmSerialPort_HostPort = 0&lt;/p&gt;
&lt;p&gt;CONST vmSerialPort_TextFile = 1&lt;/p&gt;
&lt;p&gt;CONST vmSerialPort_NamedPipe = 2&lt;/p&gt;
&lt;p&gt;CONST vmSerialPort_Null = 3&lt;/p&gt;
&lt;p&gt;dim vs, vm, serialPort, aSerialPort, savedParameter, ParameterFile, objFSO, objTextStream&lt;/p&gt;
&lt;p&gt;'10 Check that the script is running at the command line.&lt;/p&gt;
&lt;p&gt;If UCase(Right(Wscript.FullName, 11)) = &amp;quot;WSCRIPT.EXE&amp;quot; Then&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;Wscript.Echo &amp;quot;This script must be run under CScript.&amp;quot;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;Wscript.Quit&lt;/p&gt;
&lt;p&gt;End If&lt;/p&gt;
&lt;p&gt;On Error Resume Next&lt;/p&gt;
&lt;p&gt;'17 Attempt to connect to Virtual Server&lt;/p&gt;
&lt;p&gt;Set vs = CreateObject(&amp;quot;VirtualServer.Application&amp;quot;)&lt;/p&gt;
&lt;p&gt;If Err.number &amp;lt;&amp;gt; 0 Then&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;Wscript.Echo &amp;quot;Unable to connect to Virtual Server.&amp;quot;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;Wscript.Quit&lt;/p&gt;
&lt;p&gt;End if&lt;/p&gt;
&lt;p&gt;On Error Goto 0&lt;/p&gt;
&lt;p&gt;'25 Read data from previously saved parameter file&lt;/p&gt;
&lt;p&gt;ParameterFile=&amp;quot;VMCadd.dat&amp;quot;&lt;/p&gt;
&lt;p&gt;'29 Open requested parameter file&lt;/p&gt;
&lt;p&gt;Set objFSO = CreateObject(&amp;quot;scripting.filesystemobject&amp;quot;)&lt;/p&gt;
&lt;p&gt;Set objTextStream = objFSO.OpenTextFile(ParameterFile, 1, True)&lt;/p&gt;
&lt;p&gt;savedParameter = objTextStream.ReadLine&lt;/p&gt;
&lt;p&gt;objTextStream.close&lt;/p&gt;
&lt;p&gt;'35 TURN OFF CADD03 PORT&lt;/p&gt;
&lt;p&gt;set vm = vs.FindVirtualMachine(&amp;quot;Cadd03&amp;quot;)&lt;/p&gt;
&lt;p&gt;'39 Set CPU resource allocations&lt;/p&gt;
&lt;p&gt;vm.Accountant.SetSchedulingParameters 0, 100, 75&lt;/p&gt;
&lt;p&gt;'42 Configure the first serial port to connect to a null port, 1st'x to initilize tablet&lt;/p&gt;
&lt;p&gt;set aSerialPort = vm.serialPorts.item(1)&lt;/p&gt;
&lt;p&gt;aSerialPort.configure vmSerialPort_Null, &amp;quot;Com1&amp;quot;, false&lt;/p&gt;
&lt;p&gt;aSerialPort.configure vmSerialPort_Null, &amp;quot;Com1&amp;quot;, false&lt;/p&gt;
&lt;p&gt;'48 TURN OFF CADD04 PORT&lt;/p&gt;
&lt;p&gt;set vm = vs.FindVirtualMachine(&amp;quot;Cadd04&amp;quot;)&lt;/p&gt;
&lt;p&gt;'52 Set CPU resource allocations&lt;/p&gt;
&lt;p&gt;vm.Accountant.SetSchedulingParameters 0, 100, 75&lt;/p&gt;
&lt;p&gt;'55 Configure the first serial port to connect to a null port&lt;/p&gt;
&lt;p&gt;set aSerialPort = vm.serialPorts.item(1)&lt;/p&gt;
&lt;p&gt;aSerialPort.configure vmSerialPort_Null, &amp;quot;Com1&amp;quot;, false&lt;/p&gt;
&lt;p&gt;aSerialPort.configure vmSerialPort_Null, &amp;quot;Com1&amp;quot;, false&lt;/p&gt;
&lt;p&gt;'61 TURN OFF CADD05 PORT&lt;/p&gt;
&lt;p&gt;set vm = vs.FindVirtualMachine(&amp;quot;Cadd05&amp;quot;)&lt;/p&gt;
&lt;p&gt;'65 Set CPU resource allocations&lt;/p&gt;
&lt;p&gt;vm.Accountant.SetSchedulingParameters 0, 100, 75&lt;/p&gt;
&lt;p&gt;'68 Configure the first serial port to connect to a null port&lt;/p&gt;
&lt;p&gt;set aSerialPort = vm.serialPorts.item(1)&lt;/p&gt;
&lt;p&gt;aSerialPort.configure vmSerialPort_Null, &amp;quot;Com1&amp;quot;, false&lt;/p&gt;
&lt;p&gt;aSerialPort.configure vmSerialPort_Null, &amp;quot;Com1&amp;quot;, false&lt;/p&gt;
&lt;p&gt;'74 TURN ON PORT in Parameter data file&lt;/p&gt;
&lt;p&gt;set vm = vs.FindVirtualMachine(savedParameter)&lt;/p&gt;
&lt;p&gt;'78 Set CPU resource allocations&lt;/p&gt;
&lt;p&gt;vm.Accountant.SetSchedulingParameters 0, 100, 1000&lt;/p&gt;
&lt;p&gt;'81 Configure the first serial port to connect to a physical serial port&lt;/p&gt;
&lt;p&gt;set aSerialPort = vm.serialPorts.item(1)&lt;/p&gt;
&lt;p&gt;aSerialPort.configure vmSerialPort_HostPort, &amp;quot;Com1&amp;quot;, true&lt;/p&gt;
</description></item><item><title>re: Scritch, scratch</title><link>http://blogs.msdn.com/dcook/archive/2007/10/30/scritch-scratch.aspx#5822980</link><pubDate>Fri, 02 Nov 2007 02:38:25 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:5822980</guid><dc:creator>dcook</dc:creator><description>&lt;p&gt;Wesley - &lt;/p&gt;
&lt;p&gt;Thanks. That's cool. Unfortunately, it doesn't help much. I need to be able to have programs on my host machine talk over the serial port to programs on my guest machines. I can do this once by connecting a null modem cable from COM1 to COM2, assigning one of the Virtual PC COM ports to physical COM1, and attaching the program on my host machine to COM2. But now I'm out of physical COM ports, so this doesn't work when I need to use two COM ports at once or when I need to talk to multiple guest machines. The programs I need to use don't work with named pipes.&lt;/p&gt;
&lt;p&gt;One program I've been looking at is an open source driver called com0com. That might work.&lt;/p&gt;
</description></item><item><title>re: Scritch, scratch</title><link>http://blogs.msdn.com/dcook/archive/2007/10/30/scritch-scratch.aspx#5861601</link><pubDate>Sat, 03 Nov 2007 18:56:58 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:5861601</guid><dc:creator>Peter Kirn</dc:creator><description>&lt;p&gt;I have to disagree here. A choice between lower latency and &amp;quot;glitch-free&amp;quot; performance is an artificial one. You ought to be able to have both. In fact, there are plenty of scenarios (ASIO drivers, for one, and some of the other examples people give here) where you got lower latency but more reliable performance ** on XP **. &lt;/p&gt;
&lt;p&gt;So don't blame lower latency for Vista's glitch problems. I think the issue is, we're not really seeing the improvements promised by other enhancements like the scheduling stuff, and we're having to fight a bunch of unreliable, buggy drivers. We really need a commitment from Microsoft to get better audio performance.&lt;/p&gt;
&lt;p&gt;I think in the end, you'll wind up with something that makes everyone happier. There are going to be more and more media-rich applications that want BOTH low-latency performance AND reliable, glitch-free playback, from communications to audio and music to richer sound in games. &lt;/p&gt;
&lt;p&gt;Anyway, fwiw, I'm very pleased with my performance on Vista -- provided I use Winamp, not WMP for playback, and thanks to better drivers than I had a few months ago (particularly NVIDIA video drivers)&lt;/p&gt;
</description></item><item><title>re: Scritch, scratch</title><link>http://blogs.msdn.com/dcook/archive/2007/10/30/scritch-scratch.aspx#6034282</link><pubDate>Sat, 10 Nov 2007 03:58:38 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:6034282</guid><dc:creator>dcook</dc:creator><description>&lt;p&gt;Again, just to clarify -&lt;/p&gt;
&lt;p&gt;The audio stack on Vista is designed to have lower latency than the default audio stack of XP. As a consequence, drivers that lock up the system are more likely to cause audible glitches than they were on XP.&lt;/p&gt;
&lt;p&gt;If everything is working as it should be, you can get low latency on either XP or Vista. The ASIO drivers are a good example of this. As long as your other drivers are cooperating, you can get glitch-free audio with low latency on any modern OS.&lt;/p&gt;
&lt;p&gt;On the other hand, if your driver goes out to lunch for longer than your audio stack can tolerate, it doesn't matter what the OS or the scheduler does. Your audio is going to glitch. The lower the latency, the less time the driver has to keep the system locked before it becomes a problem.&lt;/p&gt;
&lt;p&gt;This isn't a problem with Vista's scheduler or lack of improvements there. IRQ handlers simply aren't scheduled. They trump everything except other IRQ handlers. When the IRQ comes in, the handler immediately runs until it returns or is interrupted by a higher priority IRQ. If it takes a long time to return, you've got a problem.&lt;/p&gt;
&lt;p&gt;An XP machine with poorly written drivers will not be able to play low-latency audio glitch-free, regardless of the CPU speed. Same with Vista. Same with Linux. There's nothing the OS can do about it.&lt;/p&gt;
&lt;p&gt;An XP machine with good drivers will be able to play low-latency audio glitch-free (as long as the CPU is up to the task of decoding the audio). Same with Vista. Same with Linux.&lt;/p&gt;
&lt;p&gt;The main difference with Vista is that the latency is lower by default, so the &amp;quot;poorly-written drivers&amp;quot; become more obvious. Driver behavior that wasn't a problem with XP's default audio stack is now a serious problem with Vista's default audio stack. However, the behavior that causes a problem with Vista's audio stack would also cause a problem with a low-latency XP audio stack.&lt;/p&gt;
&lt;p&gt;There are some things that Microsoft could do. Microsoft could provide a way to increase the latency of their audio stack to reduce the impact of poorly-written drivers. Microsoft could provide their own implementation of the poorly written drivers. Microsoft could pressure the vendor to improve their poorly written drivers. But I'm not sure how it would help to have a commitment from Microsoft to get better audio performance. The Microsoft part of the equation really isn't the problem&lt;/p&gt;
</description></item><item><title>re: Scritch, scratch</title><link>http://blogs.msdn.com/dcook/archive/2007/10/30/scritch-scratch.aspx#7255785</link><pubDate>Sat, 26 Jan 2008 17:16:27 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:7255785</guid><dc:creator>Roger Barrett</dc:creator><description>&lt;p&gt;It is, as dcrook says, largely a matter of process priorities, and all modern OS implementations have to make choices about how they schedule tasks (which includes IRQ handlers). The real problem that OS implementations tend to have is that they are &amp;quot;one size fits all&amp;quot; solutions trying to do their best for everyone, and often not succeeding.&lt;/p&gt;
&lt;p&gt;Windows, in particular, has almost no ability to be tailored to what it's purchaser wants. For certain machines dedicated to particular tasks, maybe 80-90% of Windows code base is just a wasteful resource hog, but you simply don't have the control to get rid of it. With a lot of effort, you can probably find out how to disable a lot of pointless processes, and maybe also disable hardware/drivers that cause interference, but it is certainly not made easy to have Windows behave the way you might want it.&lt;/p&gt;
&lt;p&gt;A better solution for low latency than Vista is the one adopted by the Linux kernel when compiled with real &amp;nbsp;time support. Even with bad drivers, you can modify the priority of the different IRQs and processes/applications to whatever you want. This means you can, for example, &amp;nbsp;set the priority of the IRQ for audio hardware, plus the priority of other audio processes and applications above everything else in the system to get sub-millisecond latency. Of course, you still need to ensure that any process with high priority is coded in a real-time aware manner (doesn't hog the processor), but at least the oprions to configure the OS are there; Windows developers could learn from that.&lt;/p&gt;
</description></item></channel></rss>