An Overview of Windows Sound and Music "Glitching" Issues

The following post comes from my colleague Steve Ball, Senior Program Manager for Sound in Windows Vista, and continues his team's on-going series on how Windows Vista treats various forms of audio.

-----

Part I: Why does my Windows sound sometimes "glitch?"

Windows is a rich and complex OS designed for multi-tasking users whose tasks must share access to scarce system hardware and resources.  Unfortunately, despite multiple decades of incredible advances in PC and CPU architectures, there are non-trivial, complex interactions between applications, processes, and devices in even the most advanced personal computers that make a supposedly "easy" task -- like playing back music without occasional glitches -- much more difficult than it may seem at first glance.

Another way of thinking about this:  it seems odd that a modern >$2000 PC may sometimes have trouble seamlessly playing back music when $20 CD players can effortlessly playback music without glitches. 

So why do many $2000 PCs occasionally glitch while playing back music?  The quick answer is this:  Windows is not a single-function device like a CD player.

A slightly longer answer goes like this:  even an average Windows machine today is commonly used simultaneously as a media player, word processor, presentation projector, spreadsheet number cruncher, authoring tool, photo editor, media server, video recorder, music composition tool, communications device, search engine, virus detector, data compressor and decompressor, and backup manager.  And these are only a few of the possible tasks and processes that are run at the same time on the hundreds of millions of Windows machines that are in use today.  Each of these tasks or processes, in isolation, would hardly tax the resources of modern PC hardware.  But in our multi-tasking world, unavoidable resource conflicts do sometimes occur between the huge and diverse ecosystem of Windows hardware that enables these tasks.  Even on the most expensive, brand-new machine, occasional glitches can occur if and when the system attempts to divide its finite resources among these multiple, diverse, independent, power-hungry activities.

What is a glitch?

A glitch is a perceivable error, gap or pop in the sound caused by discontinuities in the audio signal during playback or recording which result from processing or timing problems.  Glitches during music playback can sound like a loud "pop" or like a brief slice of silence randomly inserted where your music should have been.  Some customers have also described what "glitching" in their own words as:

  • audio stops a little bit
  • breaks up
  • choppy
  • clicking
  • corruption
  • crackle/crackling/crackly
  • interruption
  • jitters
  • jumpy
  • skipping/skip/skips

For the purpose of this discussion, let's lump all of these descriptions together under one general class of problems and call these "glitching."  While a glitch that happens during music playback can be annoying and unsettling, a glitch that occurs while you are recording or communicating with someone can result in frustrating and unacceptable data loss.

What causes my Windows sound and music to glitch?

Digital media processing is time-sensitive.  Playback requires specific work to be performed by a given deadline -- otherwise presentation or data loss can occur.  A "glitch" occurs when a deadline for time-sensitive processing is missed or when time-sensitive data is lost.

For example, in Windows Vista, playing back music involves "work" that must be done at least every 10 milliseconds so that there can be a continuous stream of music out to your speakers.  The "simple" task of playing back music consists of the following steps, all of which must be completed before a strict deadline:

  1. a small chunk of data from a music file needs to be read from a disc (CD or hard drive)
  2. this data needs to be "decompressed" or "decoded" (usually in system memory) so it can be streamed out to your speakers in a format that your sound hardware understands
  3. the decompressed sound data needs to be copied from system memory to your sound hardware memory
  4. the data in your sound hardware needs to be sent to your speakers at the appropriate time
  5. repeat steps 1-4 flawlessly every 10 milliseconds (ms)

In this example, if any of these steps aren't completed on time, then the user could hear a glitch in the music playback.

Elliot Omiya, Architect on the Sound dev team, puts this 10ms cycle into perspective:  "it's just slightly longer than the time it takes a nerve impulse to travel from the end of your finger to your brain (~8ms), known as NCV (nerve conduction velocity).  Because synapses are like network switches, there is switching time involved before the nerve impulse gets to the brain, i.e., switching time adds to latency."

There is some good news in this story:  Windows developers have made significant progress over the years in reducing glitching across key multimedia scenarios.  For example, music playback on an otherwise "lightly loaded" system can be generally as smooth as that $20 CD player.

But because of the multi-tasking nature of Windows and the vast array of new and legacy hardware in the ~1B PCs that are used to playback music today, this allegedly simple process is made more complex by the resource sharing that occurs between applications and hardware.  For example, it is not uncommon for certain older devices driver to occasionally "lock out" the CPU for 10-50ms, thereby causing obvious audio glitches.  This is just one example of the kinds of complex hardware, driver, and OS interactions that can cause glitches.

In summary, some of the common sources of glitches today include:

  • CPU starvation
  • GPU starvation
  • Resource contention from devices and drivers (sometimes called "IO contention")
  • Network devices
  • And, of course ... bugs in applications, OS, drivers and/or hardware

My colleague on the Windows Sound team, Larry Osterman, also pointed out to me recently that humans are actually "hard-wired" to be disturbed by audio glitches.  In an exchange about this topic, Larry observed that audio glitches are more obvious than video glitches because the ear's tuned to notice high frequency transients -- his visceral example of this idea is an image of a stick snapping in the woods behind you as an audio event that wakes you up before a bear wanders into your path. 

In my second post on this topic, I'll go a bit deeper in sharing details of work we’ve done in Windows Vista to address some of the known sources of potential sound glitches, including some additional background about a recent discovery of an apparent connection between multimedia playback and network throughput.

I wish to acknowledge the contributions and suggestions from my colleagues Hakon Strande, Richard Fricks, Alex Ferreira, Lan Ye, Larry Osterman and Elliot Omiya for this series of posts.


Comments

  1. Posted on: November 06, 2007 at 11:23AM  
  2. Posted on: November 12, 2007 at 1:34PM  

    I have a Dell XPS M1710 laptop with a core 2 duo processor and 4GB of RAM.  I run Vista Ultimate.  I also run 2 - 3 Windows XP Virtual Machines in VMWare, have Outlook 2007 open, IE7, and one to two terminal server connections open (oh yes, I earn every dime I make).

    While doing all that, I listen to online radio or my music collection via WMP.  I very seldom if ever enounter a glitch or skip.

    You guys need to check your hardware or something.

    JamesNT

  3. Posted on: November 16, 2007 at 2:41PM  

    I have noticed persistent audio glitching on my Dual Core AMD running Vista Media Center. It seems to be related to the Nvidia Dual TV tuner card. Nvidia's current Vista driver is so lame that it creates audio glitches about once every two seconds on most cable channels. I was forced to install the Nvidia XP driver (surprisingly it works under Vista) to fix this problem, although it also creates audio glicthes whenever the tuner changes channels. Nvidia apparently has no clue how to write correct Vista drivers without creating excessive DPC calls. None of these audio glitches happened with the XP Media Center using the same tuner card, so I have to wonder why the Vista drivers are causing so many audio problems. That's not acceptable in a Media Center PC.

  4. Posted on: November 19, 2007 at 2:06PM  

    I would like to add that much of the audio glitching that I've experienced appears to be related to excessive DPC (deferred procedure call) latency. I run Mark Russinovich's Process Explorer   (http://www.microsoft.com/technet/sysinternals/default.mspx) instead of the standard Windows Task Manager. It shows what % of the CPU is being devotd to DPCs. Whenever the audio glitching occurs, the DPC % of CPU is usually 10% or higher.

    I think too many of the Vista device drivers out there are creating excessive use of DPC calls which interrupt all other processing, including audio and video. Maybe they are forced into this by the changes to the Vista architecture or DRM requirements, who knows. I know that Nvidia doesn't seem to know how to write a driver for their Dual Tuner card that doesn't cause audio glitching.

  5. Posted on: November 20, 2007 at 5:10PM  

    I recently upgraded to Vista Home Premium (from XP). I too am plagued with these audio glitches and have spent what seems like days trying to resolve them. My problems seem to be specifically related to iTunes (and Quicktime used to process the audio for it). Playing audio in other apps such as WMP is fine. I have nForce4 SLI chipset (AMD) and AC97 on board audio. I have tried changing settings in Quicktime, upgrading to the latest chipset drivers, removing all but essential processes, increasing iTunes CPU priority, trying Quicktime 7.2 and 7.3, using different versions of iTunes, turning off sound enhancements and the list continues. I am really frustrated by this issue and the most annoying thing is that under XP with the same apps I had no issues whatsoever. Having invested time and money upgrading to VISTA I do not want to go back to XP if possible so I was glad to find this blog and hear that Microsoft are aware of these issues and trying to resolve them. I look forward to this and to the next article in this series.

    I feel better now (just a little).

    Gary

  6. Posted on: December 05, 2007 at 12:44PM  

    Hello,

    I'm experiencing serious popping, snapping, and stuttering issues with the audio playback on my Vista Ultimate machine. The description of this behavior is very similar to those of others tied to this thread. I’ve also found posts from gamers, av pros, creative product users, nvideo/ati video card owners, etc…. I haven’t quite exhausted all channels, but it would certainly make sense to include your team.  

    Here's an audio sample: http://www.4inno.com/Media/20071205SmashingPopsCracklesVlog.wmv

    Setup?

    *Line6 gearbox software v3.5 with guitar port USB interface (used for recording and playback)

    *Sony Vegas 8.0a capture utility

    *SigmaTel HD codec 6.10.5290.0 rear microphone input

    I’ve tried various monitoring configurations (headphones, no monitoring, Sigmatel HD analog/spdif outs) and I believe that my set up is not the culprit (i.e. no feedback loops…). The popping is like clipping and it occurs randomly. I’m 99% convinced that the issue is not isolated to the Line6 since I was experiencing similar popping issues with DV video playback from Vegas 8.0. I also notice the Windows sounds (from sound theme) also exhibit playback problems.

    There’s a lot of variability with the issue. I recently reinstalled the Intel Viiv drivers and I believed for a second that the issue was resolved. No luck….

    Here’s a quick overview of what I’ve checked/done:

    *Updated BIOS firmware

    *PCI latency checked and tested (32-256  cycles). Set back to 32 now

    *Fully patched with Microsoft

    *Updated to most recent drivers. Intel Viiv, 945G chipset drivers,

    *Disabled non essential services (i.e. search indexing, antivirus, readyboost, etc…).

    *Added additional RAM (3070 GB usable, PC4200 dual channel)

    *Set up SATA RAID 0 set, 2 WD 7200 rpm 16 MB cache drives

    *Set up dual boot with 64bit Vista Business (Line6 software/hardware not supported on 64 bit; defeats the purpose)

    What else? I turned the virtual memory page file off.

  7. Posted on: December 05, 2007 at 11:26PM  

    could you please help me  where to post the issues in Vista Sp1 (location)?

  8. Posted on: December 08, 2007 at 8:27PM  

    can you please stop avoiding the question, why highly complex tasks (like playing mp3 files) just became a problem with the latest OS?

    Correct me if I am wrong, but what you are basically saying is that users experiencing 'glitches' just can not grasp (or forget) the fact that playing back music can be (or is) a very complex task?

    But still, it seems, you fail to offer an explanation on why these tasks worked flawlessly on older OS.

    In conclusion, I appreciate your honesty and effort to help, but I feel that avoiding answering that question probably frustrates the already frustrated Vista user even more.

    Hoping my directness will be appreciated,

    GD

  9. Posted on: December 13, 2007 at 12:26PM  

    Hello, may be alittle late but I resolved the problem yesterday buy installing windows xp drivers of the sound card on vista... use the *.inf only. If everything goes ok sound won't glitch or stop.

    Hope it helps.

    And Merry X-Mas ;)

  10. Posted on: December 13, 2007 at 7:10PM  

    Hi Nick/Steve,

    I recently bought a new notebook and I am also affected by these glitches. Both my previous and new notebooks run Windows Vista Ultimate. The old one has no glitches, this new one has more powerful hardware and still it has glitches (both have a crappy onboard audio chip, although I think now from the same manufacturer).

    I find your explanation for the glithces - "Windows is not a single-function device like a CD player" - rather amusing. The technical explanaion is nice, but how come other operating systems, even older Microsoft systems are capable of handling such a thing, and Vista is not?

    I just hope this problem can be solved by Microsoft (and/or device driver writers), because quite frankly I find it ridiculous that a simple thing like audio playback cannot be handled flawlessly in Windows Vista.

Trackbacks

  1. Posted by: Larry Osterman's WebLog on October 30, 2007 at 7:49PM

    Nick White over at the Windows Vista Blog just posted an article written by Steve Ball , the PM in charge

  2. Posted by: Noticias externas on October 30, 2007 at 8:25PM

    Nick White over at the Windows Vista Blog just posted an article written by Steve Ball , the PM in charge

  3. Posted by: Where are we going, and what's with the handbasket? on October 31, 2007 at 4:29AM

    Steve Ball posted an article about some "glitching" issues in Vista . I can't resist adding my two cents.

  4. Posted by: Noticias externas on October 31, 2007 at 4:39AM

    Steve Ball posted an article about some "glitching" issues in Vista . I can't resist adding

  5. Posted by: Microsoft on January 09, 2008 at 4:31PM

    Steve Ball of Microsoft has a very interesting blog started on the Windows Vista Blog site about audio

  6. Posted by: pcpartfinder on January 31, 2008 at 7:59PM

    Last fall , Steve Ball, Microsoft's program manager for sound in Vista, posted a blog entry explaining

  7. Posted by: how to sell digital products on ebay on July 17, 2008 at 11:02AM

    Fujifilm is one of the leading providers of imaging and information products. Fujifilm and its employees are committed to providing consumers and professionals with the most innovative and highest- quality imaging and information products and services.

  8. Posted by: Pulse Audio on Ubuntu.Working Fine for you? - Page 2 - Open Source - TechEnclave on March 07, 2009 at 1:01AM

    Pingback from  Pulse Audio on Ubuntu.Working Fine for you? - Page 2 - Open Source - TechEnclave