In the world of audio equipment, it would be reasonable to have gone from traditional analog RCA connections (L/R/Video) to HDMI, but if you’ve fiddled about with home theater systems enough, you’ve likely also encountered optical audio connectors. While I’m not in a position to definitively extol their respective benefits, I can definitely say that after hooking up a Playstation 2 via the optical connection, I was shocked at how good the audio was versus using the RCA connectors.
I also found it strange that my receiver had only a single optical input. If you have a system where you can take advantage of more than one optical link, this switching device from Beni_Skate is an excellent addition to your setup.
The device automatically detects audio input, and can be configured for up to 7 optical inputs, or 4 optical and 3 S/PDIF (digital coaxial) inputs if you prefer. There’s even a DAC option, allowing you to input audio over USB and output it in a more traditional audio equipment-friendly format.
Finally, Beni_Skate also has a RPi optical output boards available, if that would be more appropriate for your system needs.