What’s up with Audio in Windows Vista?


Steve Ball (the GPM for the MediaTech group (of which Windows Audio is a part)) discussed some of these changes in the Windows Audio Channel 9 video, but I’d like to spend a bit more time talking about what we’ve done.

A lot of what I’m discussing is on the video, but what the heck – I’ve got a blog, and I need to have some content to fill in the white space, so…

 

The Windows audio system debuted in Windows 3.1 with the “Multimedia Extensions for Windows”, or MME APIs.  Originally, only one application at a time could play audio, that was because the original infrastructure didn’t have support for tracking or mixing audio streams (this is also why the old audio apps like sndrec32 pop up an error indicating that another device is using the audio hardware when they encounter any error).

When Windows 95 (and NT 3.1) came out, the MME APIs were stretched to 32 bits, but the basic infrastructure didn’t change – only one application could play audio at one time.

For Windows 98, we deployed an entirely new audio architecture, based on the Windows Driver Model, or WDM.  As a part of that architectural change, we added the ability to mix audio streams – finally you could have multiple applications rendering audio at the same time.

There have been numerous changes to the audio stack over the years, but the core audio architecture has remained the same until Vista.

Over the years, we’ve realized that there three major problem areas with the existing audio infrastructure:

  1. The amount of code that runs in the kernel (coupled with buggy device drivers) causes the audio stack to be one of the leading causes of Windows reliability problems.
  2. It’s also become clear that while the audio quality in Windows is just fine for normal users, pro-audio enthusiasts are less than happy with the native audio infrastructure.  We’ve made a bunch of changes to the infrastructure to support pro-audio apps, but those were mostly focused around providing mechanisms for those apps to bypass the audio infrastructure.
  3. We’ve also come to realize that the tools for troubleshootingaudio problems aren’t the greatest – it’s just too hard to figure out what’s going on, and the UI (much of which comes from Windows 3.1) is flat-out too old to be useful.

Back in 2002, we decided to make a big bet on Audio for Vista and we committed to fixing all three of the problems listed above.

The first (and biggest) change we made was to move the entire audio stack out of the kernel and into user mode.  Pre-Vista, the audio stack lived in a bunch of different kernel mode device drivers, including sysaudio.sys, kmixer.sys, wdmaud.sys, redbook.sys, etc.  In Vista and beyond, the only kernel mode drivers for audio are the actual audio drivers (and portcls.sys, the high level audio port driver).

The second major change we made was a totally revamped UI for audio.  Sndvol32 and mmsys.cpl were completely rewritten (from scratch) to include new, higher quality visuals, and to focus on the common tasks that users actually need to do.  All the old functionality is still there, but for the most part, it’s been buried deep below the UI.

The infrastructure items I mentioned above are present in Vista Beta1, unfortunately the UI improvements won’t be seen by non Microsoft people until Vista Beta2.

Comments (42)

  1. Venu Anuganti says:

    Larry,

    Thanks for the sharing the info, good one. I will update my blog later with this info.

    I found an interesting issue with Real Player on the BETA1 of vista. Here is what happens:

    Lets say I am playing 2-3 songs in the real player, and during the song play, even when I reduce the volume by clicking on the volumn button from the taskbar, and when the player goes to next song, the volumn goes back to default one, which it picks during the load.

    I dont see this issue in 2003 or XP, but only happens on Vista.

    Any idea ? or any way I can tweak this ? I have a video captured for this, and will post this later once am back to home from office

  2. Jerry Pisk says:

    "one of the leading causes of Windows reliability problems" – tell me about it. I had to return about 90% of audio cards I bought because the drivers simply would not work for more than few minutes of playing audio on a multiple cpu system (and I mean multiple CPU, not just HT). Mixing multiple sources when you can actually have multiple requests coming in at literally the same time proved to be beyond most hardware manufacturers’ skill. The only card that worked reliably for me was an old AWE32 running Microsoft’s drivers but I can’t use that anymore as my current mobo does not have an ISA slot. I’m currently using a card based on VIA’s Envy24-HF chip with VIA’s drivers, it doesn’t sound as good as some other cards but at least it does not crash my box.

  3. Mark Lambourne says:

    Larry,

    On the "pro audio"-side, are there any changes that make it "easier" for applications to bypass things like kmixer and achieve real bit-perfect digital output of digital content?

    Presently, there are workarounds required – ASIO, kernel streaming, etc.

    Thanks,

    Mark

  4. Mark, I’ll be talking about the changes for pro audio in a bit.

  5. elPiojo says:

    Thanks for explaining this with all of us. My girlfriend is really going to like the possibility to turn down all those noisy Windows Sound, still being able to listen to Music. I hope the technology will make soon make it in a CTP build, unfortnatly it’s missing / turned of in 5219.

    It’s also great to discover these days, trough Blogs and channel9 video’s that Microsoft is very ambitious about Vista.

  6. msvista says:

    "UI improvements won’t be seen by non Microsoft people until Vista Beta2"…

    But you could post some screen shots in your blog, I assume :) :) :)

  7. Diego says:

    Larry,

    Are codecs are involved here? I mean…bad codecs are one of the typical "windows problem"…how are codecs involved in all this? Thats what you meant about "the leading causes of Windows reliability problems"? Are there some docs with a high-level overview of the whole audio subsystem (Sound is one of those things that nobody cares about because "it always works" and I’ve certainly not found anything about it 😉

  8. Dev Mazumdar says:

    I invite you to check out http://www.opensound.com/virtmix.html – Open Sound System (OSS) for UNIX (& Linux) does per-application volume control, per-application vu-metering and ossxmix and /dev/sndstat shows what app is running on which channel. We had these features this back in 2001 :)

    On top of it we have an RIAA-curve equalizer (yes the very same evil RIAA did some interesting research back in the 60s and 70s), fidelity enhance (similar to SRS-WoW) and stereo image enhance. I don’t know Vista doesn’t give you a system wide equalizer.

    BTW, 4Front isn’t just a UNIX shop, we do Windows and Mac OSX plugins as well (www.oss3d.com) – hope to exchange ideas with you guys sometime – glad to actually see who the Windows audio guys are!.

    I got to say Vista is looking pretty impressive . Good work!

    Regards

    Dev Mazumdar

    4Front Technologies

    dev@opensound.com

  9. steamy says:

    Larry,

    all this is sooo welcomed, i’m a pro-audio guy, and i was looking for info on Vista audio for years, no one answered my questions. Maybe you will:-)

    As i’m reading that you are going to post more info relating these things, the only question of mine is: are there going to be anything like ASIO built in windows? low latency (ultra-low) input-output stuff?

    Only one more…i’m REALLY REALLY curious: are there ANY changes to MIDI???? for example better MIDI timing?

    thank you guys for your work in this department, windows needed these changes so much!!!

    steamy

  10. Norman Diamond says:

    > The first (and biggest) change we made was

    > to move the entire audio stack out of the

    > kernel and into user mode.

    Um, that’s interesting. Are you still on speaking terms with a certain famous company who once moved the entire video stack out of user mode and into the kernel?

    Monday, September 19, 2005 3:06 PM by Jerry Pisk

    > The only card that worked reliably for me

    > was an old AWE32 running Microsoft’s drivers

    > but I can’t use that anymore as my current

    > mobo does not have an ISA slot.

    Plus your next OS (Vista) won’t support an ISA slot even if your mobo has one.

  11. Interested Observer says:

    Did it occur to anyone at Microsoft that the reason that audio/streaming drivers are so buggy is the *complete* lack of usable documentation? The audio/streaming documentation in the DDK is without peer in terms of how poor it is. A little bit of effort put into the documentation could have radically cut down on the number of buggy device drivers.

  12. Tim Smith says:

    Don’t get me started on the dual CPU/audio crash problems.

    MS has received MANY crash reports from my machine for that problem.

    grrrrrrrrrr

  13. elpiojo says:

    Thanks for explaining this with all of us. My girlfriend is really going to like the possibility to turn down all those noisy Windows Sound, still being able to listen to Music. I hope the technology will make soon make it in a CTP build, unfortnatly it’s missing / turned of in 5219.

    It’s also great to discover these days, trough Blogs and channel9 video’s that Microsoft is very ambitious about Vista.

  14. elpiojo, most of the audio infrastructure is there, but the UI that makes it all work isn’t :(

    It’s in the mainline Windows depot currently, so…

    Steamy, we’re not doing a lot with MIDI in Vista, unfortunately :(

    And I’ll talk a bit about the low latency stuff later on.

  15. Lee says:

    Just curious, if you rewrote some of your stuff from scratch did you code any of it managed? What are the guidelines (if any) when working within the operating system with regards to using the framework?

    Regards

    Lee

  16. Evert Mouw says:

    Oh, the OSS for Linux is already replaced by the ALSA system.

  17. Raptor says:

    Larry,

    You said that in pre-Vista versions there are many parts of the audio subsystem still on the Kernel.

    However, since XP the MS introduced a new service called Windows Audio. I though it was part of the attempt to move audio core out of the kernel. But as you say it is not. How does this service fits in the current and upcoming audio model?

    Thanx in advance,

    Raptor

  18. Raptor says:

    Larry,

    What does the Windows Audio service introduced in XP? I though it purpose was to take audio core code out of kernel.

    Raptor

  19. David Walker says:

    Does emptying the recycle bin still trigger the computer’s motherboard speaker to "beep" if the sound scheme is set to No Sounds? 😉

    I find that very annoying.

    If the sound for "Empty Recycle Bin" is set to "None", the built-in motherboard speaker beeps on emptying the recycle bin. If it is set to something else, the attached speakers play the sound. None seems to be "not an option". AFAIK, emptying the recycle bin is the only event that triggers this beep.

    Frustrating. I disabled the system device called "beep" on two of my systems, XP Pro and Windows 2000, out of frustration for this long-standing Windows bug! Windows Server 2000 has the same problem.

    David

  20. Roland says:

    Great news! Thanks for the info, Larry!

    And I’m especially happy that many parts of the audio subsystem have moved to USER, because just last week, I had a blue screen in kmixer.sys (brand new DELL computer with Soundblaster Audigy 2). I’m sure this would no longer have occurred in Vista.

    Regards

    Roland

  21. Raptor, the Windows Audio service in XP essentially just manages PnP notifications for winmm.dll to allow apps to use winmm without bringing in setupapi.dll.

    It does some more than that (related to management of audio global effects), but that’s essentially all it does.

    David, that’s interesting – let me see if it happens.

  22. Charlie Jolly says:

    If Windows Vista is serious about pro audio, I suggest that you check out the community at http://www.kvraudio.com/ and enlist their expertise.

    Also, comparisons will inevitably be made to Mac OSX and things like ‘Core Audio’, ‘MIDI Network driver’, ‘Audio Units’ etc. See http://www.apple.com/macosx/features/coreaudio/

  23. PatriotB says:

    Moving from kernel mode to user mode is quite a big change. One poster already mentioned how MS moved the video stack (back in NT 4) from user mode to kernel mode, to improve performance. I assume moving audio out of the kernel will have a small performance hit, but that it probably isn’t much for today’s computers.

    Interesting to see components moving out of the kernel, while at the same time, things are still moving into it (e.g. http.sys for IIS).

  24. Patriot, it’s a matter of trade-offs. Video was moved to the kernel primarily because User had to do SO many cross-process operations – it’s constantly sending messages from one process to another, moving it to the kernel allows a significant improvement in efficiency.

    For Audio, back in 1997, we couldn’t do mixing of audio streams without being in the kernel, in 2002, the story is quite different.

    I suspect that the hit will be less than most people expect.

    http.sys was moved to the kernel for a number of reasons – performance was one of them, but having a single HTTP parsing and rendering engine is another huge part of the equation.

  25. Soundtweaker says:

    I hope Windows Media Player 11 can play 24 bit audio files. It’s long overdue. I’m tired of using Winamp just to playback my DVD-Audio mixdowns.

  26. Andriy Gerasika says:

    Guys,

    check out http://www.indievolume.com/ – Windows desktop enchacement, having all functionality Vista is about to have and even more – it allows selection of per-application FX effects, and per-application selection of playback audio devices.

    Thanks,

    Andriy Gerasika

  27. Dans le monde de l'enregistrement audio numérique, la latence correspond au temps d’attente