Optical cables can go bad, they're glass, if bent too far they will crack. Also make sure it's seated properly on both ends. The optical cables included with Roku are junk, especially being all black it makes in hard to align it with jack. Buy a colored optical cable from Amazon.
Edmund
Roku Community Streaming Expert
Help others find this answer and click "Accept as Solution."
If you appreciate my answer, maybe give me a Kudo.
I am not a Roku employee.