Using S/PDIF to send audio from your PC


Posted by Nick White on Tuesday, March 04, 2008 3:29 PM 14 Comments

The following is an article from another of my colleagues on the Windows Vista Sound team, Kristin Carr.  Kristin is a Program Manager and works with Steve Ball, who previously has shared his insights into how Windows Vista handles sound.  If you have questions for Kristin, please leave a comment below.

Many people have a general idea of what S/PDIF is -- perhaps by seeing it as a label on an audio output, or on a feature list for a product.  But what is it exactly, and how do you use it?  This post will cover some of those details.

On a PC, the audio is stored and processed digitally until the final output stage when it is usually converted to an analog signal that directly feeds your speakers.  However, there may be times when you want to transmit the signal digitally to a different device that will be used to play the sound, such as a receiver.  In these cases, you may want to postpone converting the signal to an analog one, and instead transmit the signal digitally to avoid any degradation and additional noise that may occur when transmitting an analog signal.

For this purpose, S/PDIF (Sony/Philips Digital Interconnect Format) was developed.  Often referred to by the name of the connector (including Toslink, RCA, or simply "Optical" or "Digital Out"), S/PDIF specifies a method of transmitting a digital signal so that it can be received and interpreted correctly by the connected device.  You may ask yourself, "How complicated is it to transmit a signal?  Why do we need a special protocol?"  Consider that the digital signal consists of a series of bits, and within that series, the bits are grouped to correspond to a sample of audio, and an even larger subset of those are grouped to correspond to a particular channel.  In order to enable a receiver to properly interpret all of those bits in the correct order, it is necessary to have a format for transmitting those bits.  This is where S/PDIF comes in.

S/PDIF can be used to transmit two channels of digital audio in real time over a single connection.  S/PDIF specifies a particular bit pattern that a receiver can use to latch onto the stream.  Once the receiver has synced up with the stream, S/PDIF specifies the order of the audio bits and how they should be arranged in a stream so that the receiver can properly interpret it.

However, there may be times when you wish to transmit more than two channels of audio over the S/PDIF link.  This is where compressed audio can be used.  Audio compression is a technique used to transmit equivalent information using fewer bits.  This is done through a number of techniques.  Some techniques, referred to as perceptual coding, take advantage of the fact that humans can only hear certain sounds.  These methods of compression usually involve discarding bits that only contribute a minimal amount to what a listener needs to recognize a given sound.  Other methods take advantage of numerical redundancies in the signal in order to effectively transmit the same information in a smaller amount of space.  Dolby Digital and DTS are two common types of compression.  Regardless of the technique, compression enables a digital audio signal to use fewer bits to transmit the audio.

The result of this compression is that it enables you to transmit the content for up to 5.1 channels of audio over S/PDIF in space that would have only fit 2 channels if the audio had been uncompressed.  This is great once the signal has been encoded (synonymous with compressed), but once a signal has been encoded, that same signal must also be decoded after it has been received so that it can be sent to speakers.  This means that your receiver must be capable of decoding the compressed audio signal in order for you to hear the correct sound.  This is the tradeoff necessary to allow you to transmit more than two channels of audio over S/PDIF.

Another direct consequence of transmitting a compressed audio signal instead of an uncompressed audio signal (more commonly known as PCM) is that the volume of that signal cannot be modified once it has been encoded.  Because the bits in an encoded signal no longer directly correspond to the volume of that signal, it is impossible to increase the volume until it is decoded.  This explains why your PC cannot control the volume of your sound when you are using Dolby Digital or DTS as the output.  The connected device will be the only place where the volume can be changed.

To recap, in order to avoid the electrical interference and noise present on an analog connection, consider using S/PDIF to transmit the signal digitally.  If you'd like to transmit more than two channels, consider sending encoded content which allows you up to 5.1 channels over S/PDIF.  You may also want to consider HDMI, but that's a post for another time!

 

Posted by Techy News Blog » Using S/PDIF to send audio from your PC


 

Posted by Ian Dixon's Blog


Have you ever wondered what S/PDIF is and how you can use it to connect up your Media Center PC to your

 

Posted by jaxim


I wish Vista could handle my 6.1 creative speaker system. None of my back speakers work. It may be a driver issue, but Microsoft should still allow systems that are not the conventional 2.1, 5.1, or 7.1.

Also, I'd like to be able to have some applications output to one audio device and others output to another -- all at the same time. I also wish the volume mixer could be used to make an audio device into the default system rather than that feature be hidden down in the Playback Devices window. Also it is a bit annoying when you switch the default audio device, you have to close all applications that output sound in order for the change to take into effect.

 

Posted by newscientist2000


Wow great article, luckily my sound system is real basic, no fancy stuff here...so I dont run into any trouble with digital/analog sound output.

Although I do have a converter analog digital converter box, that I picked up on clearance sale at RadioShack, didnt need it but it was a dollar so, and now I have a better idea of what it does.

Great info, very clear :-)

 

Posted by m04arch


Hey Nick, slightly off the topic but related...

I have a persistent problem with listening to audio with BTooth headset (v2.0) both on Moto Rokr S9 and Sony DR-BT21-G. Both support A2DP and all the whiz bang features. My system is 3 month old 2.4GHz Dell Inspiron 1720 laptop running Vista Ult 32b and I believe a Broadcom 2.0 BTooth transmitter/receiver. I've had no problems with these headsets with my mp3 player but one *techie* suggests that it is the generic MS BTooth driver stack. Will SP-1 deliver a more robust stack. Any suggestions? Link follows http://www.djkaty.com/drupal/vista/bluetootha2dp

 

Posted by caywen


Kind of off-topic, but on the subject of Windows Vista audio, I have kind of a disappointment with the treatment of USB audio products. I bought a Logitech USB Headset and at first it seemed to work great. But a huge gripe is that with most programs, including Windows Media and iTunes, unplugging or plugging it in while audio is playing results in either no audio, or audio playing from the wrong speakers.

This is a significantly worse experience than using the plain old headphone jack.

 

Posted by berimbau


Jaxim / Nick,

I also have problems with my Creative soundsystem. I have the X-Fi Music with the latest Vista 64 drivers from Creative. With my 5.1 set I am unable to send signals to my subwoofer, the satelite and centre speakers are no problem. Redirection to the centrespeakers is no problem, but that is not why I have a subwoofer offcourse.

Do Microsoft support this problem and when is it going to be solved?

Thanks,

Mark

 

Posted by Xman


Kristin,

My laptop has SIS 7012 audio and offers S/PDIF. Unfortunatelly ever since I moved to Vista the PC crashes every time I use the Media player or stream something from lets say youtube.

The laptop runs rock solid only if I go to the device manager and disable the SIS7012 Audio Driver.

I am using all vista drivers but have failed to find a solution and the computer without audio is just not fun at all... I am not using any 6.1 feature only the stereo would do.

Please contact me if you have any suggestion.

Regards

 

Posted by dnm


S/PDIF will not work as a audio protected path, I guess that is why you would need an HDMI connection.

 

Posted by Kristin Carr


Hi Xman,

It sounds like your problem is definitely a driver one.  Unfortunately, my only suggestion is to contact the manufacturer that provided the driver.

This doesn't solve your problem right now, but one thing that we have been trying to do is get the industry to converge on certain audio hardware standards (like HD Audio, USB, etc.) so that the Microsoft driver can support hardware from a wide variety of manufacturers.  This would mean that you wouldn't necessarily have to rely on a third party for the driver, but would be able to get basic audio with our driver.

-Kristin

 

Posted by AbeF


Vista Team

Are there any plans to support simultaneous analog and digital sound output from within Vista ? Kinda weird that XP does it but Vista has been crippled in this regard - particularly for those who use VMC.

Thanks

Abe

 

Posted by Spiny


Works great with VMC. ac3filter can encode to dd 5.1 too.

 

Posted by wrathofdoom


Guys, I just replaced my old dimension with a dell xps 630 with vista.  My prior setup had the digital output (s/pdif) running into my home stereo while at the same time running my 5.1 computer speakers.  It was nice, they sounded great together or separate.  Now I am told that due to piracy concerns this is no longer possible.  I think I have a realtek sound card.  My computer has s/pdif, analog and Hdmi outputs.  Any suggestions?

 

Posted by how to sell digital products on ebay


Fujifilm is one of the leading providers of imaging and information products. Fujifilm and its employees are committed to providing consumers and professionals with the most innovative and highest- quality imaging and information products and services.

Anonymous comments are disabled
© Copyright 2007 Microsoft Corporation. All rights reserved.