I'm looking for a way to mix a single I2S signal with a single stereo analog input, and output the mixed result either as I2S or S/PDIF (S/PDIF would be preferred, as that is my actual target output format, but if I have to I can convert I2S->S/PDIF easily enough. I've found plenty of solutions for mixing digital and analog inputs with analog output, but are there any options for digital output?
We have several ways this could be done and the answer will depend on your application and costs of producing the product.
ADAU1701 is easy to use, it has two analog inputs and four analog outputs. Then it also has a serial port for I2S or TDM. So you can being it as much as 8 channels of digital audio and once in the core all these digital and analog signals can be processed how ever you desire. Then you can send it out either to the on-chip DACs or out of the serial port. The serial port has only one set of clock pins so you must run the serial input and output using the same clocks. The downside of this part is that it does not have SPDIF. You would have to use the serial output port to go to a SPDIF transceiver chip.
The ADAU1452 has built in SPDIF. It has lots of serial ports! The four input and four output ports can be operated at different rates. There are sample rate converters and lots of processing power! The downside is that it does not have any converters for analog signals. So you would have to use a Codec of some kind to do the analog conversions and use up a couple of the serial ports for that. This is not a huge deal but it does complicate the design of the hardware.
The real answer to application complexity/cost is "as simple as possible". The current design is digital-only, basically nothing more than an application-note implementation of the TI DIT4096 or Cirrus CS8406 in hardware mode to convert a fixed 32kHz I2S signal to S/PDIF. The fixed I2S->S/PDIF isn't changing, I'm just wanting to be able to mix a single stereo analog input signal into the final output. The analog signal was generated at a maximum of 44.1kHz, but it would be acceptable to capture/down-sample it to 32kHz to match the digital signal.
OK, Simple... Well,... I will propose a few options and see what you think.
1) We have the ADAU1452/51 that would take an SPDIF signal in and has an SPDIF output so the SPDIF is built in. What is not built in is an ADC for the analog audio signal. So you will need to use an ADC and all the circuitry supporting that part. The ADAU1372 is actually an easy part to implement and does not need a lot of external circuitry and is fairly small. It does have four ADCs and two DACs but many people use it for only one or the other. So that would go into the DSP and in there it can be mixed with the SPDIF audio input and go out the SPDIF audio out. You can use some of the AUX ADCs and GPIO for controls if you need some front panel controls without using a microcontroller. So this is reasonably simple and since it has sample rate converters built in it will just work and clocking is not much of an issue. It is very flexible for clocking.
2) Use the ADAU1701. This part has a DSP and built in converters. So all that is done. You will need some buffers for the audio but that is simple. What it does not have is the SPDIF receiver or transmitter. So that all needs to be done externally. The ADAU1701 has a serial input and output port that must run at the same rate. So this means that the entire circuit will have to run at the incoming SPDIF sample rate with no other options. It will be driving everything and if the clock goes away everything stops. The DSP is capable of mixing the two signals and sending it out of the serial port. There are also some GPIO and AUXADCs for external controls.
So these two options are tradeoffs. Option 1 has fewer chips, Option 2 may be smaller in footprint and power but more chips and the performance is not quite as bullet proof as the first option.