Roon designed their own audio engine so they would not have to use Linux, Windows or iOS audio engines and be required to have three different versions of Roon for the three platforms. Roon's audio engine can output to multiple audio devices.
Linux uses Linux's alsa as an audio engine. It is a very mature and solid audio engine. Shairport Sync (Airplay) uses alsa as its audio engine. As such, it needs to be configured to use an alternative output if the output you want is not the "default" output. In your case, the default output is most likely optical. By changing the output device in ShairportSync's configuration files, you can direct the output to any legitimate audio output. In your case, you could have it send its output to HDMI. But, in that case, it would no longer output to optical since it can only be directed to single output.
Doing this is not all that difficult in a Linux terminal. But it is probably requires a bit more explanation than is warranted here.
- Jim