Take the 2-minute tour ×
Raspberry Pi Stack Exchange is a question and answer site for users and developers of hardware and software for Raspberry Pi. It's 100% free, no registration required.

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.

share|improve this question
    
No, the audio jack is output only according to this quetsion. –  Frepa Jan 6 '13 at 13:26
    
@Frepa, yup, didn't see that, I've voted close. –  ACarter Jan 6 '13 at 13:28
    
Edited the question, can I do it through GPIO? –  ACarter Jan 6 '13 at 15:27
    
Of course you can get audio input using GPIO and ADC. I'm on going to do such project soon so I will post my results if you want. –  dArI0 Feb 28 '13 at 13:03
    
Please do post them! ;) –  ACarter Feb 28 '13 at 17:42
add comment

3 Answers

up vote 5 down vote accepted

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....

share|improve this answer
    
It was all looking so hopefull... I can get the output, but not the in! Thanks for finding that :) –  ACarter Jan 6 '13 at 16:33
    
Hmmm, I don't seem to be able to find any reference of the PCM pins in the schematic... –  ACarter Jan 6 '13 at 16:35
    
Me neigther, but I'm not finished looking yet, but chances don't look very good. –  ikku Jan 6 '13 at 16:35
    
"Eben shouts from the bath that he's not actually sure we have lost it - it may just be hidden behind some GPIO muxes." (not looking too good) –  ACarter Jan 6 '13 at 16:37
1  
I guess I checked that already some time ago, that might be the reason why I ordered a USB audio plug on ebay like this one –  ikku Jan 6 '13 at 16:39
show 8 more comments

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

share|improve this answer
    
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? –  tapped-out May 21 '13 at 15:20
    
@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
add comment

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

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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