This motherboard has Realtek ALC4080 codec for onboard audio that is recognised as a USB device in ALSA
No sound from optical port (S/PDIF out - Realtek ALC 4080) with MSI MAG X570S Edge Max Wifi Mother Board - #13 by euler216
Looks like someone fixed this issue. At MPG X570S EDGE MAX WIFI compatibility · Issue #172 · alsa-project/alsa-ucm-conf · GitHub , perexg posted a fix. I went into my USB-Audio.conf file and made the same changes and I was able to get audio from the Optical output.