|
I remember there being another reason to use one of those outputs over the other, think it was dynamic range, but I can't remember the details.
stuff I found from a directsound faq on winamp forums(might be out of date):
Q: What's the difference between DirectSound and waveOut ?
A: Short version: you should use waveOut on win95/98/me/nt4 and DirectSound on win2k/xp/.
Long version:
waveOut is old, outdated API (Application Programming Interface) for playing digital sounds in 32bit Windows OS's. Old OS's (all win9x and nt4) have good waveOut implementation; you should use waveOut output on those for best performance. waveOut features are limited; it doesn't even natively support mixing multiple streams. It appears that waveOut is provided in win2k/xp only for compatibility with old software - win2k/xp waveOut implementation is rather bad, it doesn't use any kind of hardware acceleration; all mixing is performed by software (may interrupt sound when CPU usage is high).
DirectSound is the new "modern" sound playback API, built into all recent versions of 32bit Windows OS's, available as redistributable for older ones (though nt4 directsound is badly broken from my experience). DirectSound natively supports mixing multiple streams, independent volume control, hardware acceleration layer & hardware emulation layer (features which aren't supported by hardware are emulated by software, so the programmer doesn't have to worry if his new l33t code will work right on old sb16). DirectSound should be generally fine to use everywhere except for nt4, as long as you have latest DirectX version for your OS and proper soundcard drivers installed. DirectSound is preferred over waveOut on win2k/xp, because their DirectSound implementation is relatively good (eats less CPU than waveOut and is free of win2k/xp waveOut implementation glitches). DirectSound was originally designed to let games utilize hardware acceleration available on your system without having to touch low-level hardware functions directly (like any other component of DirectX).
Q: Are there any differences in audio quality between DirectSound and waveOut ?
A1: In win2k/xp (WDM), waveOut and DirectSound are just 2 different pathes of passing PCM data to windows kernel mixer. WaveOut uses software mixing only, which makes it less prone to system-specific probmlems (see below), while DirectSound can use hardware mixing if available, which is known to cause sound qualtiy issues with certain configs (since out_ds v2.2.4 hardware mixing is disabled by default so this is not a problem with out_ds).
A2. In win9x OS line, DirectSound driver system is completely separated from waveOut, and does low-level hw access on its own, so it's like you are using two different drivers for waveOut and for DirectSound. There are known "problems" with DirectSound downsampling to 22khz 8bit (or something similar) to save ISA bandwidth on old cards, you can workaround that by enabling "create primary buffer" option (which is enabled by default on win9x).
Q: What's the difference between software and hardware mixing ?
A: As for DirectX 8.1 and Windows XP SP1, hardware mixing is highly buggy in both Microsoft's DirectSound core and per-driver implementations. There are confirmed "problem samples" where using hardware mixing in Windows XP causes pops at the beginning of stream, tested on different soudncards. Particular drivers have far worse problems (famous "Audigy skipping", static noise with some Audigy configs, crippled sound quality with certain other setups, God knows what else). For stable operation, it is strongly recommended that you leave hardware acceleration disabled; it's disabled by default starting from v2.2.4.
Hardware mixing can be toggled by changing "allow hardware acceleration" on device tab. Enabling that option doesn't mean that you are actually using it (DirectSound will fallback to software mixing when out of resources); see status display for exact info about currently used mixing type.
2003 Update
Note that hardware acceleration is now better supported by the latest sound drivers and DirectX 9.x. This option is required for multiple speaker output, especially with onboard sound chips. SB Audigy users should still use this feature at their own risk (see below).
Q: Why is DirectSound always quieter than waveOut ?
A: On win2k/xp, changing waveOut volume seems to change global wave volume setting, while DirectSound has independent volume control; in other words - you play with waveOut, set volume to 50%, you get 50%, then you switch to DirectSound, set volume to 50%, and get 25% of your max volume. Solution: don't use waveOut and set wave volume to max in windows volume control.
|