Unless your TV is (very) new enough for E-ARC, the TV will only pass through normal DD5.1audio at best, even for apps like Netflix that support Atmos. TV OS's don't usually license high end audio codecs either or else you'd pay way more for that TV. You really don't get much more than standard optical capabilities.
You need a proper media box and just use the TV as the display.
In my setup, I use Plex Server to organize my library. On my Sony Android TV, the Plex player was a complete disaster, so I switched to using Apple TV's. Plex Player sadly fares even less well on my Apple TV (HD or 4K). The player chokes on high bitrate 4K and HEVC content. It just renders poorly in general. One day the player might mature enough for everyday usage.
So to get around this, I use Infuse Pro on the Apple TV. It has Plex integration, so it can read my Plex library and display it on my screen in a gorgeous interface. It plays absolutely anything I can throw at it, is fully HDR capable and able to play all audio formats including Atmos/DTS-HD Master Audio/TrueHD etc. It's not 100% free, but, you get what you pay for.
The top feature for me is that Infuse plays literally everything natively. It does not transcode anything, ever.