This can be achieved by using the APO drivers. It'll enable Dolby Digital surround on any HDMI output. However, from my experience it does have a short but noticeable delay.
There's an easy solution for that problem. To enable surround sound over optical for any game that supports surround sound: LoopBeAudio.
Basically you need to set the Windows default speaker to LoopBeAudio virtual speaker (Internal Playback) which needs to be configured to 5.1 surround. In the...