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!

4 comments:

  1. This comment has been removed by a blog administrator.

    ReplyDelete
  2. This comment has been removed by a blog administrator.

    ReplyDelete
  3. This comment has been removed by a blog administrator.

    ReplyDelete
  4. This is the best content on your site. Very impressive. Based on the number of comments on your articles, I guess I'm not the only one having a good time here. Keep up the fantastic work. https://gab.com/engagedeals/posts/106233668157236021

    ReplyDelete