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
  • 39

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
  • 5
  • 2
    welcome to Raspberry Pi Stack Exchange! it's usually better if you don't post a link only answer (what if the linked resource becomes unavailable?), would you consider editing your answer to summarize salient points from the webpages you linked? – nc4pk May 21 '13 at 15:20
  • 4
    @Koalo 's work on the I2S driver is admirable, he should be given 2K rep just for blessing us with his presence. – Dog Ears May 24 '13 at 11:04
  • i must admit my ignorance and beg u to explain a little bit more: where is that p5 connector ? i have Hardware : BCM2835 Revision : a02082 it's a pi3 model B – L.Trabacchin Jan 21 '18 at 17:02
  • The PI 3 has the relevant pins integrated in the main connector. – koalo Jan 22 '18 at 09:59
  • this is still supported by RPi 4 right? I can not find PCM_DIN in the schematics. – a_bet Apr 13 '20 at 19:44
  • Should be the case. I have no Raspberry Pi 4 to verify this, but at least for 3B, they should be available. See https://raspberrypi.stackexchange.com/questions/79870/confirming-the-i2s-pins-on-raspberry-pi-3-model-b – koalo Apr 14 '20 at 11:27
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,494
  • 1
  • 25
  • 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