I'm getting ready to purchase all the parts for my PC. My motherboard will be an AsRock Extreme 4 Gen4. It's listed as outputting 7.1 Surround Sound.
My issue is my receiver is only 5.1 and only receives an optical digital input. Will I be able to output 5.1 sound still? And will I just need an optical digital cable to run from the mobo to the receiver?
Be careful though on your selection. If it isnt a DTS or Dolby digital licensed onboard audio optical out, you will only get 2.1 sound out of it. I've had multiple boards only output 2.1 sound and the only sound card i bought that supports DTS encoding on the fly is the XFI titatium although most high end audio cards do DTS encoding these days now.
What your motherboard might be referring to is the ability to do 7.1 analog surround using the Green, Orange, Black, and Grey plugs on the motherboard. Which if that's the case you will not be able to go to a receiver unless for example it is a z5500.
Okay this is going to be a bit long winded but this is crucially important.
When a motherboard says that it has 7.1 output this means that it can support up to 8 analog output channels (left, right, center, surround left, surround right, back left, back right, and Low Frequency Effect AKA subwoofer). This is completely independent of digital audio or what your receiver is capable of handling. Since you're planning on using your receiver to handle the audio, you can ignore this because it's irrelevant.
When transporting digital audio across a fiber optic cable there are several ways in which we can do it. First and most relevant for us is PCM or Pulse-Code Modulation. PCM is the state that the audio is in before it is sent to the digital-to-analog converter that drives the 7.1 outputs previously mentioned. However, rather than having our onboard DAC (Digital-to-Analog Coverter) covert the digital data into analog sound we want our our receiver to do it. All we have to do is cram all 6 or 8 of those channels into one and send it down the optical pipe.
However, Windows doesn't like to do this. The default HD Audio drivers will only drive 2 channels of PCM audio across an optical cable (and I do not think that the Realtek ones do any better). If you try and configure your speakers you will only be able to choose between stereo or compressed audio. Fortunately it will drive up to 8 channels of Dolby Digital or DTS compressed audio without issue.
The problem with compressed audio is that unlike consoles, PC applications have never had a need to use Dolby Digital or DTS compressed and encoded audio unless there's a compelling reason to do so. Normally they just drive the 2/6/8 channels using PCM and let the drivers do the rest of the work. There's plenty of reasons for a PC to decode DD or DTS (such as when watching a DVD movie or a game cutscene which has prerecorded audio) but very few reasons to encode it. As such, using your PC to drive a surround system over an optical connection is far more difficult than it needs to be.
Lets recap. There are three main ways of driving digital audio. PCM which is essentially the same thing as driving regular speakers directly, except that the data is passed digitally to an external receiver, and Dolby Digital / DTS which are compressed and encoded. Windows lets you pass either 2 channel PCM or DD/DTS but not 6/8 channel PCM. DD/DTS streams can be passed through if you have a source DD/DTS audio stream (although this is needlessly difficult).
Introducing Dolby Digital Live.
Dolby Digital Live is a driver component which is present on certain Creative Labs audio cards (and derivative cards based on the same chipsets) which allows for PCM audio to be captured and encoded in real time into Dolby Digital. Applications simply drive the speakers like they normally would and that audio is instead captured, encoded and redirected to the receiver. There also exists a DTS version but they are more or less the same. The Dolby Digital stream can then be streamed to your receiver and decoded appropriately. If this seems like a lot of effort to perform such a simple task that's because it is. The caveat is that Dolby Digital Live is not available on any integrated audio solutions.
Alternatively you can just use HDMI or Display Port as neither of those have the PCM channel restrictions so long as you use the official drivers supplied by AMD/NVidia/Intel. By default the Microsoft HDAudio drivers will still limit you to stereo audio over HDMI/DP but installing the official drivers will rectify this. Please keep in mind that you will have multiple audio devices connected and will need to select the appropriate playback device in your application.