PeterGisby
Posts: 2
Joined: Thu Dec 31, 2015 9:20 am

Retro Pi Zero - Analogue Sound

Thu Dec 31, 2015 9:41 am

Hi,
This all started when one of the guys at work mentioned the PiZero being free on the front of a magazine, I'm guessing I'm not the only one that can say this either........

Anyways, a subscription later I have the MagPi and my PiZero and all is well with the world. Now to the question of what to make it do...

Within days of getting my first MagPi I get the second, filled with ideas and projects that people have already done with thier Zeros.. I've always been a fan of the older computers, a throw back to a easier 'tape driven' life before the Internet when you didn't need more that a few Mhz and kilobytes of RAM to spark the imagination, so the 'RetroPi in an old Analogue TV' was right up my street.....
As luck would have it I had an old flat screen analogue TV, good job I didn't do that tip run when scheduled, and set about modifing it. My want was to hide the PiZero within and just have a power switch, in case I wanted to use the scart for anything, a reset button and some USB's on the back of the TV itself. All went well, and it's running like a dream, but there is no sound...

I've spent a few days researching and have built the circuit mentioned in this article: https://learn.adafruit.com/introducing- ... io-outputs and adjusted the GPIO pins as described in this article: viewtopic.php?f=91&t=86609&sid=b0bd5e99 ... 6873533622 but still no sound.....

Is there a step-by-step guide on how to do this, or to bring analogue sound to a PiZero a different way, that can be verified at each point as currently I'm unsure which bit is not working, is it my circuit or the pin re-assignment or both????

Any help apreciated as you can't really play Valhalla for the Amiga without hearing the little guy speak...

Thanks for any and all help
Cheers
Peter.

User avatar
DougieLawson
Posts: 39302
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: Retro Pi Zero - Analogue Sound

Thu Dec 31, 2015 11:52 am

You only get sound from a Zero with HDMI running in CEA mode. The Zero doesn't have any analog audio (unless you do it yourself with an add-on board). That needs some software/device tree changes because it doesn't use the normal PWM pins.

The step-by-step stuff is here: https://learn.adafruit.com/adding-basic ... ry-pi-zero#
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

User avatar
karrika
Posts: 1125
Joined: Mon Oct 19, 2015 6:21 am
Location: Finland

Re: Retro Pi Zero - Analogue Sound

Thu Dec 31, 2015 1:16 pm

I got analog sound by adding wiringpi

apt-get install wiringpi

And then giving the proper commands to set the audio pins.

gpio -g mode 12 ALT0
gpio -g mode 13 ALT0

So this was for setting the pins GPIO12 and GPIO13 to analog audio.
PWM0, which can be set to use GPIOs 12, 18
PWM1 which can be set to use GPIOs 13, 19

After this I could play a mp3 file by

apt-get install omxplayer
omxplayer -o local example.mp3

The "local" sets the sound to pins instead of hdmi.

PeterGisby
Posts: 2
Joined: Thu Dec 31, 2015 9:20 am

Re: Retro Pi Zero - Analogue Sound

Sat Jan 02, 2016 6:44 pm

Thanks Guys.....

I'm new to this and getting my head arround it all is taking longer than I'd like...
Upgraded to Jessie and re-addressed the ports and all is working well, at least it wasn't my circuit..

Retro gaming here I come..

Cheers.
Peter.

Return to “Gaming”