0
\$\begingroup\$

I'm working on a speaker project where I'd like to use a microcontroller's SPDIF output (aka IEC 60958) to drive audio data to a speaker.

I've' been doing research on the topic, and I'm having trouble grasping exactly what steps are required to convert the SPDIF data into an analog input signal for an audio amplifier.

I believe the SPDIF is a compressed data format, so some type of converter is required to decompress the SPDIF data into a standard I2S data stream. From there, I'd need to convert digital to analog, then amplify the analog for the speaker:

Microcontroller --SPDIF--> I2S Converter --I2S--> DAC --analog--> amplifier --audio--> speaker

Is there any way that this approach can be simplified? I'd like to minimize complexity/part count where possible.

Is this the standard approach for handling a SPDIF interface? Or are there simpler approaches for driving a speaker with SPDIF data?

\$\endgroup\$
3
  • \$\begingroup\$ SPDIF is not compressed, but ruggedized for transmission over cable, unlike I2S which is Inter-IC Sound, intended for use within a circuit board. So... SPDIF receiver to DAC to volume control to amplifier to speaker. You may find subsystem ICs that implement SPDIF receiver, DAC, volume control in one. \$\endgroup\$ Nov 2 '20 at 16:48
  • 1
    \$\begingroup\$ Actually, SPDIF is a signalling standard, the data it carries could be either linear PCM or a compressed format such as AC3. Realistically you may just want to buy a speaker which does this for personal use; if you're designing a product then you need to do some serious research both to define the exact requirement of what you need to support and to look at options ranging from SPDIF to I2S and then and I2S DAC, or if you are going class-D anyway possibly various digital inputs to that. Or DSP solutions implementing AC3 decoding and various other things which go back tot he late 1990's... \$\endgroup\$ Nov 2 '20 at 17:01
  • \$\begingroup\$ Appreciate the background info. Yes, this is something I am designing. We have a microcontroller picked out already and we want to add a speaker to play audio. The micro has an SPDIF output available, so I'm trying to understand what is involved with implementing that into an on-board speaker output. \$\endgroup\$ Nov 3 '20 at 1:29
1
\$\begingroup\$

The signal path outlined in the question is basically correct. Those are the necessary signal processing steps to get SPDIF audio to be output from a speaker.

In terms of a simplified approach, there are ICs which combine various pieces of the SPDIF signal path (e.g. DAC+amp), but these have various design tradeoffs that are too numerous to mention here, and the selection of which is going to be highly dependent on your particular design constraints.

The other approach you may want to explore is that of "direct digital" audio amplifier ICs (such as TI TAS5760LD, or ADI SSM2529). These amplifiers employ a signal path that looks something like:

PCM(I2S) -> [PCM to PWM Modulator] -> PWM -> [Class-D Output] -> audio -> [Speaker]

An SPDIF to PCM (e.g. I2S) converter is still required, but they avoid the intermediate analog-to-digital conversion stage, keeping the signal entirely in the digital domain until the Class-D output stage/filter. This is in theory easier to implement and has a lower parts count, but with the caveat that the available options are fairly limited.

Note that SPDIF is not compressed, rather it employs Manchester encoding to combine clock and data information into one signal. DACs generally accept synchronous serial data (I2S, left-justified, etc) where clock and data are on separate inputs . As bit of an over-simplification, the SPDIF receiver separates the clock and data information into distinct signals which can be input into the DAC.

\$\endgroup\$
1
  • \$\begingroup\$ SPDIF is a signalling standard not an audio codec; the data it carries may be either compressed (AC3 etc) or linear in various formats; actually it could be anything. \$\endgroup\$ Nov 2 '20 at 18:15
2
\$\begingroup\$

You need an audio DAC, one way or another. Either a device that can directly receive S/PDIF and output analog audio, in which case it might be a more complex audio codec chip, or simply an audio DAC which only has an I2S audio input, and then you only need an S/PDIF receiver which can output the audio data over I2S bus.

S/PDIF is not a compressed data format. It is simply an interface to stream digital audio data, and it can be used to transmit either linear PCM (LPCM) sample data or encoded bitstream data. When data is not LPCM but encoded bitstream, it must first be decoded with a DSP to end up with LPCM data that can be fed to DAC.

\$\endgroup\$
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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