PWM Audio Guide

Various user-contributed guides for hardware-related things
User avatar
RxBrad
Posts: 260
Joined: Fri Jul 22, 2016 9:10 am
Has thanked: 120 times
Been thanked: 143 times
Contact:

Re: PWM Audio Guide

Post by RxBrad » Sun Sep 25, 2016 6:13 am

@Tim If you configure the Pi for mono, both channels are combined into the one channel and you shouldn't lose anything.

Tim
Posts: 23
Joined: Sun Sep 04, 2016 5:24 am
Been thanked: 3 times

Re: PWM Audio Guide

Post by Tim » Sun Sep 25, 2016 6:32 am

Thank you @RxBrad will do that

laluva
Posts: 17
Joined: Thu Aug 25, 2016 12:35 pm
Has thanked: 1 time
Been thanked: 3 times

Re: PWM Audio Guide

Post by laluva » Mon Oct 03, 2016 2:47 am

Popcorn wrote:
joe7dust wrote: Wow grats on making this looking somewhat user-friendly. I took one look at the adafruit guide and was like NOPE not worth the effort, but this actually looks quite doable now.

Would someone mind telling me what I would need to change on this if I only wanted mono sound? I don't plan to have a headphone jack at all, just a single speaker that was pulled from an old laptop. I'm not exactly a connoisseur of gameboy beeps and bloops at 8-bit or whatever it was encoded at, and mono will be just perfect for that. Also I don't think the original had stereo speaker output at all, it only affects the headphone jack I think.

edit: Also, I don't need a potentiometer. I plan to keep the volume at a fixed level!
You can follow my circuit above, that is mono.

Just add this to your /boot/config.txt

Code: Select all

dtoverlay=pwm,pin=13,func=4
If sound is taken only mono from GPIO 18 the code would be this? dtoverlay=pwm,pin=18,func=2?

TigerClaw32
Posts: 20
Joined: Fri Sep 02, 2016 3:15 am
Contact:

Re: PWM Audio Guide

Post by TigerClaw32 » Mon Oct 17, 2016 10:09 am

Hi, do I need the stereo filter, if I am using mono speaker but want stere headphone sound?

atlantisweb
Posts: 2
Joined: Wed Oct 19, 2016 3:36 pm

Re: PWM Audio Guide

Post by atlantisweb » Wed Oct 19, 2016 3:55 pm

Thanks to this guide I built my first bit of electronics for my Pi Zero. It was all working well on Raspionan Wheezy and on Jessie Lite until I installed updates then I just get static, i've tried a different speaker. Both the breadboard version and the soldered final version worked fine this morning but now neither work.

I'm using mono sound from pin 13, have also tried pin 12 and 18. But 12 also gives static and 18 gives no sound at all.

Issues seem to be caused by use of the ServoBlaster/ServoSix controller as uninstalling the software that controls this fixes the sound issue. How do I get both working together?

Anyone have any ideas? I'm new to this stuff and was so pleased that I got it working, so a bit disappointed now its giving static.

Thanks
Mark

atlantisweb
Posts: 2
Joined: Wed Oct 19, 2016 3:36 pm

Re: PWM Audio Guide

Post by atlantisweb » Thu Oct 20, 2016 2:36 pm

atlantisweb wrote:Issues seem to be caused by use of the ServoBlaster/ServoSix controller as uninstalling the software that controls this fixes the sound issue. How do I get both working together?
Just in case this helps anyone else...

Issue was indeed the ServoSix board thats based on ServoBlaster. This and Audio use PWM and it causes interferance on audio. Solution on ServoBlaster site is to use PCM instead of PWM on the Servo controller.

There is a program called servod which can be used to make te config change.... command shown below, it doesn't remember settings between reboots though!

sudo ./servod --pcm

sckay
Posts: 35
Joined: Sun Sep 25, 2016 1:18 pm
Has thanked: 2 times
Been thanked: 2 times

Re: PWM Audio Guide

Post by sckay » Sun Nov 20, 2016 4:42 pm

Please, i need help. I can use the speaker of this gameboy using the port speaker + and - only for speaker? or i necessary use the headphone process?. I only want, what the speaker of the gameboy zero run. I dont know what i Will change in the congif.txt for the sound run, :(.
http://i67.tinypic.com/1254002.jpg
Thanks

seiren
Posts: 4
Joined: Thu Oct 20, 2016 7:07 am
Been thanked: 6 times

Re: PWM Audio Guide

Post by seiren » Wed Nov 23, 2016 12:30 pm

Thank you for the guide. Just did this, seems to be very quiet. Any guidance on this?
I used these speakers: http://www.maplin.co.uk/p/02w-super-thi ... 57mm-l70aa

larsen2011
Posts: 35
Joined: Sun Jul 17, 2016 11:37 am
Has thanked: 16 times
Been thanked: 4 times

Re: PWM Audio Guide

Post by larsen2011 » Sun Nov 27, 2016 6:19 am

I've wired everything according to the "general" diagram, yet I don't get sound...
Pictures are included in my build log: http://www.sudomod.com/forum/viewtopic. ... 891#p20891

I'm happy for any suggestion that could help!

Thanks!

Edit: problem solved, my GB jack needs different wiring... See Fleder's headphone jack guide for more details...

User avatar
winnetouch
Posts: 152
Joined: Mon Jul 11, 2016 10:56 am
Has thanked: 2 times
Been thanked: 30 times

Re: PWM Audio Guide

Post by winnetouch » Sun Dec 11, 2016 8:44 am

I'm also having issues. The sound used to work but it was hissy. Then I changed out the screen (a GPIO for composite screen) and the sound stopped working. Everything is wired correctly and I've added the lines to the config.txt file. The board is connected to power and the two leads are connected to the correct GPIO pins.

Neither the jack or the speaker work. I'm using helders controller board with audio and build in audio jack (so the wiring of the jack can't be an issue).

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest