I2S Drivers

I2S-Drivers.JPG

I understand that I have to Activate Drivers to get the I2S Interface to function correctly. I am curious so I would like to learn a bit more about this:-

Why are Drivers required ?
What are the differences in the design and and implementation of the Serial Interface that mean that there are differences ?
Are these Drivers Open Source ?
Are they easy to code and compile ?

There is a very helpful list on this forum for I2S DAC’s

list-i2s-dacs-for-raspberry-t1103.html

But there are many more DAC’s than Drivers so do most DAC’s use other Drivers or the Generic Option ? For example I have tested an Audiphonics DAC and had to use the HiFiberry Driver.

Does a list exist in which one can see available DAC’s and the I2S Driver that they require ? If not I would be prepared to at least document the current situation with help from forum members.

Kevin

Hi Kevin, let me try and explain a little.

The general I2S signal is pretty much the same for all - there is data being sent from the Pi to the pins and a clock signal which indicated when the data is valid.

An I2S DAC takes these signals and reads the data based on the clock signals.

What the DAC does with the digital signal from input to output is very much DAC specific but out the end you get analog signals.

Each DAC device offers various features, some are pretty featureless - like the TI PCM5102A as used in many of the DACs we find for the Pi. Others offer additional features (like hardware volume control / EQ / etc. etc.) but the control of these features is not something which is done using I2S, rather these DAC features may be controlled over I2C or SPI.

So basic DAC boards which use the same basic DAC offering no additional features are likely to work using the same linux drivers.

More sophisticated DAC boards will use the control signals (i2c or SPI) so will need to have a specific linux driver which aligns to these features and on i2c, each device is at a particular address. So the Driver for the IQaudio PCM5122 based DACs will only work with another similar board if the developer has used the same i2c address and PCM5122.

So although i2s itself is pretty generic, each board needs a driver and each DAC needs a driver too. For our Pi-Accessories these are:

raspberrypi/linux/sound/soc/codecs/pcm512x.c
and
raspberrypi/linux/sound/soc/bcm/iqaudio-dac.c

The effort of getting this all going from scratch can be a challenge and takes time and effort on the first to implement the solution.

Other vendors can then take advantage of others hard work and piggy back onto already developed drivers (as you have experienced). But that’s the world of open source and we contribute for the greater good :slight_smile:

For the Pi you will see int the sound/soc/bcm directory that there aren’t that many board drivers around.

If you look at each card’s /etc/modules content will help you link codec to board driver too.

Hope that helps?

Gordon@iqaudio.com

Thanks for that Gordon,

Let me see if I am getting it, let’s use the IQAudio Pi_DAC for this example

There is effectively 2 serial interfaces,

  • i2s for raw PCM data, Clock and left or right data bit.
  • i2c for control (in the case of the Pi-DAC this data line is P1 Pin 3 as per your documentation (I2C SDA) ?)

When we have USB DAC’s this is still going on but transparent for the user. The USB is implemented as another layer ? So if you could implement this layer with the IQAudio DAC is you wanted too ?

With the RPi & I2S we get rid of this layer so are closer to the guts of the DAC ?

In have experienced that the HiFiBerry (Burr Brown DAC) Driver works with the Audiophonics (Sabre E9023). For this we would have to conclude that the control aspect of BB and Sabre Chips are similar ? Does this make sense ?

Kevin

Yes. You could take the IQaudio DAC and plug a USB chip in front and turn it into a USB audio card.

Yes.

Well the DAC used in these doesn’t have a control path - there’s no special option on the PCM5102 really so it’s just the raw i2s data that’s important and as long as it’s being squirted out of the Pi each will consume it and do their own thing. It’s not that the PCM5102 and E9023 are “compatible”.

Thanks for that Gordon,

Understand things a lot better now. :smiley:

Kevin