I think your problem is a misunderstanding of how the optical out works. If I have my guess right, the optical surround out on the X-fi will only produce surround sound if whatever you are doing is encoded with dolby digital.
For example, if you are watching a DVD on your computer that is in surround, it will send that information through the optical ports and your receiver will decode it. However, games are not typically running dolby digital. The sound sent out when playing them will only be 2.1.
To get surround from your computer while playing games, you'll need to hook up the analog out into the multi channel in ports on your receiver if you have them.