This works great, however when the cable is connected a hum can be heard through the speakers, not mattering what input is selected on the receiver. In my experience with professional analog audio equipment, I instantly recognized it as a ground-loop hum. For those without electrical engineering degrees or unfamiliar with ground-loop problems, a ground-loop in an undesired effect occurring when there is a grounding potential difference on the main power supply of two separate devices and when a cable connects the two devices, connecting the devices' ground planes which will cause an electrical current to flow over the wire connecting the two grounds. This potential difference, although usually very small (in my case, less than a volt) can be amplified in analog sound amplifiers and heard in the speakers as a 60Hz hum. Even though we're using a completely digital audio connection, a ground-loop is still created because the shield of the coaxial cable used connects the ground plane of the PC with the ground plane of the Sony receiver.
For a while I considered getting some extra equipment to use a Toslink optical connection between the computer and the receiver, but instead I decided to apply some knowledge I had used when working with professional audio equipment, and that is inserting an isolation transformer between the two devices. Obviously, since this is a high-speed serial digital data connection and not an analog audio connection, we're going to have to think about this a little bit.
It turns out that we can fix this problem very easily, and probably with parts you already have lying around.
Step 1: Getting Things Together to Make a Better Cable
What we need is a pulse transformer -- a transformer which is designed to transmit digital signals -- and one which is capable of at least 20MHz to support our 192kHz PCM S/PDIF audio signal. With a little thinking outside of the box, we realize that every computer Ethernet card has one such transformer to galvanically isolate the network interface circuitry from the transmission medium, the Ethernet cable. All we need to do is find an old 10/100 Ethernet network card and steal its pulse transformer -- I had an old AMD PCnet 10/100 card lying around which had a Pulse-brand transformer on it. Most common on Ethernet cards are Pulse or Bel-brand transformer. Any transformer suitable for FastEthernet should be suitable for our S/PDIF needs.
Just salvage this transformer from your old Ethernet card, grab a soldering iron, some solder, a knife and a side cutter, and you should have all you need to get on your way to digital audio bliss. It will also help to search the Internet to find a datasheet with a schematic of the internals of your particular pulse transformer so you know what pins to connect your cable's conductors. In my case, I found out I needed to connect the sound card side of the transformer to pins 15 and 16, and the receiver side of the transformer to pins 10 and 11. Because we're dealing with an isolation transformer, it doesn't much matter which pins we connect the shield or the core -- although if you can, you should try to match up shield-shield and core-core leads on the transformer. In my case, I attached the shield to pins 16 and 10 (the "top" leads) and the core to pins 15 and 11 (the "bottom" leads).
Step 2: Putting It All Together 1/2
Step 3: Putting It All Together 2/2
Step 4: Conclusion
If you're lucky enough like me to just happen to have a small plastic case lying around which is suitable to encase your latest electronics project, just cut out some holes for the cable and snap on around the simple passive device.