while most laptops have a built-in sound card, they’re no good for high-quality audio recordings. Most built-in sound cards are of somewhat indifferent quality when it comes to the recording side and they don’t provide balanced inputs for professional type microphones, which are really necessary for making high-quality recordings.
Hence, if you want to use a laptop, you need an “audio front-end” with balanced-input microphone preamps feeding a pair of high-quality analog-to-digital converters or “ADCs”. And since most laptops have at least one USB port, the easiest way to connect such an audio front-end to them is via a USB cable. This has the added advantage of allowing the audio front-end to draw its power from the laptop, via the same cable.
So that was the rationale behind the low-cost audio front-end unit we’re describing here. Or at least, those were our basic goals when we started its development. Along the way it “grew some” when we realised that it wouldn’t be too difficult to provide it with various bonus features:
(1) line-level analog stereo recording inputs;
(2) line-level analog stereo outputs for playback and/or monitoring; and
(3) S/PDIF digital audio input and output for direct digital recording and playback.
In effect, it has become a flexible multi-purpose USB audio interface – not just for laptops but for virtually any PC. It’s easy to build and much lower in cost than comparable commercial units. What’s more, there’s no software to install – you just connect it up and it runs on Windows XP SP3, Windows Vista and Windows 7 (both 32 & 64-bit). It should also work with recent Linux and Mac operating systems.
Fig.1: this block diagram shows what’s inside the PCM2902 stereo audio CODEC IC. It provides line-level analog stereo inputs & outputs, an S/PDIF digital audio input, an S/PDIF output and a full-speed USB interface.
The heart of the project is the PCM2902 from Texas Instruments. This was originally developed by Burr-Brown, which was acquired by TI not long ago. The PCM2902 is described as a single-chip stereo audio CODEC with an inbuilt full-speed USB protocol controller, SIE (serial interface engine) and transceiver.
As well as providing line-level analog stereo inputs for recording and line-level stereo outputs for playback, it includes an S/PDIF digital audio input for recording and an S/PDIF output for direct digital playback. And of course, it has an inbuilt full-speed USB interface.
Fig.1 shows the goodies packed inside the PCM2902. To the right of centre is the USB protocol controller block which provides four main USB “end-points”: (1) a control end-point which receives control commands from the PC host; (2) an HID (human interface device) end-point which allows inputs to the chip to generate keypress events on the host PC, to control muting, volume, etc; (3) an isochronous IN end-point which handles the transfer of audio recording data from the ADC section IN to the PC via the USB; and (4) an isochronous OUT endpoint which handles the transfer of audio playback data OUT of the PC via the USB, feeding it to the DAC section.
Don’t worry too much about these terms but you might like to know that “isochronous” means that the audio data packets are transferred at a constant rate (isochronous = equal time). You might also want to note that we’re not actually making use of the HID end-point in this project.
To the right of the USB protocol controller block are the USB SIE and transceiver sections which transmit and receive all the data and control packets transferred over the USB signal lines. Just above the protocol controller is the power manager block which controls the power taken by the external circuitry, as directed by the host PC’s USB driver.
Thus, when the PC directs the PCM2902 protocol controller to switch the device into low power “suspend” mode because no activity has been detected for a few milliseconds, the power manager block drops the logic level on the SSPND-bar output pin. This is used by external control circuitry to turn off power to everything but the “brains” of the PCM2902 chip itself.
As soon as the PC directs the protocol controller to resume normal operation, the power manager pulls the SSPND-bar line high again, so power is restored to the external circuitry and it can get back to work.
The sections to the left of the USB protocol controller block in Fig.1 are those involved in processing the record and replay signals. In the upper area, there’s the stereo ADC section for converting incoming analog audio into 16-bit digital samples, together with the S/PDIF digital audio input decoder. The digital bitstream from one of these is fed through a FIFO (first in, first out) buffer to the isochronous IN endpoint of the USB protocol controller, for transmission to the PC host.
By the way, if there’s a signal from the S/PDIF input decoder it becomes the recording signal but if there is no S/PDIF signal, the bitstream from the ADCs is fed to the FIFO block as the recording signal.
In the lower area of the block diagram there’s a second FIFO buffer which is fed from the protocol controller’s isochronous OUT endpoint with audio playback data received from the PC host. The output of this second FIFO is fed to the stereo DAC section to be converted into analog playback audio. At the same time, it is fed to the S/PDIF encoder section to produce a digital playback bitstream.
So the playback signals simultaneously appear at both the analog audio outputs and the digital S/PDIF output.