25

The Pi has a standard 3.5mm audio jack, but this cannot be used for audio input

However, we've got a load of GPIO pins on various interfaces. Would it be possible to recieve analog audio into the Pi via the GPIO?

Elinux tells me:

It is also possible to reconfigure GPIO connector pins P1-12 and 13 (chipset GPIO 18 and 21) to provide an I2S (a hardware modification may be required [12]) or PCM interface. However, PCM_FS and PCM_DIN (chipset pins 19 and 20) are needed for I2S or PCM.

There seem to be references to this I2S connection all over the place, but nowhere giving a clear yes or no.

ACarter
  • 2,350
  • 6
  • 25
  • 40

3 Answers3

15

As shown here you can get I2S via P5:

http://elinux.org/RPi_Low-level_peripherals#P5_header

And here is a kernel driver for using it:

http://blog.koalo.de/2013/05/i2s-support-for-raspberry-pi.html

koalo
  • 251
  • 2
  • 6
14

The Peripherals datasheet for the BCM2835, used on the Raspberry Pi, gives you the answer in Chapter 8. I quote:

"The PCM audio interface is an APB peripheral providing input and output of telephony or high quality serial audio streams. It supports many classic PCM formats including I2S."

20 pages of information on this subject alone.

Like you said: not all the pins are available from the GPIO connector! PCM_FS and PCM_DIN (the one you probably need) are not on the GPIO connector, you'll need to check the schematic to see if you can reach those in some way.

UPDATE:

According to the schematics you're out of luck:

enter image description here

Sadly connected to nothing! No chance to get anything connected to that!!

But something odd is going on, if these pins are the actual missing I2S pins then the V2.0 board should also not have these pins on a connected. But the documentation states that is does have these pins available on the newly added connector P5. These are connected to different pins then the wiki says... This needs a little further investigation... soon more....

ikku
  • 4,544
  • 1
  • 26
  • 28
5

What revision of the board is this? The Rev B 512M has all four PCM pins mapped to the P5 connector. You'll have to add your own pins to the board but use the under side to still make use of the GPIO connector on the front.

On the schematic, Page 2, bottom left, look BCM2835-IO2 chip for the GPIO28-31 pins labelled as GEN7-10 corresponding to PCM Clk, Fs, DIn, DOut mapping to the P5 holes 3-6 respectively. This pin out would provide PCM when assigned as the Alt2 functionality.

gb

Gary
  • 51
  • 1