Solved: Pi Zero, PWM (analogue) output
|
10th Apr, 2017, 06:38 AM
Post: #1
|
|||
|
|||
Pi Zero, PWM (analogue) output
Hello, I have just joined this forum, sorry for posting in here first but I can not start a new topic?
I have a question about using PWN audio with a Pi Zero. Hoping I will be able to put this in the right part of the forum soon. |
|||
10th Apr, 2017, 07:03 AM
Post: #2
|
|||
|
|||
RE: I am a noob, please help me! | |||
10th Apr, 2017, 09:16 AM
Post: #3
|
|||
|
|||
RE: I am a noob, please help me!
Sorry 'PWM'
I am making a project where I am putting a Pi Zero into an old portable TV. Using XBian as I have found getting a composite signal from the other KODI's was tricky and this on has a nice big interface. the screen is very small. The big problem I am having is the audio, I made the RC filter for the Zero and added "dtoverlay=pwm,pin=18,func=2" to the config file. But still no audio. I have tested the sound is working on the TV, which is fine. Not sure if I screwed up the filter or it is a software problem. I noted in the read me file, "Name: audioinjector-wm8731-audio Info: Configures the audioinjector.net audio add on soundcard Load: dtoverlay=audioinjector-wm8731-audio Params: <None> Name: audremap Info: Switches PWM sound output to pins 12 (Right) & 13 (Left)" I think I understand you need to put some text into the config file, but I'm unsure what? |
|||
10th Apr, 2017, 11:09 PM
Post: #4
|
|||
|
|||
RE: I am a noob, please help me!
I do not have Pi Zero, so I do not have any practical experience with such device
(10th Apr, 2017 09:16 AM)TheDutypaid Wrote: Sorry 'PWM' I'm sure you know this article But you forgot to assign second channel. However, I don't believe that this is the problem Quote:I have tested the sound is working on the TV, which is fine. Not sure if I screwed up the filter or it is a software problem. Test without filter Quote:I noted in the read me file, I suppose audremap overlay did not exist when above linked article was written. So, did you already added Code: dtoverlay=audremap to config.txt without adding dtoverlay=pwm,pin=18,func=2 to that file and use pin 12 and 13 for audio output? Btw, which sound device are you using in Kodi? You have to use Analogue output |
|||
11th Apr, 2017, 02:22 AM
Post: #5
|
|||
|
|||
RE: Pi Zero, PWM (analogue) output
Thank you so much for the help so far it it most kind.
Nachteule Wrote:I'm sure you know this article Yes I have read through that and this guide builds upon it and is a lot simpler. Quote:Test without filter yes, first port of call. I don't even get static so this leads me to believe, there is no output of any kind. Quote:I suppose audremap overlay did not exist when above linked article was written. I have it set to both analogue and HDMI which I changed in the main settings. Tried quite a few variants of code, including what you have said. This is my current text I added to the config file. Code: # uncomment for composite PAL I need to try building a new filter, I am only testing with a mono quick board that was made up out of salvaged components that I desoldered from old PCB's all parts was tested before making the board up Finding reference to Kodi, Pi Zero and audio is hard. HDMI and job is done. Not many people want to watch TV on a 2.3" LCD The model of portable I am using is a small handheld one 'Casio TV-880' It has AV input which is lucky as the old analogue TV signal was switched off in the UK a good few years ago now. I'll be away next week for Easter but hope to test the new filter before then. Will report back when I have new findings. Will still check on here if there is anymore ideas. |
|||
11th Apr, 2017, 04:22 AM
Post: #6
|
|||
|
|||
RE: Pi Zero, PWM (analogue) output
Hmmm, the Raspberry Pi Zero Audio Circuit howto you're using sounds quite simple
Why are you adding Code: dtoverlay=audremap to your config.txt? IMO audioinjector-wm8731-audio overlay is needed for different audio sound card, so you should not add it. I think adding Code: dtoverlay=pwm-2chan,pin=18,func=2,pin2=13,func2=4 is quite enough for audio part (and oc dtparam=audio=on, but this is enabled per default) |
|||
13th Apr, 2017, 03:24 AM
Post: #7
|
|||
|
|||
RE: Pi Zero, PWM (analogue) output
Hmm,
Got all my new components today and breadboarded it all up for testing. Only running the one line of audio code Code: dtoverlay=pwm-2chan,pin=18,func=2,pin2=13,func2=4 Turned it all on and... nothing. Even tested bare output from the Zero. I feel the problem is a programming one, Looking back through the README.overlays file I found this, which I have not tested as running out of time, do you think this is what is needed? Code: Name: audremap So do I need to add this below to the config file? Code: dtoverlay=audremap,<enable_jack>=<val> I'm unsure about the val. |
|||
13th Apr, 2017, 03:31 AM
Post: #8
|
|||
|
|||
RE: Pi Zero, PWM (analogue) output
You could try it, but don't put both dtoverlay= lines to config.txt. Only one of them
IMO audremap does not need any parameters, bc you do not need to swap l<->r channel and you do not have audio jack output on Pi Zero |
|||
13th Apr, 2017, 06:35 AM
Post: #9
|
|||
|
|||
RE: Pi Zero, PWM (analogue) output
I have been a bit silly, been following this 'pin out' for the Pi
There is a big difference between 'pin' 13 and GPIO 13 The simple code, works fine. Code: dtoverlay=pwm-2chan,pin=18,func=2,pin2=13,func2=4 Thank you again for your help you have given and setting up my question in the right place. It was with your support, I keep trying new things and double checking my work. Funny when your mind thinks you have something right, that is completely wrong. |
|||
13th Apr, 2017, 07:15 AM
Post: #10
|
|||
|
|||
RE: Pi Zero, PWM (analogue) output
(13th Apr, 2017 06:35 AM)TheDutypaid Wrote: There is a big difference between 'pin' 13 and GPIO 13 Indeed, it is I was thinking about that, but was sure you were usiing right pins Quote:The simple code, works fine. You're welcome. Good, you got it now Enjoy your new project, so this thread can be set to solved |
|||
2nd Nov, 2018, 03:57 AM
Post: #11
|
|||
|
|||
RE: Pi Zero, PWM (analogue) output
Hi...The possibility to remap the PWM output to accessible GPIO pins was completely new to me and opens up a lot of simple audio applications for the Pi Zero (talking clock etc.).
smt pcba |
|||
« Next Oldest | Next Newest »
|