I'm not following you. I don't know of any TV that has an Optical input. They only have optical outputs. Your Roku Streambar is sending audio to the TV via the HDMI connection.
Are you referring to the TV sending its audio to the Streambar? That would only require using an optical cable if your TV doesn't support HDMI-ARC, which can send the TV audio back to the Streambar over the same HDMI cable.
Factory reset, it's working without optical Cable, however now there is an echo when I turn up the volume on television. How do I get rid of the echo?