For surround sound, optical (TOSLINK) cables generally outperform analog direct connections (RCA, 3.5mm) for clear technical reasons:
HDMI (especially eARC) is superior for modern systems—it carries lossless formats like Dolby TrueHD and DTS:X alongside video—but optical remains the best choice when analog is the only alternative.