With an optical connection, your player is not sending the newer lossless codecs to your older receiver. Optical is limited to lossy DD and DTS.
The secondary audio setting doesn't affect the bitstream output over optical. You'll get proper DD 5.1 and DTS regardless of secondary audio. So, just make sure the player output is not set to PCM, which will be limited to stereo over optical. As for the Roku, there isn't much DD 5.1 content. Netflix is not 5.1 on Roku, for example. Are you sure the selections you've tried have DD 5.1 tracks?