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

General discussion • Re: MAX98357A I2S audio not working on Raspberry Pi 5 with Debian Trixie (works on Bookworm)

$
0
0
I had a similar problem with a Pi Zero running trixie. I found the following worked. Based on the post here: viewtopic.php?t=392824#p2344061

There seem to two things are required:
  1. Modify /boot/firmware/config.txt
  2. Add/modify the /etc/asound.conf file

1. /boot/firmware/config.txt

Add the line:

Code:

dtoverlay=googlevoicehat-soundcard
Or:

Code:

dtoverlay=max98357a
I think I have tried both of those and they both worked.

Then comment out the line (this may not be required so you try without it first):

Code:

#dtparam=audio=on
2. /etc/asound.conf

Code:

pcm.sndrpigooglevoi {   type hw card 0}pcm.dmixer {   type dmix   ipc_key 1024   ipc_perm 0666   slave {     pcm "sndrpigooglevoi"     period_time 0     period_size 1024     buffer_size 8192     rate 44100     channels 2   }}ctl.dmixer {    type hw card 0}pcm.softvol {    type softvol    slave.pcm "dmixer"    control.name "PCM"    control.card 0}ctl.softvol {    type hw card 0}pcm.!default {    type             plug    slave.pcm       "softvol"}
Note In older versions of the OS sndrpigooglevoi used to be speakerbonnet

Then reboot and test:

Code:

speaker-test -c2 --test=wav -w /usr/share/sounds/alsa/Front_Center.wav
If you get an error like:

Code:

ALSA lib pcm_direct.c:1258:(snd1_pcm_direct_initialize_slave) requested or auto-format is not availableALSA lib pcm_dmix.c:1011:(snd_pcm_dmix_open) unable to initialize slave
Try using raspi-config: System settings > Audio > MAX98357A

To prevent clicks at start/end of playback, add a service in /etc/systemd/system/aplay.service:

Code:

[Unit]Description=Invoke aplay from /dev/zero at system start.[Service]ExecStart=/usr/bin/aplay -D default -t raw -r 44100 -c 2 -f S16_LE /dev/zero[Install]WantedBy=multi-user.target
Then start it:

Code:

sudo systemctl enable --now aplay

Statistics: Posted by JamesRandom — Thu Jan 15, 2026 8:57 pm



Viewing all articles
Browse latest Browse all 8041

Trending Articles