Showing posts with label PyGame. Show all posts
Showing posts with label PyGame. Show all posts

Tuesday, 24 May 2016

Fixing Alsa errors on the Raspberry Pi in Raspbian

So, I tried to run a pygame scrip I was developing on a newly installed Raspbian Jessie install, and got the following error:

ALSA lib confmisc.c:768:(parse_card) cannot find card '0'
ALSA lib conf.c:4259:(_snd_config_evaluate) function snd_func_card_driver returned error: No such file or directory
ALSA lib confmisc.c:392:(snd_func_concat) error evaluating strings
ALSA lib conf.c:4259:(_snd_config_evaluate) function snd_func_concat returned error: No such file or directory
ALSA lib confmisc.c:1251:(snd_func_refer) error evaluating name
ALSA lib conf.c:4259:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:4738:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM default

After a bit of digginge around the web, I finally found a fix that worked.

  1. Edit /etc/modules and add an "snd_bcm2835" on a new line.
  2. Edit /boot/config.txt and add an entry "dtparam=audio=on" on a new line.
  3. Reboot
  4. Run:
    sudo modprobe snd_bcm2835
  5. Job done!