tlsarles
Posts: 1
Joined: Sun Jul 15, 2012 10:47 pm

Using GPIO for Audio Output

Sun Jul 15, 2012 11:00 pm

I am looking to get 5 channel pre-amp audio out of a Pi, to feed into a car amplifier. it is feasible to do this via the GPIO? I am a fairly novice programmer, so I'm not sure A; if this can be done, and B; how in depth this would be.

hunternet93
Posts: 336
Joined: Mon Dec 12, 2011 4:34 pm

Re: Using GPIO for Audio Output

Mon Jul 16, 2012 3:37 am

I believe you might be able to use an I2C or SPI DAC (digital to analog converter) to output audio (http://www.raspberrypi.org/phpBB3/viewtopic.php?t=3975), but a USB sound card might be a simpler (albeit more expensive) method.

User avatar
Grumpy Mike
Posts: 914
Joined: Sat Sep 10, 2011 7:49 pm
Location: Manchester (England England)
Contact: Website

Re: Using GPIO for Audio Output

Mon Jul 16, 2012 2:53 pm

The problem in using the GPIO for sound output is that the Linux operating system steals lumps of time from your running programs, therefore it is impossible to deliver a steady stream of samples without having a hardware FIFO buffer on the other side of the GPIO lines to smooth out the time when your code "goes missing". Hardware FIFOs are a bit pricy. You could turn a PIC or other such processor into a FIFO but it all starts to get messy.

darkcity
Posts: 66
Joined: Wed Aug 03, 2011 3:01 pm
Contact: Website

Re: Using GPIO for Audio Output

Wed Jul 18, 2012 6:41 pm

JACK software is designed to ensure audio inputs and outputs are delivered at the correct time. Not sure if Rpi capable of running it though?
http://jackaudio.org/

User avatar
Grumpy Mike
Posts: 914
Joined: Sat Sep 10, 2011 7:49 pm
Location: Manchester (England England)
Contact: Website

Re: Using GPIO for Audio Output

Wed Jul 18, 2012 7:56 pm

It looks to me like Jack needs a sound card in order to work. That is not going to be easy to connect to the GPIO lines.

User avatar
SharpEdge
Posts: 11
Joined: Tue Oct 23, 2012 8:25 am
Location: Turin, Italy

Re: Using GPIO for Audio Output

Tue Oct 23, 2012 8:32 am

I'm to really interested to get 2.1 analog sound out from raspberry pi, i need it for a car enviroment where only analog rca is available.
What's the best solution to get a HQ analog stereo + sub output? GPIO, sound card, arduino, other?

hunternet93
Posts: 336
Joined: Mon Dec 12, 2011 4:34 pm

Re: Using GPIO for Audio Output

Tue Oct 23, 2012 11:40 am

SharpEdge wrote:I'm to really interested to get 2.1 analog sound out from raspberry pi, i need it for a car enviroment where only analog rca is available.
What's the best solution to get a HQ analog stereo + sub output? GPIO, sound card, arduino, other?
The simplest method would be to get a USB sound card. Most should be supported under Linux.

Return to “Graphics, sound and multimedia”