1

I've connected a USB speaker to my Raspberry Pi Zero, and modified /boot/config.txt to set dtparam=audio=off. Running speaker-test now sends test audio to the speaker.

But, when I attempt to run a game in mame4all, I get this error:

ALSA lib pcm.c:7935:(snd_pcm_set_params) Rate doesn't match (requested 44100Hz, get 48000Hz)

Any ideas?

1

I had the same problem after connecting a USB sound card to RetroPie using mame4all on a Raspberry Pi 3. Here's what I did to fix:

1) Create a /etc/asound.conf file with the following contents:

ctl.!default {
type hw
card 0
}
pcm.usb {
type hw
card "U012529205"
format S16_LE
}

pcm.!default {
type asym
playback.pcm {
type plug
slave {
pcm "hw:0"
format S16_LE
}
}
capture.pcm
{
type plug
slave.pcm "usb"
}
}

2) Create a /etc/modprobe.d/alsa-base.conf file with the following contents:

   options snd_usb_audio index=0
   options snd_bcm2835 index=1
   options snd slots=snd-usb-audio,snd-bcm2835

3) In /boot/config.txt, make sure the following lines appear somewhere:

  dtparam=audio=off
  disable_audio_dither=1

4) Last but not least, run your games in 640x480 mode!

Do this by hitting 'Enter' after starting a game from the RetroPie menu, which brings up a menu of options. Select a default video mode of 640x480 for mame4all. You only need to do this one time.

For me, using the USB sound card was done in an attempt to get rid of a bunch of pops and clicks I was getting (had heard this was a common problem, and using USB card would fix it). But ultimately, I don't think using the USB sound card is absolutely necessary. I was able to use the RPi3's sound output port cleanly simply by running in 640x480 mode, plus putting the disable_audio_dither=1 line in /boot/config.txt. But I do have a USB card and am using it, and like it.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.