Is it possible to read an audio signal through on GPIO pin and give the same signal out through a different GPIO pin or through the audio jack?

I basically want to have 4 audio inputs and one audio input and don't know how to switch these signals using the Pi (else I would use a button/switch).

I already found this Can I get audio input through the GPIO but it says that it should have it but doesn't seem to be connected.

2 Answers 2


The GPIO (general purpos input/output) pins are digital only. That is, they either read digital values (low or high at certain voltage levels) or output such. Audio signals (at least what I read from the question) are on the other hand analogous. The GPIO pins can neither input nor output* such signals in a useful way.

The task however - to input from multiple sources and to output to different sinks, without signal processing on the Pi's part - on the other hand, could be solved with digitally controlled analog switches. That way the Pi (its GPIO pins) could be used to control the analogue signal without routing it through the Pi itself.

Analog multiplexers or matrix switches could do the trick. See:

* safe tricks like PWM, but that's just solving the output part.

  • 1
    It seems like the TEA 6420 is what I am searching for?
    – Cludch
    Mar 18, 2016 at 13:07
  • At 2€ and a DIY-friendly DIL package it seems like a good thing to start with! (Good find, I'll add it to the answer)
    – Ghanima
    Mar 18, 2016 at 13:13
  • Let us know the results when your project is finished :)
    – Ghanima
    Mar 18, 2016 at 13:34
  • I will! Just ordered the TEA 6420. When the cables and the I2C are shipped I will need some time to get this to work but I am optimistic.
    – Cludch
    Mar 18, 2016 at 14:46

That reference to I2S may actually be a reference to the Wolfson audio card that does connect to the P5 header on later (non- +) RPi models. For the + and 2B (and presumably the 3B) modules you would use the successor from the same people who were bought out by Cirrus-Logic so that device is the Cirrus-Logic audio card - the software and capabilities though are, I understand it, the same between the two...

As to your original question - analogue switching of one-of-four-inputs to an output on an exclusive (only one input selected at a time) basis would take just two GPIO pins (possibly with a third to "mute" the output during a switch or at other times) and some circuitry that could be included in some fairly basic ICs (e.g. this, the ADG1204 from Analog Devices).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.