DirectSound
Encyclopedia
DirectSound is a software component of the Microsoft
Microsoft
Microsoft Corporation is an American public multinational corporation headquartered in Redmond, Washington, USA that develops, manufactures, licenses, and supports a wide range of products and services predominantly related to computing through its various product divisions...

 DirectX
DirectX
Microsoft DirectX is a collection of application programming interfaces for handling tasks related to multimedia, especially game programming and video, on Microsoft platforms. Originally, the names of these APIs all began with Direct, such as Direct3D, DirectDraw, DirectMusic, DirectPlay,...

 library for the Windows
Microsoft Windows
Microsoft Windows is a series of operating systems produced by Microsoft.Microsoft introduced an operating environment named Windows on November 20, 1985 as an add-on to MS-DOS in response to the growing interest in graphical user interfaces . Microsoft Windows came to dominate the world's personal...

 operating system
Operating system
An operating system is a set of programs that manage computer hardware resources and provide common services for application software. The operating system is the most important type of system software in a computer system...

. DirectSound provides a low-latency interface to the sound card
Sound card
A sound card is an internal computer expansion card that facilitates the input and output of audio signals to and from a computer under control of computer programs. The term sound card is also applied to external audio interfaces that use software to generate sound, as opposed to using hardware...

 driver and can handle the mixing and recording of multiple audio streams.

Besides providing the essential service of passing audio data to the sound card, DirectSound provides other essential capabilities such as recording and mixing sound, adding effects to sound (e.g., reverb
Reverberation
Reverberation is the persistence of sound in a particular space after the original sound is removed. A reverberation, or reverb, is created when a sound is produced in an enclosed space causing a large number of echoes to build up and then slowly decay as the sound is absorbed by the walls and air...

, echo
Echo (phenomenon)
In audio signal processing and acoustics, an echo is a reflection of sound, arriving at the listener some time after the direct sound. Typical examples are the echo produced by the bottom of a well, by a building, or by the walls of an enclosed room and an empty room. A true echo is a single...

, or flange
Flanging
Flanging is an audio effect produced by mixing two identical signals together, with one signal delayed by a small and gradually changing period, usually smaller than 20 milliseconds. This produces a swept comb filter effect: peaks and notches are produced in the resultant frequency spectrum,...

), using hardware accelerated buffers, and positioning sounds in 3D space
3D audio effect
3D audio effects are a group of sound effects that attempt to widen the stereo image produced by two loudspeakers or stereo headphones, or to create the illusion of sound sources placed anywhere in 3 dimensional space, including behind, above or below the listener.There are several types of 3D...

. DirectSound also provides a means to capture sounds from a microphone or other input and controlling capture effects during audio capture.

After many years of development, today DirectSound is a mature API, and supplies many other useful capabilities, such as the ability to play multichannel sounds at high resolution. While DirectSound was designed to be used by games, today it is used to play audio in a large number of audio applications. DirectShow
DirectShow
DirectShow , codename Quartz, is a multimedia framework and API produced by Microsoft for software developers to perform various operations with media files or streams. It is the replacement for Microsoft's earlier Video for Windows technology...

 uses DirectSound's hardware capabilities when the hardware supports it.

Features

DirectSound is a user mode API that provides an interface between applications
Application software
Application software, also known as an application or an "app", is computer software designed to help the user to perform specific tasks. Examples include enterprise software, accounting software, office suites, graphics software and media players. Many application programs deal principally with...

 and the sound card
Sound card
A sound card is an internal computer expansion card that facilitates the input and output of audio signals to and from a computer under control of computer programs. The term sound card is also applied to external audio interfaces that use software to generate sound, as opposed to using hardware...

 driver, enabling applications to produce sounds and play back music.

DirectSound was considered revolutionary when it was introduced in 1995, as it featured multiple simultaneous audio streams and allowed several applications to access the sound card simultaneously. Before that, the game developers were required to implement their own audio rendering engine in software.

DirectSound provides sample rate conversion
Sample rate conversion
Sample rate conversion is the process of converting a signal from one sampling rate to another, while changing the information carried by the signal as little as possible...

 and sound mixing (volume
Volume
Volume is the quantity of three-dimensional space enclosed by some closed boundary, for example, the space that a substance or shape occupies or contains....

 and pan
PAN
Pan and panning can have many meanings as listed below in various categories.-Prefix:* Pan- as a prefix , e.g.:** Pan American** Pan-Americanism...

) for an unlimited number of audio sources, however the practical limits are the number of hardware audio sources and the performance of software mixer.

The DirectSound architecture features a concept of the "ring buffer" which would be continuously played in a cycle. The application programmer creates the sound buffer then continously queries its the state through the "read cursor" and updates it with the "write cursor". There are two types of buffers - a "streaming" buffer, which holds continous sounds such as background music, and a "static" buffer which holds short sounds.

On supported sound cards, DirectSound would try to use "hardware accelerated" buffers, i.e. the ones which either can be placed in local sound card memory, or can be accessed by the sound card from the system memory. If hardware acceleration is not available, DirectSound would create audio buffers in the system memory and use purely software mixing.

Some late DOS-era "wavetable
Sample-based synthesis
Sample-based synthesis is a form of audio synthesis that can be contrasted to either subtractive synthesis or additive synthesis. The principal difference with sample-based synthesis is that the seed waveforms are sampled sounds or instruments instead of fundamental waveforms such as the saw waves...

" sound cards such as Sound Blaster AWE32
Sound Blaster AWE32
Sound Blaster AWE32 is an ISA sound card from Creative Technology. It is an expansion board for PCs. The Sound Blaster AWE32, introduced in March 1994, was a near full-length ISA sound card, measuring 14 inches in length, due to the number of features included.-MIDI capability:The Sound Blaster...

 and Gravis Ultrasound
Gravis Ultrasound
Gravis UltraSound or GUS is a sound card for the IBM PC compatible system platform, made by Canada-based Advanced Gravis Computer Technology Ltd...

 featured dedicated DSP
DSP
- Computing :* Digital signal processing, the study and implementation of signals in digital computing and their processing methods* Digital signal processor, a specialized microprocessor designed specifically for digital signal processing...

s, which were borrowed from the digital musics instruments
Digital synthesizer
A digital synthesizer is a synthesizer that uses digital signal processing techniques to make musical sounds.Electronic keyboards make music through sound waves.-History:...

. These cards featured local memory which could be used for buffering multiple audio streams and mixing them on board, thus offloading the CPU and greatly improving the sound quality. However this was only possible in DOS by directly programming the hardware, and full-featured "hardware acceleration" from the local memory was never implemented on these cards, due to complexities of double buffering
Double buffering
In computer science, multiple buffering is the use of more than one buffer to hold a block of data, so that a "reader" will see a complete version of the data, rather than a partially-updated version of the data being created by a "writer"...

. Later cards such as Sound Blaster Live!
Sound Blaster Live!
Sound Blaster Live! is a sound card from Creative Technology. It is a PCI add-on board for PCs.-Overview:Sound Blaster Live! saw the introduction of the EMU10K1 processor, a 2.44 million transistor audio DSP, rated at 1000 MIPS...

, Audigy and X-Fi are capable of accessing the system memory buffers directly.

DirectSound3D

DirectSound3D (DS3D) is an extension to DirectSound introduced with DirectX 3 in 1996 with the intention to standardize 3D audio
3D audio effect
3D audio effects are a group of sound effects that attempt to widen the stereo image produced by two loudspeakers or stereo headphones, or to create the illusion of sound sources placed anywhere in 3 dimensional space, including behind, above or below the listener.There are several types of 3D...

 in Windows. DirectSound3D allows software developers to utilize audio by writing once for a single audio API
Application programming interface
An application programming interface is a source code based specification intended to be used as an interface by software components to communicate with each other...

 instead of rewriting code numerous times to work for each audio card vendor.

In DirectX 5, DirectSound3D gained the support for sound cards that use third party 3D audio algorithms in order to accelerate
Hardware acceleration
In computing, Hardware acceleration is the use of computer hardware to perform some function faster than is possible in software running on the general-purpose CPU...

 DirectSound3D properly, through methods approved by Microsoft.

In DirectX 8, DirectSound and DirectSound3D (DS3D) were officially merged and given the name DirectX Audio, however the API is still commonly referred to as DirectSound.

EAX

EAX is an extension to DirectSound and DirectSound3D which provides sound effects processing to the hardware-accelerated buffers.

Windows 95

In Windows 95, 98 and Me, the DirectSound mixer component and the sound card drivers were both implemented as a kernel-mode VxD
VxD
VxD is the device driver model used in Microsoft Windows/386, the 386 enhanced mode of Windows 3.x, Windows 9x, and to some extend also by the Novell DOS 7, OpenDOS 7.01, and DR-DOS 7.02 multitasker...

 driver (Dsound.vxd), allowing direct access to the primary buffer used by the audio hardware and thus, providing the lowest possible latency between the user-mode API and the underlying hardware, but in some cases causing instability and blue screen
Blue screen
Blue screen may refer to:*Blue Screen of Death, a fatal system error screen in Microsoft Windows*Blue white screen is an assay useful in biotechnology*Blue screen compositing, a technique for combining two still images or video frames...

 errors.

Windows 98 introduced WDM Audio and the KMixer, which enabled digital mixing, routing and processing of simultaneous audio streams with a higher quality sample rate conversion as well as kernel streaming. Under WDM, DirectSound sends data to the software-based KMixer. Windows 98 Second Edition improved WDM audio support by adding DirectSound hardware buffering, DirectSound3D hardware abstraction, KMixer sample-rate conversion (SRC) for capture streams, multichannel audio support and introduction of DirectMusic
DirectMusic
DirectMusic is a deprecated component of the Microsoft DirectX API that allows music and sound effects to be composed and played and provides flexible interactive control over the way they are played. Architecturally, DirectMusic is a high-level set of objects, built on top of DirectSound, that...

. If the audio hardware supports hardware mixing
Hardware mixing
Hardware mixing is a performance feature of computer audio hardware which enables sound cards to receive multiple audio streams and play them all at the same time. Hardware mixing improves performance by offloading audio mixing operations from the CPU and performing them at hardware speeds...

 (also known as hardware buffering or DirectSound hardware acceleration), DirectSound buffers directly to the rendering device. If DirectSound streams use hardware mixing, KMixer and its latency delay are bypassed. On Windows 98 and Windows Me, WDM audio drivers were preferred but compatibility with VxD driver model was preserved.

Although Windows Driver Model
Windows Driver Model
In computing, the Windows Driver Model — also known at one point as the Win32 Driver Model — is a framework for device drivers that was introduced with Windows 98 and Windows 2000 to replace VxD, which was used on older versions of Windows such as Windows 95 and Windows 3.1, as well...

 (WDM) was available starting with Windows 98, few audio card manufacturers used it. Due to internal buffering, KMixer introduced significant processing latency (30 ms on then-current systems). Windows 98 also includes a WDM streaming class driver (Stream.sys) to address these real time multimedia data stream processing requirements. When the sound card uses a custom driver for use with the system supplied port class driver PortCls.sys or implements a mini-driver for use with the streaming class driver, applications can bypass the KMixer completely and use the kernel streaming interfaces instead to reduce latency.

Windows 2000/XP

In Windows 2000, Microsoft also implemented the same WDM-based audio stack on Windows NT
Windows NT
Windows NT is a family of operating systems produced by Microsoft, the first version of which was released in July 1993. It was a powerful high-level-language-based, processor-independent, multiprocessing, multiuser operating system with features comparable to Unix. It was intended to complement...

 by introducing the WDM audio drivers and the kernel mixer component (KMixer). In Windows XP, Microsoft introduced another improved kernel streaming class driver, AVStream. Beginning with Windows XP, hardware acceleration was also added for DirectSound capture effects processing such as Acoustic Echo Cancellation for USB microphones, noise suppression and array microphone support.

Windows Vista/Windows 7

Windows Vista features a completely re-written audio stack
Solution stack
In computing, a solution stack is a set of software subsystems or components needed to deliver a fully functional solution, e.g. a product or service....

 based on the Universal Audio Architecture
Universal Audio Architecture
Universal Audio Architecture is an initiative unveiled in 2002 by Microsoft to standardize the hardware and class driver architecture for audio devices in modern Microsoft Windows operating systems...

. Because of the architectural changes in the redesigned audio stack, a direct path from DirectSound to the audio drivers does not exist. DirectSound, DirectMusic
DirectMusic
DirectMusic is a deprecated component of the Microsoft DirectX API that allows music and sound effects to be composed and played and provides flexible interactive control over the way they are played. Architecturally, DirectMusic is a high-level set of objects, built on top of DirectSound, that...

 and other APIs such as MME are emulated as WASAPI Session instances. DirectSound runs in emulation mode on the Microsoft software mixer. The emulator does not have hardware abstraction, so there is no hardware DirectSound acceleration, meaning hardware and software relying on DirectSound acceleration may have degraded performance. It's likely a supposed performance hit might not be noticeable, depending on the application and actual system hardware. In the case of hardware 3D audio effect
3D audio effect
3D audio effects are a group of sound effects that attempt to widen the stereo image produced by two loudspeakers or stereo headphones, or to create the illusion of sound sources placed anywhere in 3 dimensional space, including behind, above or below the listener.There are several types of 3D...

s played using DirectSound3D, they will not be playable; this also breaks compatibility with EAX extensions.

Third-party APIs such as ASIO
Audio stream input output
Audio Stream Input/Output is a computer sound card driver protocol for digital audio specified by Steinberg, providing a low-latency and high fidelity interface between a software application and a computer's sound card...

 and OpenAL
OpenAL
OpenAL is a cross-platform audio API. It is designed for efficient rendering of multichannel three dimensional positional audio. Its API style and conventions deliberately resemble those of OpenGL.- History :...

 are not affected by these architectural changes in Windows Vista, as they use IOCtl
Ioctl
In computing, ioctl, short for input/output control, is a system call for device-specific operations and other operations which cannot be expressed by regular system calls. It takes a parameter specifying a request code; the effect of a call depends completely on the request code. Request codes are...

 to interface directly with the audio driver . A solution for applications that wish to take advantage of hardware accelerated high-quality 3D positional audio is to use OpenAL. However, this only works if the manufacturer provides an OpenAL driver for their hardware.

As of 2007, a solution to re-enable hardware acceleration of DirectSound3D and Audio Effects, such as EAX, called Creative ALchemy was launched. Creative ALchemy intercepts calls to DirectSound3D and translates them into OpenAL calls to be processed by supported hardware such as Sound Blaster X-Fi
Sound Blaster X-Fi
Sound Blaster X-Fi is a lineup of sound cards in Creative Labs' Sound Blaster series.-History:The series was launched in August 2005 as a lineup of PCI sound cards, served as the introduction for their X-Fi audio processing chip, with models ranging from XtremeMusic , to Platinum, Fatal1ty FPS, and...

 and Sound Blaster Audigy
Sound Blaster Audigy
Sound Blaster Audigy is a product line of sound cards from Creative Technology. The flagship model of the Audigy family used the EMU10K2 audio DSP, an improved version of the SB-Live's EMU10K1, while the value/SE editions were built with a less-expensive audio controller...

. For software-based Creative audio solutions, ALchemy utilizes its built-in 3D audio engine without using OpenAL at all.

Realtek
Realtek
Realtek Semiconductor Corp. , a fabless IC design house situated in the Hsinchu Science Park, Hsinchu, Taiwan, was founded in October 1987, and subsequently approved as a listed company on the Taiwan Stock Exchange in 1998...

, a manufacturer of integrated HD audio codecs
Intel High Definition Audio
Intel High Definition Audio refers to the specification released by Intel in 2004 for delivering high-definition audio that is capable of playing back more channels at higher quality than previous integrated audio codecs like AC'97...

, has a product similar to ALchemy called 3D SoundBack. C-Media
C-Media
C-Media Electronics, Inc. is a Taiwanese computer hardware company that manufactures processors for PC audio and USB storage, and wireless audio devices.-Products:-PCI audio:*CMI8338*CMI8738-SX*CMI8738-LX*CMI8738-MX*CMI8768...

, a manufacturer of PC sound card
Sound card
A sound card is an internal computer expansion card that facilitates the input and output of audio signals to and from a computer under control of computer programs. The term sound card is also applied to external audio interfaces that use software to generate sound, as opposed to using hardware...

 chipsets, also has a solution called Xear3D EX, although it works instead by intercepting DirectSound3D calls transparently in the background without any user intervention.

Windows 8

Windows 8
Windows 8
Windows 8 is the codename for the next version of the Microsoft Windows computer operating system following Windows 7. It has many changes from previous versions. In particular it adds support for ARM microprocessors in addition to the previously supported x86 microprocessors from Intel and AMD...

 will see the return of hardware accelerated audio using WASAPI. The WASAPI audio stack and APIs, the PCI WaveRT driver interface and the Microsoft audio port class drive have been reworked to allow "hardware offloading" of multiple audio streams to the audio card for mixing and effect processing. However, there is no mention of DirectSound and DirectMusic
DirectMusic
DirectMusic is a deprecated component of the Microsoft DirectX API that allows music and sound effects to be composed and played and provides flexible interactive control over the way they are played. Architecturally, DirectMusic is a high-level set of objects, built on top of DirectSound, that...

 being hardware accelerated once again using this hardware offloading method.

Windows CE

Although DirectSound support was available in Windows CE versions up to 4.2, it was removed starting 5.0. Windows CE 6.0 also does not support DirectSound, instead favoring that applications be rewritten to use the Waveform Audio API.

See also

  • DirectMusic
    DirectMusic
    DirectMusic is a deprecated component of the Microsoft DirectX API that allows music and sound effects to be composed and played and provides flexible interactive control over the way they are played. Architecturally, DirectMusic is a high-level set of objects, built on top of DirectSound, that...

  • OpenAL
    OpenAL
    OpenAL is a cross-platform audio API. It is designed for efficient rendering of multichannel three dimensional positional audio. Its API style and conventions deliberately resemble those of OpenGL.- History :...

  • Windows Vista audio architecture
  • Windows legacy audio components
    Windows legacy audio components
    This article describes audio APIs and components in Microsoft Windows which are now obsolete or deprecated.-Multimedia Extensions :The MME API or the Windows Multimedia API was the first universal and standardized Windows audio API. Wave sound events played in Windows and MIDI I/O use MME...

  • DirectX plugin
    DirectX plugin
    In computer music and professional audio creation, a DirectX plugin is a software processing component that can be loaded as a plugin into host applications to allow real-time processing, audio effects, mixing audio or act as virtual synthesizers...

  • Cross-platform Audio Creation Tool
  • XAudio2
    XAudio2
    XAudio2 is a cross-platform audio API for Xbox 360 and Microsoft Windows, intended as the replacement for DirectSound.The RTM version of the XAudio 2 library is included in the March 2008 DirectX SDK...


External links

The source of this article is wikipedia, the free encyclopedia.  The text of this article is licensed under the GFDL.
 
x
OK