Is this feasible? RPI Switching inputs on DAC

Hello all,

I have a XiangSheng DAC-01A Tube DAC that I’m very happy with. It has a manual input selector (like a rotary style) to select between USB, optical and coax. I have my Volumio Raspberry Pi 4B connected via USB and love it. I have my TV connected via optical.

The problem is I need to get up to change inputs if I want to switch between TV and Volumio. This means I sometimes get a little lazy and just listen to Spotify through the TV instead of Volumio even for songs I have in my FLAC collection.

I was already thinking I may make a custom case that has my 7.9" Waveshare screen + Volumio + the internals of the DAC in it. I was wondering if it’s possible to do the following? (Ordered from simple to more advanced).

1 - Have the Raspberry Pi be able to change the input of the DAC programatically. I imagine the rotary control simply acts as some kind of input switch on a circuit and if that could be performed by the Raspberry Pi instead, then in theory the Raspberry Pi could issue commands to do this?

2 - If possible, are there any ways to make this ‘nice’? Including writing a Volumio plugin so there’s an input selector in the volumio interface?

3 - Getting more advanced, perhaps when Volumio is playing it automatically selects the USB input of the DAC, and then after X seconds of not playing it automatically switches back to the optical input? That way I wouldn’t need to “change” inputs. We could call this “Auto mode” and it’d be on by default, but I’d still want to manually set the input in case I wanted to listen to music while having the TV on something else (muted) e.g. having sports on in the background.

I’m very novice at electronics but it’s an area I would like to learn more about. I’m a software developer so have no issues there.

You can create a plugin that does all the above, given that the DAC has some sort of API that you can use.

Then, all you need to do is expose the various input of the DAC as Volumio inputs. If you need more info just mention me and will be glad to help.

See our docs here:

1 Like

Thank you, it looks like I’d need to use GPIO instead of an API though? The DAC is completely analogue. I’m assuming the rotary selector would just be connecting a circuit for whichever input is currently selected, with the other ones being broken. So is this something the GPIO can do on a Pi? Is there a voltage limit to it? For example if an input is connected to two pins, can the Pi via software ‘bridge’ them to make the circuit? Or does it need to talk to an external component that bridges the circuit?

1 Like

This is more than likely how it is wired within the dac.

Yes it can, althought external components might be needed.

But that is something that cannot be guided over internet, psyhical inspection of the DAC circuit board is needed to modify it safely since usually manufactors don’t handle the schematics to customers.

1 Like

Yep fair enough. I figured that may be the case. You’d need to get a clue to voltage and resistance right?

This is someone elses image of the internals. The lower right hand knob is the source selector. You can see it shares a board with volume control, and that there are 4 black wires coming from it that go into the main board. I guess/hope that it’s one wire for each input and a shared wire to complete the circuit. Then a multimeter could be used to test for voltage? I have one of those. I understand now I’m stretching the knowledge of volumio community and getting into basic DIY electronics instead.

So maybe leave that with me to figure out, and we’re pretty sure if it is the case a volumio plugin could switch inputs. Then it’s a matter of whether you need to do ‘nice’ things like mute audio, switch input, unmute audio. Or maybe fade down audio, switch, fade up. So there’s no digital glitching etc.

1 Like

maybe this could be a nice option for all your settings :slight_smile:

this one would be nicer but you can’t get it right now

1 Like

That’s really cool, particular if I wanted to have it part of the front baffle. I also have the option of getting a newer version of the DAC that has digital input selectors and an IR remote, in which case a simple IR blaster could be used to control it.

there are a lot of knobs out there if you could combine it with wifi or ble you would not be bounded to IR
i use logitech’s harmony on IR to controle lost of stuff