Captured: 2015-12-04 at 23:45 from learn.adafruit.com
To keep the Raspberry Pi Zero as low cost and small as possible, the Pi foundation didn't include a 3.5mm audio jack. There's also no breakout pads for the audio output. This made us a little :( at first but then we thought "hey you know, we can probably figure out how to get audio out with a little hacking!
The Broadcom chipset used for the Pi does not have a true analog output. Instead, two pins are PWM (pulse-width-modulated) at very high speeds, and filtered. The PWM frequency has to be at least10x as high as the highest frequency we want to replicate in audio. Then, by adjusting the duty cycle of the PWM, we can 'fake' an audio signal.
Audio is 20Hz to 20KHz, and the PWM output from the Pi is 50MHz so we can easily filter the high 50MHz out (and anyways it cant be heard).
Looking at the Pi B schematic, we can see PWM0_OUT and PWM1_OUT are the left and right channels. R21 and R20 are voltage dividers to get the 3.3V signal down to about 1.1V max (that's the max peak-to-peak voltage you want for audio line level.
C20/C26 works with R21/R27 to create an "RC low-pass filter". You can calculate the cut-off frequency with 1/(2piRC) = 1/(2pi2703310-9) = 17865 Hz which is pretty close to 20KHz!
C48/C34 acts as a DC-filter capacitor, it only allows AC through - speakers and headphones don't like DC voltage!
Finally 8AV99 are ESD protection diodes. That's to protect the Pi from static coming in and zapping the PWM pins..
In case its not available, you can download it by clicking this button:
Re-boot your Pi Zero up, and get back to the command line. Then mv the file over and un-tar it
then go into the uncompressed directory and run the compile/install script with
OK now you can run the updated version of gpio to read the states of all the pins:
The table has a ton of information going on. What you want to look for is BCM pins #18 and #13
Yep! You can see the new ALT settings.
I'm using a 3.5mm audio jack terminal block to wire up the left & right channels + ground.
Finally Force 3.5mm (Headphone)
You only have to do this once, you can hit return and then Finish to exit