digital pre-amp

Can I build something like a streaming digital pre-amp with the RPi 4b?
I want to use the RPi primarily as a streamer for Roon, with AES-EBU via XLR out to my studio monitors. For this, there are AES hats like PI2AES, and Ropieee. 
However, I also want to play sound from my TV via the studio monitors, so I need a way to connect also my TV, maybe by the TV's optical Toslink output. Could I somehow control the source selection (music streaming or TV sound), like in a digital preamp?
The Hifiberry DAC+DSP board has Toslink in. Could I direct that to the digital output, and somehow convert to AES out?
Would that digital output be volume controlled? And how could I control the volume for the TV? Could I use the remote of my Samsung TV, or maybe use the Flirc remote USB dongle? 
I could always just buy a RME ADI-2 PRO, but I would love to go the Raspberry path, if possible. 


Please sign in to leave a comment.