Page 3 of 8

Re: PWM Audio Guide

Posted: Fri Jun 10, 2016 11:13 am
by Spruc3Moose
So I built my filter today, but not sure if it is hooked up right. I just thought I would post it here for some feedback. I have not hooked it up the pi zero yet because I am not sure which wires go where. I have the two wires from the amp (from the guide) ready to go, but not sure which ground to use going into the filter and out. Also not sure where the pot wheel goes in this setup. Any help would be great...or I will just wait until the next guide.

Image
Image
Screen Shot 2016-06-10 at 1.05.21 PM.png
Screen Shot 2016-06-10 at 1.05.21 PM.png (44.98 KiB) Viewed 16339 times

Re: PWM Audio Guide

Posted: Sat Jun 18, 2016 3:25 am
by Kharmeleon
Sorry for the question but why is it necessary to use that low pass filter? Would it be necessary to use it at the audio jack output of a raspberry pi 3? Thanks for any statement about that in advance. Greets

Re: PWM Audio Guide

Posted: Sat Jun 18, 2016 3:08 pm
by Kilren
Kharmeleon wrote:Sorry for the question but why is it necessary to use that low pass filter? Would it be necessary to use it at the audio jack output of a raspberry pi 3? Thanks for any statement about that in advance. Greets
This is for the raspberry pi zero because it does not have audio out naturally. You have two choices to get audio out on RPi0: by PWM low-filter, or by usb-dac.

You don't need this if you're using RPi2/3

Re: PWM Audio Guide

Posted: Sat Jun 18, 2016 3:17 pm
by Kharmeleon
Kilren wrote:
Kharmeleon wrote:Sorry for the question but why is it necessary to use that low pass filter? Would it be necessary to use it at the audio jack output of a raspberry pi 3? Thanks for any statement about that in advance. Greets
This is for the raspberry pi zero because it does not have audio out naturally. You have two choices to get audio out on RPi0: by PWM low-filter, or by usb-dac.

You don't need this if you're using RPi2/3
Thank you for the answer mate!

Re: PWM Audio Guide

Posted: Fri Jun 24, 2016 7:44 am
by Ganreizu
So say i'm doing mono sound, is this the code i would use?

Code: Select all

dtoverlay=pwm-1chan,pin=18,func=2
(for left channel?)

vs

Code: Select all

dtoverlay=pwm-2chan,pin=18,func=2,pin2=13,func2=4

Re: PWM Audio Guide

Posted: Fri Jun 24, 2016 8:00 am
by tronicgr
Kilren wrote:
Kharmeleon wrote:Sorry for the question but why is it necessary to use that low pass filter? Would it be necessary to use it at the audio jack output of a raspberry pi 3? Thanks for any statement about that in advance. Greets
This is for the raspberry pi zero because it does not have audio out naturally. You have two choices to get audio out on RPi0: by PWM low-filter, or by usb-dac.

You don't need this if you're using RPi2/3
Actually there is a third option for sound on raspberry pi zero, I2S sound!
https://forums.adafruit.com/viewtopic.php?f=50&t=97961

Thanks
Thanos

Re: PWM Audio Guide

Posted: Fri Jun 24, 2016 6:26 pm
by SP33
Ganreizu wrote:So say i'm doing mono sound, is this the code i would use?

Code: Select all

dtoverlay=pwm-1chan,pin=18,func=2
(for left channel?)

vs

Code: Select all

dtoverlay=pwm-2chan,pin=18,func=2,pin2=13,func2=4
I have not tried mono sound myself yet but from my own tests, pin 18 was outputting in the right channel so I believe pin2 and func2 would be for left channel (pin 13)
so either try

Code: Select all

dtoverlay=pwm-1chan,pin2=13,func2=4
or

Code: Select all

dtoverlay=pwm-2chan,pin2=13,func2=4
(I'm unsure if pwm-1chan is valid)
or you could just use the original code and not use pin 18, only hook up pin 13 (left channel) just to be sure.

Re: PWM Audio Guide

Posted: Sat Jun 25, 2016 4:25 am
by joe7dust
SP33 wrote:
Ganreizu wrote:So say i'm doing mono sound, is this the code i would use?

Code: Select all

dtoverlay=pwm-1chan,pin=18,func=2
(for left channel?)

vs

Code: Select all

dtoverlay=pwm-2chan,pin=18,func=2,pin2=13,func2=4
I have not tried mono sound myself yet but from my own tests, pin 18 was outputting in the right channel so I believe pin2 and func2 would be for left channel (pin 13)
so either try

Code: Select all

dtoverlay=pwm-1chan,pin2=13,func2=4
or

Code: Select all

dtoverlay=pwm-2chan,pin2=13,func2=4
(I'm unsure if pwm-1chan is valid)
or you could just use the original code and not use pin 18, only hook up pin 13 (left channel) just to be sure.
Where do we put our speaker's ground? I'm not using to a channel only having 1 wire, it is usually 2.

Re: PWM Audio Guide

Posted: Sat Jun 25, 2016 5:53 am
by SP33
@joe7dust Just use the same ground you used for the audio filter you just made, you can solder a wire where you attached the ground and to your audio plug.

Re: PWM Audio Guide

Posted: Sat Jun 25, 2016 6:43 am
by joe7dust
SP33 wrote:@joe7dust Just use the same ground you used for the audio filter you just made, you can solder a wire where you attached the ground and to your audio plug.

I did that but it's not working. -_- http://imgur.com/f2L1mkn