I am running Kodi on Raspi3 with Hifiberry dac+ . I need to toggle between external input to an amplifier v/s input from the DAC+. I am thinking of doing it based on the selection done in Kodi - System Settings-> Audio Output-> Audio Output Device. When DAC+ is selected on the Audio Output Settings, i can get one of the GPIO pins high and use that to trigger the toggling of a relay. Can someone provide me with pointer on a better option/ on how to implement this. Appreciate any help. Thanks.