Andrew's S/PDIF Stuff

Keep in mind that this page was started in a different time. (1999 to be exact) Back then doing high quality digital audio recording with a PC was REALLY new. Digital audio on computers is so commonplace now, and most machines have quite good audio hardware, much of which is good enough for music use.

introduction | projects | circuits | product reviews | FAQ


introduction to S/PDIF

Digital audio is really cool. Also cool are the mostly standardized formats for sending digital audio between devices. There is a professional format called AES/EBU, but most consumer gear, as well as very many professional devices use S/PDIF. "S/PDIF" stands for: "Sony Philips Digital InterFace".

S/PDIF is just like MIDI, in that there are two distinct parts to what people mean when they say "S/PDIF":

data protocol

The data protocol is universal across all S/PDIF devices. It can support different sampling rates and resolutions between 16 and 24 bits. It can also support up to 4 channels, but I have yet to see a device that uses this capability. Most people won't hack the data protocol at all.

hardware interface

The hardware interface is the actual physical connection that is used to send data between devices. If you are hacking around with S/PDIF, it will most likely be by building various hardware interfaces. Most of the confusion surrounding S/PDIF is because there are several different ways of sending S/PDIF data. You might find the following types of interfaces:

Let me just make it clear that no matter which type of hardware interface you need to use, the data that is being sent is the same. S/PDIF is also polarity independent, which makes it a lot easier to work with.

coax

The coax interface uses 75ohm coax cable with RCA connectors. Even cheesy audio patch cables work well for transmitting S/PDIF. The signal is +/-0.5V and should be terminated with 75 ohms on the receiving end. (termination is built into coax inputs)

TOSLINK

The TOSLINK interface uses cheap mylar optical fibre cables that plug into TOSLINK modules. These modules input or output a TTL signal. Both Sharp and Toshiba make the modules. Also, stereo stores like to over-charge for these cables, selling 6 foot cables for upwards of $100. A 6 foot cable should only cost $15.

There are two styles of TOSLINK connectors. Some have the standard square TOSLINK plug, and the others have an 1/8" style plug. The latter is found on portable MD recorders, and usually doubles as an analog line input. You can get modules of either type, and you can also get cables that connect between one and the other. The 1/8" is purely for compactness in small devices. Other than the shape of the plug, it works the same way.

TTL

The electrical connections to and from TOSLINK connectors is TTL. TTL is 5V/0V on/off pulses. This type of signal is used within most digital electronic devices, (although often at lower voltages) and many simple digital logic chips are compatible with TTL. Also, TTL is found on many sound cards like the Soundblaster Live!. Creative Labs sells add-on units that feature TTL<->coax or TTL<->TOSLINK converters. You can of course build these converters yourself to save money and provide exactly the kind of connections you need.


projects

I've built several different S/PDIF devices that I use regularly. The first thing I found was that TOSLINK modules are hard to get. You can salvage transmitters fairly easily from old broken CD players. Receivers are harder to find. At first I tried to make my own transmitter using a red LED, since it's just red light that comes out of a TOSLINK transmitter. Although the LED worked, it was very difficult to position properly so as to maintain a reliable signal. It was clear that proper TOSLINK modules were necessary. I scoured the net and found a guy that was selling receiver and transmitter modules for $10USD each. Unfortunately I can't find that site any longer, but there may be other sources now. Building the coax and TTL connections only requires standard electronic components. If you don't need TOSLINK connections, it's best to avoid the hassle.

Coax <-> TOSLINK converter

Coax to TOSLINK Converter

In an effort to be able to connect anything coax to anything TOSLINK and vice versa, I needed a box to convert between the two. The converters I found commercially available were >$100. I built the one here for about $30. I've used it in all sorts of situations. I bought the TOSLINK receiver off the net for $10USD, and I got the transmitter from a broken CD player.

There isn't a schematic for this project because I just figured it out as I went along. The coax <-> TTL schematics below were used for the coax parts. The TOSLINK modules need almost no external parts. I just followed the TOSLINK modules datasheets for suggestions on use. A small regulated power supply was also built inside the box, to provide clean power from the AC adaptor.

SB Live S/PDIF Bracket

Warning: This information is from 1999 and might not be accurate anymore as sound cards have changed. The general principals probably still apply.

SB Live! S/PDIF Bracket

A friend of mine bought an SBLive Value, and we realized that it has a fancy digital audio connector. After some playing, we found that there are a few problems with how the card handles the digital signals internally, but that for $89 it was usable for many applications. I then bought one of my own cards and proceeded to build my own S/PDIF bracket. I've been using this setup in my home studio for over 2 years now, and it works great. The whole thing went together in a few hours and cost about $10 to make. I don't have a schematic of this one either, but it's basically just the example coax <-> TTL circuits below. The power for the circuit comes from the sound card.


S/PDIF circuits

Here are a few S/PDIF circuits you can incorporate into your own designs. I haven't included drawings for TOSLINK devices because they are quite simple, and the datasheets provide enough information to use them easily. These schematics are very basic but usable circuits. These circuits were originally found on other sites, but after having been successful using them, I decided to post my own drawings of them.

S/PDIF Circuits

Notes about the circuits above:


Product Reviews

Buying S/PDIF gear is tricky. It's even harder when you're on a budget and trying to make your computer into the amazing recording setup you've always wanted. Manufacturers don't always give you the full story so here are some down to earth discussions and reviews that hopefully make things easier. If you'd like to write a review to include here, let me know.


FAQ

What's up with Dolby Digital?

Most DVD players and home theatre receivers have digital audio connections. They use either coax or TOSLINK connections. If you play a CD, or a DVD in stereo PCM mode, a standard stereo S/PDIF signal will most likely come out of the connector on your DVD player. In surround mode, a flag bit is set that instructs the receiver that the data is not raw audio samples. The specifics of the data sent would depend on which surround format was in use.

I want to send audio all over my house with S/PDIF

S/PDIF is not designed for long-distance transmission. It is not a balanced signal, and because the data rate is 5-6MHz or so, unless done properly, long unbalanced coax cables will be susceptible to errors. That's not to say it shouldn't be tried, but S/PDIF circuitry might not adequately drive long cables. For TOSLINK cables, you'll find that long cables are very expensive. When the signal is not receiving properly you will know right away because the sound will either be noisy, or the receiver won't even lock up.

Consider using good quality analog wiring. You can get transformers to allow you to use balanced cabling with unbalanced audio gear. Alternately, if your equipment has good strong low-impedance outputs, try just using long patch cables. The biggest culprit you will face is shielding problems and ground loops. There are many other pages dedicated to these topics.

Also, think about using RS-485 or RS-422 wiring for S/PDIF signals. There are very simple transceiver chips made by Maxim (see MAX308x series) that convert a TTL signal into a balanced RS-485 signal. Some of these ICs can work at up to 10MHz. With proper wiring you could send S/PDIF over thousands of feet. AES/EBU uses a hardware interface like this. Some newer RS-485 transceivers support special electrical signaling to send digital data farther through the same type of cable. Use standard low-cost CAT5e cable for a very cost-effective installation.

I want to mix two S/PDIF signals together

This is a complicated task that requires expensive hardware, and most often requires that the sources be synchronized, which is not possible with most home audio equipment. I'm not aware of a simple S/PDIF blending circuit, other than professional digital mixing systems.

Update (2002-01-17):

Someone has suggested that the above statement is not entirely true. I'm aware that there are many digital audio ICs that are inexpensive and provide advanced functions. Apparently Texas Instruments makes a chip called the TAS3001. It's a stereo audio digital equalizer. It has EQ functions as well as 2 input mixing and volume controls. Sounds like a cool chip!

This is still certainly not an off-the-shelf unit though, and most people do not have the facilities to implement circuits with these parts. Most of my questions come from people that don't really want to build stuff. Thanks to Tyler who sent me this info.

Most people want to do this so that they can chain 2 mega CD changers together. Consider using the analog connections and an A/D converter if you really want a digital signal to send around your house. Most mega changers have facility for daisy-chaining the audio for multi-player setups.

Make me schematics or build me circuits!

My work involves making circuits and systems for a living. I don't have the time or facilities to build custom electronic circuits for other people. Buy some good books on electronics and a soldering iron and learn how to make things yourself. I enjoy learning about it, and you just might too. It's worth it!

Wireless S/PDIF?

Someone wrote to ask whether or not it would be possible to use a wireless video sender to send S/PDIF around his house. I'd never thought of this but it seemed possible, and a great idea! I thought about it and concluded that it just might work. He went out and got a 2.4Ghz video sender from Radio Shack. Amazingly it worked, and he was able to send wireless S/PDIF. Not bad for $100.

Go to the Projects Page



Last modified: Thu Jul 19 10:53:19 EDT 2007