Not sure how/where to categorise this.
All software/hardware up to date.
Plex Server on Windows 11. Plex Player on Android TV.
I have 2 media sources, a satellite decoder, and using Plex to stream from my PC. The Plex Player is on a MiTV Stick. TV is not smart. I use an HDMI audio extractor to feed fibre-optic audio to my home theatre.
If I play suitable media from the satellite decoder I get surround sound. If I stream suitable media (AAC endcoded) via Plex I get stereo.
An optical cable is not enough for aac 5.1, it can only do 5.1 with regular dolby (AC3) and DTS (DCA).
In settings set Passthrough to optical. When that is enabled there will be another setting that appears next to it to enable AC3 and DTS. You may have to set the system audio settings of the device itself appropriately