I have recently got myself some additional Sonos speakers to create a 5 channel surround system for my TV. While the sound is great for music and video sources with Dolby Digital 5.1 encoding, there are a couple of issues that I'm looking to resolve. I have some films with a DTS soundtrack and the Sonos system doesn't decode this, also stereo sources - like iplayer, live TV, older films, etc - will only output to the soundbar and not the rear speakers. For whatever reason there isn't the option to have the rear speakers play to same as the front L&R and a stereo source means no sound from the rear speakers.
My idea is to have a device that sits between the TV and the soundbar input hat will output a sound signal encoded as DD 5.1. This means that stereo signals & DTS get converted to DD 5.1 and signals that are already DD 5.1 would get passed through. This could be either HDMI or optical (even HDMI in and optical out). I don't know if such a thing exists and I'd appreciate it if those that know of these things could give me some advice.