MaximumPC 2007 07

(Dariusz) #1

r & d BREAKING DOWN TECH —PRESENT AND FUTURE


62 MAXIMUMPC july 2007


W


indows Vista plays David Bowie
songs—and all other types of audio—
differently than Windows XP does. You won’t
see the differences, because the changes are
deep beneath the surface of the new OS, but
you’ll probably hear them. And that can be a
good thing—or a very bad thing.
Microsoft, you see, fi red most of the band
while designing Vista’s audio subsystem: The
company’s engineers rewrote and reorga-
nized the entire audio stack, moving nearly
all kernel functions to the user level. The ben-
efi ts of this move are twofold: First, any bug
that might creep into the audio system affects
only the audio system; it doesn’t bring down
the entire OS. Second, the change increases
the number of programmers who are qualifi ed
to develop new audio applications because
programming at the user level is much easier
than programming at the kernel level.
When you consider that the Windows
audio system has changed very little since
Windows 98, an overhaul was long over-
due. In the midst of this transition, however,
Microsoft dumped support for the custom
property set that enabled DirectSound and
DirectSound3D processing to be offl oaded
to a soundcard or even an integrated audio
system. The host CPU must now perform
these calls. (Microsoft says its research indi-
cates that only four percent of PC users have
soundcards, but we know that number is
much higher among Maximum PC readers.)

THE LONG AND WINDING ROAD
Over time, less and less software will rely
on the legacy Windows audio architec-
ture, and Microsoft claims that applications
properly designed to use DirectSound and
DirectSound3D should work fi ne in the new
environment. But without access to hardware
acceleration, many applications that utilize
widely adopted but proprietary advanced
audio APIs (application program interfaces),

such as Creative’s EAX, will revert to stereo
when running in Vista.
Microsoft worked with Creative Labs and
Nvidia for more than a year to develop a new
driver model that would enable hardware
acceleration in Vista but pulled out of the initia-
tive when Nvidia exited the audio-hardware
market. Creative then turned all its attention
to the development of the free OpenAL API.
Applications that use OpenAL behave the
same way in Vista as they do in XP: Calls to
OpenAL fall back to software mode (the code
is executed on the host CPU if no dedicated
soundcard is available). Creative is also devel-
oping a solution—called ALchemy—that will
translate DirectSound3D and EAX calls to
OpenAL in real time so that they can also be
executed in hardware.
Microsoft maintains that its changes
render Vista more stable than XP; what’s
more, it claims Vista’s audio system should
deliver higher fi delity than previous versions
of Windows. This latter claim stems from the
fact that the new audio system uses a 32-bit
fl oating-point pipeline, compared to XP’s
16-bit integer pipeline. If a DSP (digital signal
processing) algorithm causes a buffer over-
fl ow, the result is typically distortion and other
undesirable audible artifacts. This shouldn’t
happen with a 32-bit FP pipeline.
This doesn’t change the fact that Vista has
developed a bad reputation among gamers,
but it’s diffi cult to determine whether the oper-
ating system’s stability issues—not all of which
are associated with soundcards—are related
to the way games are coded for Windows

(i.e., poorly) or the way the OS itself is writ-
ten (ditto). Evaluating claims of audio fi delity
should be an easier task.

WILL IT GO AROUND
IN CIRCLES?
Vista’s audio architecture is based on three
major APIs: the Multimedia Device API (used
to catalog and manage audio endpoints,
such as microphones and speakers), the
Device Topology API (a tool programmers
use to interrogate audio hardware, such
as soundcards, so they can create a soft-
ware control panel that can access all that
device’s features), and the core of Vista’s
audio system, the Windows Audio Session
API (WASAPI), which actually renders and
captures audio streams.
Three smaller APIs take their place
beneath WASAPI in the Vista audio
stack: IAudioClient acts as a gateway
so that audio can stream between an
audio application and the Vista Audio
Engine. IAudioRenderClient is an interface
that audio-rendering applications use
to stream their output to an audio end-
point device. The last of these four APIs,
IAudioCaptureClient, is used by audio-
capture applications to record audio from
capture endpoints.
In what Microsoft describes as Shared
mode, each of these IAudio clients builds
a stream in the audio engine, and then
all these streams are mixed in the mix
buffer. The mixed audio is then passed
to the kernel-streaming endpoint. This is

White Paper: Audio in Vista


HOW IT WORKS Windows Vista Audio Stack


Microsoft had two key objectives for Vista’s audio system: Move as much of the process out of Kernel mode as possible and reduce
latency by signifi cantly streamlining the entire audio stack.

Cha- cha- cha- changes:


Microsoft re-architects


Windows’s sound system


BY ZACK STERN WASAPI

IAudioRenderClient

IAudioCaptureClient

IAudioClient

AUDIO ENGINE

MIX
BUFFER

User mode Kernel mode

Audio Stream

Audio Stream

Audio Stream Wave RTMini Port

Vendor
Miniport
Driver

DMA
Memory

Soundcard

Speaker
Soundcard
Free download pdf