Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 4455

Compute Module • PWM Audio on CM4?

$
0
0
Hi,

I'm trying to get PWM Audio working on a CM4. I'm using a baseboard from Waveshare (https://www.waveshare.com/cm4-dual-eth-4g-5g-base.htm) which exposes the 40 pin IO connector.

I have built a simple filter circuit and it's working great on a regular Pi 4. I configured the /boot/firmware/config.txt as follows:

Code:

dtoverlay=pwm-2chan,pin=18,func=2,pin2=13,func2=4
(I have the PWM input to my audio circuit connected to GPIO18 & GPIO13 / pins 12 and 33 respectively).

However, I'm not getting any luck on the CM4.

This is what I've tried adding to the config.txt so far

Code:

dtoverlay=pwm-2chan,pin=18,func=2,pin2=13,func2=4
When I do this and run speakertest, I get an error there are no soundcards available. If I plug in the HDMI, then the sound plays fine through that.

Here's the output of aplay -l
pi@raspberrypi:~ $ aplay -l
aplay: device_list:274: no soundcards found...

I tried adding this from another forum and this seems to add a soundcard

Code:

dtoverlay=audremap,pins_18_13
Output of aplay -l :
**** List of PLAYBACK Hardware Devices ****
card 0: Headphones [bcm2835 Headphones], device 0: bcm2835 Headphones [bcm2835 Headphones]
Subdevices: 8/8
Subdevice #0: subdevice #0
Subdevice #1: subdevice #1
Subdevice #2: subdevice #2
Subdevice #3: subdevice #3
Subdevice #4: subdevice #4
Subdevice #5: subdevice #5
Subdevice #6: subdevice #6
Subdevice #7: subdevice #7
Still, I can't get audio to work.

I tried a few other suggested diagnostics which leads me to believe there is something wrong with the config.txt file, or perhaps PWM can only be used on other pins on the CM4?

pi@raspberrypi:~ $ dtoverlay -l
No overlays loaded


Appreciate any pointers with this one

Thank you

PS: I also have had major issues with off the shelf Pi audio hats as well - I've tried 2 so far on the CM4 and they simply don't get detected. However they work fine on a regular Pi4. I2C also didn't work out of the box and required additional lines in config.txt which I've now fixed. I'm sure I'm missing something simple with the PWM audio.

Statistics: Posted by tom82 — Sat Jan 11, 2025 10:34 am — Replies 0 — Views 45



Viewing all articles
Browse latest Browse all 4455

Trending Articles