我需要在安装了默认 ubuntu 16.04 的 amazon ec2 实例中使用需要声卡的应用程序。问题是没有可用的声卡。我已经在谷歌上尝试了所有关于如何创建虚拟声卡的方法,所以程序运行没有问题,但没有任何帮助,因为它已经过时了。这是 lspci
返回的内容:
00:00.0 Host bridge: Intel Corporation 440FX - 82441FX PMC [Natoma] (rev 02)
00:01.0 ISA bridge: Intel Corporation 82371SB PIIX3 ISA [Natoma/Triton II]
00:01.1 IDE interface: Intel Corporation 82371SB PIIX3 IDE [Natoma/Triton II]
00:01.3 Bridge: Intel Corporation 82371AB/EB/MB PIIX4 ACPI (rev 01)
00:02.0 VGA compatible controller: Cirrus Logic GD 5446
00:03.0 Unassigned class [ff80]: XenSource, Inc. Xen Platform Device (rev 01)
lsmod | grep snd 不返回任何东西,这让我觉得我可能会丢失所有模块,而不仅仅是 snd-dummy
。
我一直在尝试使用返回以下错误的命令 sudo modprobe snd-dummy
来设置虚拟机:
modprobe: FATAL: Module snd-dummy not found in directory /lib/modules/4.4.0-1013-aws
有什么线索吗?
最佳答案
如果还有人遇到同样的问题:
您可能正在使用 AMI,该 AMI 的内核编译时未使用 snd-dummy
模块。 ALSA wiki建议从源代码 (alsa-driver
) 构建此模块,但这已过时。
我能够通过安装 pulseaudio 在 EC2 上运行需要声卡的应用程序
sudo apt install pulseaudio
pulseaudio --start
之后我得到:
$ aplay test.wav
Playing WAVE 'test.wav' : Unsigned 8 bit, Rate 22257 Hz, Mono
并且需要声卡的应用程序运行正常。如果这对您来说还不够,您可能需要启用默认接收器:
pactl load-module module-null-sink sink_name=auto_null
pactl set-default-sink auto_null
此处有更多详细信息 Linux application fails with "Invalid CTL" and "Unknown PCM"
关于linux - 用于 Amazon Linux 服务器的虚拟声卡,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44032488/