Read http://www.cnet.com/news/20-tvs-tested-which-sets-can-pass-surround-sound-to-a-sound-bar/
This area is well discussed so in short for HDMI we wire like this (2 short version lines of text.)
1. Sources -> Receiver -> HDTV.
2. One optical for OTA and apps -> Receiver.
Bob
I have just replaced my old sony home cinema system, so I can get surround sound when hooked up to the tv, because the tv sound is bad. But all I can get is 2 channel sound, is this correct or have I missed something. I'm using an optical lead from TiVo box to sony surround amp for sound on tv, and hdmi leads from TiVo to tv and sony amp to tv. I'd be grateful of any help or tips, thanks a lot barjay80

Chowhound
Comic Vine
GameFAQs
GameSpot
Giant Bomb
TechRepublic