@guitar89 (and anyone else interested in this),
Once upon a time, I compiled a useful text file/guide for myself from various sources, and I thought I might share it with you.
copy and paste to your desktop and give it a read...
GUIDE-OPTIMISING WINDOWS AUDIO PLAYBACK.txt
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* *
* CONTENTS OF THIS TEXT FILE: *
* * *
* *
* 1. Optimising Windows for audio playback *
* *
* 2. How to setup 'foobar2000' to use WASAPI in Windows Vista *
* *
* 3. ASIO4ALL explained - the audio architecture in Windows XP & Vista *
* *
* 4. FAQ *
* *
* 5. FURTHER RESOURCES *
* *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
________________________________________________________________________________
1. Optimising Windows for audio playback
________________________________________________________________________________
* //community.whathifi.com/forums/t/131545.aspx
* by "PJPro" (What Hi-Fi.com Forums) Sept 21, 2008
Ok. I'm an IT professional. But I'm not an expert on Microsoft audio architectures. Nonetheless, I have done a little research into this and have
produced this posting to provide some pointers for setting up Windows to optimise audio performance.
Windows XP
==========
Windows XP provides a number of layers of software to process computer audio. This software architecture can/does impact the quality of the sound
reaching the soundcard.
For example, Windows XP will support a number of concurrently running applications. Each of these applications may produce sounds. These sounds need
to be merged together and sent to your soundcard for broadcasting. The software responsible for mixing of audio streams is the Kernal Mixer (or
KMixer).
To simplify the job of mixing lots of sounds from different application, the KMixer resamples everything to 48kHz even if it is already at 48kHz
(and doesn't make the best job of it). So your 44.1kHz audio stream from your media player is no longer bit perfect.
To get round this (and the latency introduced by all the operating system software) you need to enable your media player to connect directly to your
sound card. To do this is you use Audio Stream Input/Output (ASIO) or Kernel Streaming.
more info here:
Audio Stream Input/Output (ASIO) - //en.wikipedia.org/wiki/Audio_Stream_Input/Output
Kernel Streaming - //en.wikipedia.org/wiki/Kernel_streaming
To use either ASIO or Kernel streaming you need to have a plugin available for your media player of choice. These are available for 'Foobar2000' and
'WinAmp' (ASIO, Kernel Streaming ). I am sure that many others exist (though see 'iTunes' further down this page).
more info here:
Foobar 2000 components - //www.foobar2000.org/components
Winamp 5 ASIO output DLL - //otachan.com/out_asio%28dll%29.html
Winamp Kernel Streaming Output Plugin - //www.karatebulgaria.com/alex/private/WinAmp/index.html
Windows Vista
=============
The audio software architecture is different in Vista. It has been completely rewritten to address some of the issues with Windows XP,
more info here: //en.wikipedia.org/wiki/Technical_features_new_to_Windows_Vista
There is no Kernel Mixer in Vista.
The architecture provides an Application Programmers Interface (API) to support bit perfect streaming to the sound card. This is the Windows Audio
Session API (WASAPI). It provides capability which is similar to kernel streaming but does not require the programmer to write complex kernel
streaming code.
WASAPI supports two modes of use: shared and exclusive. In shared mode, audio streams are mixed and global effects (if specified) are applied before
the stream hits your sound card. In exclusive mode the audio streams are not mixed and no effects are applied i.e. the audio stream from your media
player is passed directly to the sound card.
To use WASAPI you will need a plugin for your media player and your sound card will need drivers to support it. Currently, I only know of Foobar2000
that has a WASAPI plugin. This operates in WASAPI exclusive mode only. The Creative Soundblaster XFi range supports WASAPI (but please check your
specific model).
I have produced a 'How To' article detailing how to setup Foobar2000 to use WASAPI in Vista (further down this page).
If you want to use ASIO4ALL, there is another article further down this page,
it also explains in detail about the audio architecture in Windows (XP & Vista).
Mac OS X & Linux
================
Don't know a great deal about these but they do not seem to have as many of the mixer issues as Windows (perhaps supporting Ashley James's view that
Apple desktops make a better audio source than PCs running Windows?).
iTunes
======
If you are running iTunes within Windows you are going to have the same issues as all other media players. Unfortunately, you are not able to work
around the KMixer (in XP) or use WASAPI directly (Vista). If you desparately want to keep the iTunes frontend but want to improve sound quality you
could check out this page. It details how you can set up iTunes to use Foobar2000 as a backend processor using the Multi-Plugin. I haven't tried
this myself.
Sound Cards
===========
It is worth noting that once you have set everything up to bypass the upsampling performed by windows that your sound also probably upsamples to
48kHz (check it's setting). If you can, set your sound card to 44.1kHz. If you can't, the upsampling performed by the card may be impacting sound
quality. If you are using Foobar2000 you can add higher quality upsampling plugins to do the sample rate conversion rather than letting the sound
card do the upsampling. I use this one:
//www.mega-nerd.com/SRC/fb2k.html
* EDIT: Found out over the weekend that my X-Fi soundcard has an updated control console available allowing the selection of 44.1kHz, so I no longer
need the upsampler
That's about all I know. Hope it is of use to someone.
________________________________________________________________________________
2. How to setup 'foobar2000' to use WASAPI in Windows Vista
________________________________________________________________________________
* //community.whathifi.com/forums/t/130557.aspx
* posted by "PJPro" (What Hi-Fi Forums) April 2010
I thought I would see what could be done with my current PC setup to improve sound quality without spending any money.
My current setup is:
MS Vista Service Pack 1.
Creative Sound Blaster Xfi Extreme Gamer.
Beresford TC-7510 DAC.
Grado SR80 Headphones.
foobar2000, WinAmp, WMP
What I wanted to do was bypass the audio processing performed by windows to ensure that a bit perfect audio stream arrived at my DAC. I knew of a
couple of ways to do this.....ASIO and Kernel Streaming
I gave ASIO a whirl and downloaded the plugins for Foobar2000 and WinAmp. With FooBar2000 I experienced modest improvements in sound quality. I
couldn't get ASIO working with WinAmp.
OK, but I wanted more.
So I took a look at Kernel Streaming and stumbled across Windows Audio Session API (WASAPI). WASAPI is a new feature for Vista and allows playback
of an unaltered bitstream without passing it through the Windows Mixer. I just so happens that a new plugin has been released for Foobar2000 to use
this API (Application Programming Interface).
This was simple to configure (see instructions below) and has provided me with a worthwhile audio improvement. I suspect that much of this has been
gained from actually releasing the full potential of the DAC as much as anything else.
Anyway, I thought it was worth making others aware of my findings and provide instructions detailing how to go about it.
I haven't managed to find a WASAPI plugin for WinAmp.
To read more about WASAPI in Foobar2000 see this:
//wiki.hydrogenaudio.org/index.php?title=Foobar2000:Components_0.9/WASAPI_output_support_%28foo_out_wasapi%29
To read more about WASAPI in Vista see this:
//en.wikipedia.org/wiki/WASAPI#Audio_stack_architecture
Configuration Instructions
Go to the foobar2000 components page and click the link for "WASAPI output support" (zip archive):
//www.foobar2000.org/components
Extract the file "foo_out_wasapi.dll" into your foobar2000 components folder.
Open foobar2000 and select File > Preferences and the Preferences window opens. Select the Components node in the tree to check that WASAPI output
support is available.
Expand Playback and click Output
Select the appropriate WASAPI device in the Output Device drop down list.
For me, this is the WASAPI SPDIF Out (Creative SB Xfi).
Then click Save All.
Some people have experienced problems with choppy playback. There is a fix...
Simply reduce the Buffer Length (foobar preferences > playback > output > buffer length).
Some posters on other sites have reduced the buffer length to as low as 250ms
* EDIT :
I have also set my X-fi soundcard, using the latest "Creative Console Launcher", to accept an audio stream of 44.1kHz, thereby eliminating any
upsampling of the signal on my PC.
Apart from the improved sound quality, you will know that this has worked because the volume slider in the task tray has no effect on volume levels
during playback. Moreover, a delay has been introduced in the volume slider in foobar.
________________________________________________________________________________
3. ASIO4ALL explained - the audio architecture in Windows XP & Vista
________________________________________________________________________________
* //www.head-fi.org/forum/thread/221237/asio4all-explanation
* posted by "EnOYiN" (Head-Fi.org Forum) June 2007
* Disclaimer:
This article is partially outdated because there are newer and better versions of ASIO4ALL available right now.
- Introduction -------------------
This post will tell you a bit about how the audio architectures of XP and Vista work. It is however mainly meant as a guide to set up ASIO4All in
XP. I can not say how much of a difference installing ASIO will make in your system. Some of you might not be able to hear even the slightest
difference while others will hear a clear improvement. Obviously the more resolving your system is the more likely it will be for you to hear a
difference. I can hear a small improvement when using ASIO instead of DS.
If you are using Vista I can't really recommend installing ASIO for playback solely any more because there are several tests which have shown that
there is no audible difference between using the normal settings and using ASIO. (I'll try to find a decent link for you guys)
If you think I wrongfully copied parts of other guides and/or websites do not hesitate to PM and I will change it. The main thing I have been trying
to do here is organise some data for others so it will be easier to understand the benefits and drawbacks of using ASIO for playback in XP.
I will start off with a bit of information and some terms I will be using throughout the rest of the guide.
Thank you for reading!
- Bit-perfect ---------------------
Bit-perfect is how the audio will stream to your device. By using this you will have a more true reproduction of the actual medium. So you will get
the exact reproduction of everything which has been extracted or played from the CD. This will include every error which was on the CD originally.
The quality of a sound card can have an effect on the quality of the output, even with bit perfect playback enabled. The timing and/or jitter can
vary between sound cards, usually with the lower end sound cards having a higher likely hood of jitter.
The only thing changing this signal is your DAC. The quality of your DAC will still affect the actual output.
- Kmixer ---------------------------
The KMixer is a part of Windows that enables your computer to take multiple audio sources and play them back at the same time and at the same bit
rate. The KMixer is also how Windows handles your volume control. Regular CD audio is 44.1 kHz. Many times, due to poorly written drivers, sound
cards that will interact with the KMixer will cause this 44.1kHz data to be resampled to 48kHz. Obviously this will result in an undesirable result
when trying to achieve the utmost in sound quality. The mixing algorithm as implemented by Microsoft has been shown in many cases to only have a
signal to noise ratio of about 92dB. CDs have a signal to noise ratio of about 96dB (technically 97.5dB). The KMixer effectively reduces the data
from 16bit to 14 bit.
To bypass the Windows KMixer you either need to use ASIO or Kernel Streaming.
- ASIO ------------------------------
ASIO stands for Audio Stream Input Output
ASIO is a professional audio standard that provides for a low-latency audio stream from the computer. ASIO bypasses the KMixer entirely. ASIO is
used by the recording industry as a standard. You can get ASIO here:
ASIO4ALL - Universal ASIO Driver - //www.asio4all.com/
There are other ASIO drivers than ASIO4All. Two of them are worth mentioning. USB-ASIO and ASIO2KS. Here are the links to their websites:
USB 2 Audio - low latency audio - //www.usb-audio.com/
ASIO2KS - Generic ASIO driver for WDM soundcards - //www.asio2ks.de/index.html
USB-ASIO is selling a program which will provide true ASIO. This program costs €59 / $76. It is better than ASIO4ALL, but it is far from free. If
you are thinking about using it, I can advice you to test it first. You can download a trial version from their website.
Currently ASIO2KS is only available as beta-version. I have no idea whether this project is still alive or if it died a long time ago. The beta
version does not provide true ASIO like USB-ASIO does. The beta-version runs 10 minutes without limitations. Afterwards every 30 seconds a
one-second beep-tone will be played into all input and output channels.
XP Audio:
Here is a simple diagram of how the audio-architecture in XP works:
--------------------------------------------------------------------------------
Audio Application(s)
----+--------------------+--------------------------+-----------------+---------
| | | |
----+------------ ------+---------- -------+--------- -----+---------
ASIO OpenAL Direct Sound MME
----+------------ ------+---------- ---+---------+--- -----+---------
| | | | |
| | | | |
| | | -----+-----------+---------
| | | Kmixer
| | | -----+-----------+---------
| | | | |
| | --------+---------+-----------+---------
| | Microsoft "Port Class" Driver
| | --------+---------+-----------+---------
| | | | |
| | --------+---------+-----------+---------
| | Vendor "Miniport" Driver
| | --------+---------+-----------+---------
| | | | |
----+--------------------+----------------------+---------+-----------+---------
Vendor Hardware Abstraction Layer
----+--------------------+----------------------+---------+-----------+---------
| | | | |
----+--------------------+----------------------+---------+-----------+---------
Hardware
----+--------------------+----------------------+---------+-----------+---------
As you can see only ASIO and OpenAL will go straight to the lowest level of driver and bypass everything else.
Vista Audio:
Here is a simple diagram of how the audio-architecture in Vista works:
--------------------------------------------------------------------------------
Audio Application(s)
----------------+-------------------------------+---------------------+---------
| | |
--------------+---------------- --------+------- --------+-------
W ----------------------
I WASAPI Instance
N ---------+------------ : :
D |
O ---------+------------
W CPT
S ---------+------------
| : :
---------+------------
APO1
---------+------------
|
---------+------------ : :
A APO2
U ---------+------------
D | ------ -------
I |
O | ASIO OpenAL
|
---------+------------ ------ -------
Mixer APO
---------+------------ : :
|
S ---------+------------
E APO3
R ---------+------------
V |
I ---------+------------ : :
C KST
E ----------------------
--------------+---------------- --------+------- --------+-------
| | |
| | |
----------------+-------------------------------+---------------------+---------
Audio Driver
--------------------------------------------------------------------------------
(updated): I made a simplified picture of the Vista audio architecture to avoid further confusion about it. This picture shows just one audio
application. What should be clear about this is that for every single audio application lauched a seperate WASAPI instance will be launced as well.
The original version of this image can still be found in this thread on page 17.
For people who are using either ASIO or OpenAL there will be no significant changes. However, there is quite the change in using Direct Sound. There
is no possibility anymore to go straight from a Direct Sound application to the audio drivers or the hardware. This results in the following: no
more hardware acceleration. The point of Direct Sound acceleration is to let the hardware process unmixed audio content. For more information you
can go here. This link will take you to the Creative forums.
The meaning of the abbreviations used in this model:
WASAPI - Windows Audio Session API
API - Application Programming Interface
APO - Audio Processing Object
CPT - Cross Process Transport
KST - Kernel Streaming Transport
Not all soundcards are capable of bit-perfect output. Some of them will change the information even when it’s delivered to them bit-perfect. There
is nothing you can do about this other than buying another soundcard.
You can adjust the volume when using ASIO. This will not affect the 'bit-perfectness' of your signal.
- Kernel Streaming ------------------
Kernel Streaming is just about the same thing as ASIO. It is Microsoft’s answer for being able to play audio files in a bit perfect format on a
Windows machine. Kernel Streaming makes efficient real-time streaming of audio possible. However, Kernel Streaming is not an industry standard. ASIO
will have many more supported plugins available for various media players. Kernel Streaming requires less CPU time than the regular 'wave out'
method.
- Setting Up ASIO4ALL ---------------
Some soundcards have their own ASIO driver installed already. You should not install the driver again when this is the case. The cards that support
ASIO natively are always better than cards which do not. True ASIO has no interference of the OS at all. You can skip this part and go on to to the
part where the Foobar/WinAmp set-up is explained.
I am going to tell you how to set up ASIO4All for bit-perfect playback. Note that this is not a setup for recording and also note that I will be
using version 2.7 here.
Start with installing ASIO4All. This shouldn’t be too hard. I expect you are all able to do this. I will continue with the configuration of
ASIO4Alls Off-Line Settings. After you just installed the program the Off-Line Settings should be something like this:
Realtek HDA
USB Audio DAC
ASIO Buffer Size = 512 Samples
ASIO Prepared / 44100 Hz
Now you are going to configure it for bit-perfect playback.
Click on the "Advanced" button, and make sure these things are set to the right values:
The latency (ASIO Buffer Size) should be on 2048.
The latency compensation should be on 0.
Leave “hardware buffering” unchecked.
Set kernel buffers to 4.
Leave the AC97 functions unchecked as well.
Only enable the devices you want to use. I do not want to use the Realtek HDA, so I disabled it.
I do want to use the USB-DAC, so I enabled that.
- Setting up Foobar with ASIO4All ---
This part will explain you how to set up ASIO4All with Foobar. I am using version 0.9.4.2. of Foobar and version 2.7 of ASIO4All.
Download the plug-in for ASIO from this site:
//www.foobar2000.org/components/index.html
When you did this, unpack the file and place it in your components directory. Mine is called:
C:\Program Files\foobar2000\components
I am assuming you already installed ASIO4All like I explained above. Now you are going to File --> Preferences --> Output.
There should be a tab called ASIO Virtual Devices. Select it and add a new virtual device.
Once you did this edit ASIO4ALL v2.
I want to activate my USB-DAC so I mapped left and right on there:
Device channel Format Mapping
----------------------------------------------------
USB Audio DAC 1 32-bit Left
USB Audio DAC 1 32-bit Right
Press save all and you are done.
Go to the main output tab and select your output device.
If you want to use ASIO4All then you should select the following:
Output Device:
----------------------------------------------------
ASIO : ASIO4ALL v2
----------------------------------------------------
- Setting up WinAmp with ASIO4ALL -----------
This part will explain you how to set up ASIO4All with WinAmp.
This is so easy that it makes me wonder why I even use Foobar.
Download the plug-in for ASIO from this site:
//www.winamp.com/plugins/browse.php?category=7
There is also another plug-in for ASIO. Some people haven't been able to get things to work with the plug-in which is linked here, so I will give
you a link to a post made by Terry which contains a link to another plug-in. It's located here:
//www.head-fi.org/forums/2745339-post26.html
Install the plug-in.
Start WinAmp and go to Options --> Preferences --> Plug-ins --> Output.
Select ASIO4All and press close. You should see this:
ASIO Output Plugin [out_asio.dll]
Note:I uninstalled all the other output plug-ins. You do not have to do this for ASIO to work.
Now restart WinAmp and everything should work fine.
- AC97 Troubleshooting ------------------
* Always Resample 44.1<->48 kHz
ASIO4ALL can do real time resampling of 44.1 kHz audio to/from 48 kHz. Resampling will automatically take place whenever ASIO4ALL is opened for 44.1
kHz and the WDM driver does not support this sample rate. There may, however, be instances in which case an AC97 will support 44.1 kHz by resampling
internally. More often than not, however, AC97 resampling quality is extremely poor and/or prone to stability issues. To work around this, you can
enable this option. With at least one incarnation of the SoundMax WDM driver (smwdm.sys), this option absolutely must be enabled in order to make it
work at 44.1 kHz at all.
* Force WDM driver to 16 Bit
This option only has an effect if the supported bit depth of the WDM driver is larger than 16, but less than 24. Some AC97 devices report e.g. 20
Bits resolution but cannot actually be opened for more than 16 Bits resolution. Should this be the case on your system, this option provides a
workaround. Originally, this was introduced as a workaround for an issue with the SigmaTel AC97 WDM driver.
! ! ! THAT'S IT ..... YOU HAVE JUST INSTALLED ASIO4ALL ! ! !
________________________________________________________________________________
4. F A Q
________________________________________________________________________________
Q: Will I still have bit-perfect playback when using DSPs?
A: No. It's all lost. Down the drain. (In my opinion however, an EQ might make more of a difference than bit-perfect output.)
Q: My .wav file doesn’t work. Why Oh Why?
A: A .wav can only be played bit-perfect if it has the following specifications:
- Stereo format
- PCM audio data
- Min: 16-bits Max: 32-bits.
- 44.1, 48, 96 kHz
Q: My volume is not what it’s supposed to be. How can I fix this?
A: Windows is changing the volume sometimes, just for fun. You can change this in the menu “Sounds and audio devices” in your configuration window.
Q: Does device X work with ASIO?
A: I simply do not know everything. I suggest you look up the specifications on the particular device to see if it supports ASIO natively and if so
just download the ASIO plug-in for Foobar. If it does not support ASIO natively than I suggest you download ASIO4All and the plug-in and try that.
The only way to be sure is to try.
Q: Does DRM (Digital Rights Management) technology built into Windows NT6 systems (Vista/7) affect audio playback ?
A: No, the DRM components in NT6 is just making playback-encrypted "Blu-ray" and "DVD" discs possible. NT6 systems don't really need ASIO as it has WASAPI.
________________________________________________________________________________
5. FURTHER RESOURCES
________________________________________________________________________________
FAQ: What is Bit-Perfect? - MP3Car.com
//www.mp3car.com/vbulletin/showthread.php?t=88852
Winamp 2 Kernel Streaming Output Plugin - Hydrogenaudio Forums
//www.hydrogenaudio.org/forums/index.php?showtopic=4569&st=0
Perfect Volume Control? - Hydrogenaudio Forums
//www.hydrogenaudio.org/forums/index.php?showtopic=47597
Envy24HT-S - The Definitive Source - AVS Forum
//www.avsforum.com/avs-vb/showthread.php?p=3356169&&#post3356169
USB 2 Audio - low latency audio
//www.usb-audio.com/
ASIO4ALL - Universal ASIO Driver
//www.asio4all.com/