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 02, 2007 at 5:40PM  

    Here's what I as a music producer have learned from reading music magazines and participating on many forums:

    1. Music software performs worse on Vista than it does on XP -- more glitches.  Even with good Vista drivers.

    2. There is no compelling feature in Windows Vista for an audio producer. As true 64-bit music apps start to come on line, there's some justification for going Vista64, but it will be some time before all the software packages we depend on will all play nice in 64-bit.

    3. WaveRT has only limited utility, limited hardware support, and no advantage for music production over ASIO.

    4. No software vendor in the music software world has released a program that requires Vista. They're only recently coming on line with versions that officially support Vista.

    And I have no chip on my shoulder about Vista. I  was in the Beta program before it was released. I just know it doesn't offer anyone serious about audio much except headaches.

  2. Posted on: November 03, 2007 at 9:41AM  

    How can you seek to excuse this ?? 'Windows is not a single-function device like a CD player' is not a quick answer, it is an excuse.

    Vista demands higher performance hardware than an any OS that has gone before it.  Many people have multiple core processors and 2GB or more of RAM.

    And yet playing audio requires such negligable bandwidth, a standard CD audio stream needing 150k/sec.  If Vista can't keep up with this it is an embarrassment for Microsoft.

    I'm not a gamer but I thought MS touts Vista as a serious gaming platform able to support high frame rate lifelike graphics.  How can this be when it struggles to maintain anything as mundane as an audio stream ?

    Andrew

  3. Posted on: November 03, 2007 at 4:24PM  

    The MAZZTer: Yeah I know, but if the system it is almost idle (nearly impossible with Vista however), why the glitch is still happening?

    LarryOsterman: Your explanation makes more sense to me. I really think that Vista its way more better than XP (only on a newer machine. 2gb ram at least, dual core), those glitches with CTRL+ALT+SUPR, high HDD activity (for example when closing VMWare Workstation with two running VMs and selecting Suspend machines) and waking up my LCD are the only complains I have using Vista.

    Anyway, My Creative EAX 8.1 performs outstanding thanks to Windows Vista sound enhancements and sound handling :)

  4. Posted on: November 03, 2007 at 6:47PM  

    I have not had any problems with standard windows sound (save for Skype glitches which are fixed with high priority) but adjusting setting for low latency ASIO applications I have found harder than it should be. No way is commonly known of giving the sound card driver high priority - save the blanket approach of giving priority to services rather than programs that is sometimes recommended. Also the "properties" of a program file should contain some way of setting the priority.

    A thought: on multi-core systems, if one or more cores could be reserved for the audio driver and audio applications, wouldn't virtually zero latency with no glitches be acheivable?

  5. Posted on: November 04, 2007 at 9:44AM  

    @CSMR:

    I tried to assign one core just for winamp.exe process, but CTRL+ALT+DEL "effect", always get some glitches in the sound.

    I have a REALTEK HD AUDIO 888 7.1, I don't know if this integrated audio card has a preprocessor, or support hardware buffer, but maybe with a high quality PCI/PCIex soundcard glitches dissapear.

  6. Posted on: November 04, 2007 at 6:41PM  

    I saw this and just had to share my experience because after searching forums and other sources I know this is very widespread.

    I have a Dell E1505 with the standard Sigmatel sound and a Dell 1500 wireless network card.  In my case and many others the Dell wireless driver is definately causing audio 'gliches'.  About every minute it will have static for a few seconds.    If the wireless card is turned off, the sound is fine.

    My biggest problem is that RTM of Vista is almost a year old now, yet Dell still does not bother to fix the issue.  We as consumers are helpless.

    My second is a desktop with an Intel motherboard and built in Analog Devices sound.  There are no drivers from the manufacturer, but Windows Update includes drivers for it.  Yet the sound simply stops working after a while.   A reboot is the only way to get it back, but it just happens again.

    Two systems, both audio has problems, and there is simply nothing the consumer can do.  That is the most frustrating part.   Both of these have been discussed in newsgroups and technology user forums so I know I am not alone.

    Really why is playing audio so difficult?   Microsoft has created the problem by making it difficult.  

    Microsoft has emphasised so much on backwards compatibility and creating "Application compatibility" settings, then they go and break something so simple like audio.

    Don't even mention simple file copying and networking...

  7. Posted on: November 05, 2007 at 2:42PM  

    Here is one little tool that I discovered that helped me to trobleshoot many audio glitches with tons of sound cards with my audio apps:

    http://www.thesycon.de/deu/latency_check.shtml

    Then open the Device Manager, and start disabling non-essential hardware. There is a good chance that you'll find some device driver that is somewhat greedy in holding the CPU.

    Another thing to check is that if your computer have a AGP or PCI graphics card (but not PCI Express) is that some graphics drivers in order to perform well on benchmarks monopolize the PCI bus for longer periods than what would be considered polite. The result, you get a few more FPS in your shooter, but at the expense of everything else. Sometimes you can set the PCI latency for the graphics card in the BIOS, and sometimes through some software tools. A good point to start on this:

    http://www.focusrite.com/answerbase/article.php?id=265

    Finally, start disabling unnecessary services. Many musicians have dual boot configurations, one just for music with everything disable and another one for the rest. In my case, I just have a bunch of scripts that disable everything that is not needed when I'm going to play with music.

    Doing all of this I managed to eliminate glitches on pretty much all of my sound cards (MOTU UltraLite, NI Audio Konttrol 1, NI Kore, Echo Indigo DJ, M-Audio Firewire Audiophile, M-Audio Ozonic, etc...)

  8. Posted on: November 05, 2007 at 9:45PM  

    One thing I am wondering is who decided to remove 6.1 support after it was added into XP?

    It seems as i am left with 5.1 or 7.1!

    How do I get my 6.1 back without going back to XP?

  9. Posted on: November 06, 2007 at 8:25AM  

    I got a brand new Quad (Q6600), 4GB of Ram and and RME Hammerfall and I still get glitches.

    W T F ! Great job Microsoft, great job...

    I'll soon switch to Apple and Logic 8 if this continues

  10. Posted on: November 06, 2007 at 11:22AM  

    I noticed my audio glitching the day I plugged in my headphones. I solved it by forcing Vista's Exclusive mode using ASIO4ALL and Foobar2000 -- I wrote it all down in a word doc on my blog. Hope it helps.

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