解决音频问题 - 声卡问题

解决音频问题 - 声卡问题

我刚刚使用此图像启动了树莓派:ubuntu-16.04.3-preinstalled-server-armhf+raspi2.img 似乎声卡未被检测到或配置为“开箱即用”

root@ubuntu:/home/ubuntu# cat /proc/asound/cards 
--- no soundcards ---

我对内核模块或用于加载/删除它们的工具没有太多经验。但我确实了解到树莓派声卡的模块没有加载,所以我尝试了:

root@ubuntu:/home/ubuntu# modprobe snd_bcm2835

似乎加载正常:

root@ubuntu:/home/ubuntu# lsmod |grep snd
snd_bcm2835            32768  0
snd_pcm               106496  1 snd_bcm2835
snd_timer              32768  1 snd_pcm
snd                    81920  3 snd_bcm2835,snd_timer,snd_pcm
soundcore              16384  1 snd

我也确认alsa-utils已安装。但我仍然无法播放声音,并且仍然从这些命令中得到以下结果:

root@ubuntu:/home/ubuntu# cat /proc/asound/cards 
--- no soundcards ---

-

root@ubuntu:/home/ubuntu# aplay -L
null
    Discard all samples (playback) or generate zero samples (capture)

-

root@ubuntu:/home/ubuntu# play nice.ambient.mp3
ALSA lib confmisc.c:768:(parse_card) cannot find card '0'
ALSA lib conf.c:4292:(_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:4292:(_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:4292:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:4771:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2266:(snd_pcm_open_noupdate) Unknown PCM default
play FAIL formats: can't open output file `default': snd_pcm_open error: No such file or directory

确保声卡适用于该映像并从启动开始工作的正确步骤是什么?

相关内容