If you want to connect your av-receiver to your computer via optical S/PDIF and use it in 5.1 surround mode, you will need the open-source tool ac3Filter to convert the signal.
5.1 Surround over optical S/PDIF
Optical S/PDIF only has enough bandwidth to transmit two uncompressed channels. If you want to use it for a 5.1 signal you have to compress and encode it an Codec like DTS or Dolby Digital.
Installation
This encoding step can be done in realtime by the free and open source tool ac3Filter.
Just download the latest version and install it on your system.
After that you will find a programm named Ac3Filter Config
in you start-menu.
In there you have to set the Output format to 5.1 Surround
and check the input for Use SPDIF
.
After that you will have realtime encoding into 5.1 Surround Sound.