Using PWM sound with DPI display

Having trouble with your GBZ build? Ask your questions here!
Post Reply
pbharrell
Posts: 9
Joined: Mon Sep 03, 2018 10:38 am
Has thanked: 2 times
Been thanked: 2 times

Using PWM sound with DPI display

Post by pbharrell » Thu Aug 20, 2020 10:50 pm

Hello Gamboy Zero community,

I have been building a pi zero build using TinkerBOY's DPI adapter (https://www.tinkerboy.xyz/product/tinke ... i-adapter/) and control board version 2.0.1 (https://www.tinkerboy.xyz/product/game- ... oy-zero-3/) with a Pro Micro to handle button inputs. Everything was going smoothly, except for when I got to audio. I used TinkerBOY's image of retropie that is pre-configured for most things (https://www.tinkerboy.xyz/retropie-imag ... s-and-dpi/). The only audio that came out of the speaker was a buzzing without any system audio. Upon closer inspection I found that the buzzing changed depending on the image on screen. After a reference to this chart: https://elinux.org/RPi_BCM2835_GPIOs I'm new to this, but it seems to me that all the possible PWM audio pins are occupied by the DPI display.

Is there some sort of workaround so that I can have the DPI display and audio while the USB port is taken up by the Pro Micro?

pbharrell
Posts: 9
Joined: Mon Sep 03, 2018 10:38 am
Has thanked: 2 times
Been thanked: 2 times

Re: Using PWM sound with DPI display

Post by pbharrell » Fri Aug 21, 2020 11:47 am

Okay, so after getting some sleep I realize now that I missed that GPIO pin 18 is still left open, so I can use the PWM capabilities of that pin. Only problem is, I cannot seem to get it to enable. I followed uncommented and slightly modified the config.txt file to add the lines needed to enable PWM audio on pin 18. The pin acts as if it's disabled and the speaker does not even make any hissing sound. When I go to change audio settings, I get the message: "VolumeControl::init() - failed to attach to default card!" along with a couple other messages that indicate that it does not detect any audio device. Does anybody know why this might be happening?

pbharrell
Posts: 9
Joined: Mon Sep 03, 2018 10:38 am
Has thanked: 2 times
Been thanked: 2 times

Re: Using PWM sound with DPI display

Post by pbharrell » Tue Aug 25, 2020 2:28 pm

After lots of testing, I figured out that the issue was software.

So, I found a forum post somewhere mentioning that retrogame might've been interfering with their PWM audio. I was using TinkerBOY's image, with the config file for DPI display, the DPI overlay file and retrogame pre-installed. I didn't need retrogame, as I was using a pro micro for button inputs. I reinstalled retropie and added what I needed for the DPI display without installing retrogame. After putting the lines "dtparam=audio=on", "dtoverlay=pwm,pin=18,func=2", and "hdmi_ignore_edid_audio=1" in the config.txt file, audio worked both through the speaker and headphone jack.

TL;DR: TinkerBOY's retrogame image on his website had retrogame installed and that interfered with the audio. A fresh install without retrogame solved the problem.

I hope anybody with a similar issue will see this post and save the lots of time it takes to address it. If it's not hardware related, it might be retrogame.

Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 1 guest