Operating systems and sound quality

Playback

You pick a song in your media player and press play.
Audio files comes in many formats (WAV, FLAC, MP3, etc) but DAC’s don’t understand them. formats, they want plain PCM.
The player therefore  invokes a decoder to convert the file to PCM.
The PCM is packed into the  protocol used to connect PC and DAC.
Today this is USB most of the time but legacy protocols like SPDIF are still popular as well.

Multiple streams

All popular operating systems (Windows, OSX, Linux, Android) are designed to play multiple audio streams.
You watch a video but you want to hear a notification when a email arrives.
The only way to obtain this is to mix the audio and the system sound.
You can only mix if all streams run at the same sample rate.
The audiostreams are converted to float (to keep the quantization error down), mixed, dithered and converted back to integer.
Dither (adding random noise) is applied to decorrelated the audio and the quantization error.
In case of 16 bit, it is a must.
Today as most DAC’s do have a 24 bit input, you might wonder is dither at -144 dBFS is of any significance.

 

An obvious consequence of multiple audio streams is that you do have to set a  fixed sample rate and a bit depth in the audio settings of the OS.

Bit depth.

Simply set it to the max as supported by your audio device.
If you play a 16 bit file and the setting is 24 bit, 8 zero bits are added with zero impact on sound quality.
Choosing the highest bit depth regardless of your source can be beneficial when applying DSP.
Something as simple as digital volume control will result in loss of resolution if the bit depth is 16 bits.
Turn the volume down with 48 dB using 16 bit word length
1111111111111111
0000000011111111 only 8 bits left


Do the same using a 24 bit word
111111111111111100000000
000000001111111111111111  still 16 bits left.

Sample rate.

This is a different matter. Certainly in the past, re-sampling often means disaster. It resulted in measurable and audible distortion.
Today it can be done pretty transparent.
Your best bet is to set the sample rate to what is common.
Most of our audio is 44.1 kHz.

Automatic sample rate switching

This of course solves the problem, the sample rate is adapted to the source.
Each operating system has its own way to achieve this.
In Windows it is a matter of using a media player supporting WASAPI in exclusive mode.
As it is “exclusive” no multiple streams.
See the drivers section for more detail.

768kHz!

This is what is often proposed on audio forums.
They have a 32 bit 768kHz DAC hence set the sample rate to 768.

The famous bigger is better philosophy

768 is the max modern USB audio connections accepts.
As USB does device enumeration, you probably see all supported sample rates in the audio panel.
Don’t be surprised if the DAC (the chip inside the box) runs at a completely different rate.

In fact most DAC’s do apply ASRC (Asynchronous Sample Rate Conversion) to get rid of the input jitter hence do have a free running clock.
The consequence of resampling by the media player is probably that all the audio is resample twice, one time by the media player  and one time internally by the DAC.

Best practice

Set the bit depth to the max supported by the audio device
Set sample rate to what is common in your collection (44.1 kHz)
If possible, use automatic sample rate switching.