1. Sources of non-quality
Assuming the output is bit-perfect, the computer as a source creates two main sources on non-quality:
Software-induced jitter
Digital signal is in fact an analogue waveform composed of two states separated by a voltage threshold (1 if above, 0 if under).
As presented in [MeitnerGendron91], the receiver detects the value change the moment the analogue value crosses the threshold. In addition, the shift from one state to another is not instantaneous but more slope like.
So a slight change in the reference voltage of the source will lead to a slight temporal shift in the value change detection.
Figure 1: Reference voltage induced jitter
So fluctuations in the source reference voltage create jitter, as explained in details in [HawksfordDunn96]. This is the same on the receiver side with measurement threshold fluctuations from its power supply and/or ground instability. Moreover the computer can still cause this as the grounds are linked most of the time through the same signal cables.
Computer load means rapidly changing power demands from the CPU and its peripherals, with peak demands that are directly related to the software behaviour.
Radio-Frequency & other interferences
In addition, computation, disk access, … activities mean complex current waveforms are carried on electrical lines and thus generate electromagnetic interferences. Apple computers are now made of “unibody” aluminium cases that are good protectors from inside RF interferences. But this is not sufficient as the cables connected to the computer act as antennas. And these current waveforms are also going back through the computer PSU, polluting the mains power supply.
2. The hidden audio filters of OS X
As a modern operating system OS X needs to offer shared access to the devices including the audio output to all running applications. But this is done at the expense of pure sound quality:
Audio mixer
Fortunately when only one application is playing audio, it doesn’t affect the signal and thus is at least bit-perfect in this case.
Sample rate conversion
In this shared model the device sample rate is not switched to match the original signal’s, but it is this last one that is sample rate converted.
In addition a suboptimal algorithm is used to minimize the CPU load of this real-time operation.
Digital volume control
OS X offers through its mixer volume control (e.g. the one offered in iTunes). But as it operates on the digital signal, any volume value different from 100% means loss of bit-perfect and precision loss (e.g. a volume value of 25% means 2 bits precision loss).
3. The data transfer to the DAC
First way to connect to the DAC is to use the build-in TOSLINK output of the Mac. But this one should be dismissed for being too jittery for serious use.
Strong improvement comes by using “computer connection” to the DAC, being either USB or FireWire.
FireWire has long been the interface of choice for the pro-market as it is made by design to guarantee continuous streaming of AV data on large number of channels. Anyway its complexity of use (installation of driver required, hot plugging even strongly advised against by some manufacturers because of its potentially harmful issues, …) and its unclear future have made USB the widely used choice.
The first type of USB devices are called adaptive (or synchronous), meaning the DAC clock is slaved to the computer’s continuous stream of data.
More recent and advanced USB devices use asynchronous transfer mode where the DAC controls the flow of audio data, buffers it, and uses its own stable-low-jitter clock. Thus it is immune to short interruptions of USB stream (e.g. bus reset, other device burst transfer, …), and much less prone to computer jittery clock.
This combines the advantages of both worlds: ease of use of USB (no drivers), and stability of FireWire. This is a great step towards sound quality, but it is not decoupling completely the DAC from the computer, and the interferences, software-induced jitter still apply, starting by following the ground loops.
4. The player software impact
First of all the player should ensure bit-perfect reproduction of the signal by:
- Adapting the DAC sample rate to each track native to avoid any unwanted sample rate conversion
- Taking exclusive access (“hog mode”) of the device to prevent other opened applications from interfering
Furthermore, as we have seen in section 1, the computer load (and its variations) has an impact on sound quality. Minimizing such current demands and sources of interferences is key:
- Loading tracks before playback (“memory play”) to reduce disk access and its audible, power and RFI impacts
- Minimizing synchronous CPU load taken for the audio data streaming operations. In addition to reduce jitter, this also helps to reduce audible RF interferences patterns, especially in low frequencies
5. Further optimization at driver level: Integer Mode
Audio playback in OSX is usually performed through a high-level framework, the Audio Units processing graph [AppleCoreAudio]. The first optimization of an audiophile player is to bypass these overhead facilities and address directly the CoreAudio lowest layer: the Hardware Abstraction Layer. (See figure 2)
Figure 2: Usual OS X file player vs Audiophile concept
In normal mode, all data exchanges performed across the user/kernel boundary are in PCM 32-bit float format, easing the different audio streams mixing process and associated soft clipping. [AppleHAL_1]
Note that it is anyway still bit-perfect up to 24bit definitioniv.
Integer mode
Addressing directly the HAL [AppleHAL_2] gives the possibility to bypass the two main overhead processes of the above standard mode:
Field Programmable Gate Arrays