树莓派容器中aplay没有声音的解决方案
>>> docker run -v /dev:/dev --priviledged ...进去后安装alsa-utils才能使用aplay>>> aplay -f cd -c 1 -r 16000 demo.pcm但发现并没有声音但确实可以获取到声卡>>> aplay -l**** List of PLAYBACK Hardware Devic
·
>>> docker run -v /dev:/dev --privileged ...
进去后安装alsa-utils才能使用aplay
>>> aplay -f cd -c 1 -r 16000 demo.pcm
但发现并没有声音
但确实可以获取到声卡
>>> aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: b1 [bcm2835 HDMI 1], device 0: bcm2835 HDMI 1 [bcm2835 HDMI 1]
Subdevices: 4/4
Subdevice #0: subdevice #0
Subdevice #1: subdevice #1
Subdevice #2: subdevice #2
Subdevice #3: subdevice #3
card 1: Headphones [bcm2835 Headphones], device 0: bcm2835 Headphones [bcm2835 Headphones]
Subdevices: 4/4
Subdevice #0: subdevice #0
Subdevice #1: subdevice #1
Subdevice #2: subdevice #2
Subdevice #3: subdevice #3
这是由于默认的声卡选择错了,所以需要用配置文件选择一下默认声卡
>>> vim /etc/asound.conf
pcm.!default {
type hw
card 1
}
ctl.!default {
type hw
card 1
}
更多推荐
已为社区贡献4条内容
所有评论(0)