Page 1 of 1

Audio noise w/ WaveShare 1.3 IPS HAT (SOLVED)

Posted: Sat Sep 15, 2018 9:14 am
by Palmore
I'm working on a Pi0cket style mni Raspberry Pi 0 (non-wifi) build to run retropie on.

Originally I was testing out the WaveShare 1.44inch TFT LCD/Button hat and I wired audio up to GPIO 18 with out issue.

I then swapped the display to the WaveShare 1.3inch ISP LCD/Button hat and began getting horrible whine in the audio. (Same exact wiring).

Below is my setup

Raspberry Pi Zero
WaveShare 1.33 IPS Hat https://www.waveshare.com/w/upload/6/6b ... ual_en.pdf
B103 10k Pot https://www.amazon.com/gp/product/B00O9 ... UTF8&psc=1
PAM8403 2channel amp https://www.amazon.com/gp/product/B00XA ... UTF8&psc=1

I'm only concerned with single channel audio as I will pretty much only be playing NES on this device ( and GPIOs 13 and 19 are taken up by the buttons on the hat)

I've added the following lines to my /boot/config.txt

dtoverlay=pwm,pin=18,func=2
disable_audio_dither=1
force_pwm_open=0

With force_pwm_open=0 set, the hiss/whine only occurs while a game is loaded, with out that option the hiss/whine starts at first game load and continues to reboot.

I've tried several wiring options, and even pulling audio from GPIO12 (its been such a train wreck the past 2 days trying to rid the whine noise, I'm fairly sure I got no audio out of GPIO12, even when assuring my settings are correct)


Lastly I've tried powering the AMP from an external power supply, but the whine persisted.

Below is my current wiring diagram. Be gentle, I spent 32 hours in MSPaint on it ;)
Audio Wiring.png
Audio Wiring.png (40.06 KiB) Viewed 8279 times

Re: Audio noise w/ WaveShare 1.33 IPS HAT

Posted: Sat Sep 15, 2018 2:58 pm
by Helder
Are you using a filtering circuit on the PWM audio coming out of the Pi? That might help clean the audio a bit.

Re: Audio noise w/ WaveShare 1.33 IPS HAT

Posted: Sat Sep 15, 2018 5:05 pm
by Palmore
There currently is no filtering circuit inline, I'm trying to keep everything as compact and tiny as possible. Is there something super small that you are aware of that could assist? I'm still fairly new to all this, but loving the hobby.

Re: Audio noise w/ WaveShare 1.33 IPS HAT

Posted: Sat Sep 15, 2018 7:19 pm
by Palmore
I ended up coming across this article and just setup the low-pass filter so far. And wow, night and day difference.

https://othermod.com/raspberry-pi-zero-audio-circuit/

I used a 270ohm resistor inline from GPIO18, then said resistor into a 33nf cap (going to ground). All hissing is gone, I'm guessing this is either due to the controller difference between the 1.44 and the 1.3inch LCDs and or the library used and how it communicates with the controller.. Introducing more noise?

Either way, low-pass filter has solved my problems, I'm surprised I had the parts on hand lol.

Thank you very much!

Re: Audio noise w/ WaveShare 1.3 IPS HAT (SOLVED)

Posted: Sat Sep 15, 2018 8:36 pm
by Palmore
Another 15 hours in MSpaint and I present you the updated working diagram =) Thank you again
Audio Wiring.png
Audio Wiring.png (43.13 KiB) Viewed 8263 times