我刚刚通过网络启动安装了 Ubuntu 20.04 LTS迷你iso使用默认设置进入全新的 VirtualBox 6.1 VM:
- 主机音频驱动程序:PulseAudio
- 音频控制器:ICH AC97
为了安装声音相关的应用程序,我通过 SSH 在客户机上运行了以下命令:
sudo apt install pulseaudio alsa-base alsa-utils vlc --no-install-recommends
作为起点,我想听到以下命令的声音:
aplay /usr/share/sounds/alsa/Noise.wav
cvlc /usr/share/sounds/alsa/Noise.wav
但目前它们没有发出声音。
一些额外的信息:
$ lspci -k | grep -i audio -A2
00:05.0 Multimedia audio controller: Intel Corporation 82801AA AC'97 Audio Controller (rev 01)
Subsystem: Dell 82801AA AC'97 Audio Controller
Kernel driver in use: snd_intel8x0
Kernel modules: snd_intel8x0
$ lsmod | grep snd
snd_intel8x0 45056 0
snd_ac97_codec 131072 1 snd_intel8x0
ac97_bus 16384 1 snd_ac97_codec
snd_pcm 106496 2 snd_intel8x0,snd_ac97_codec
snd_seq_midi 20480 0
snd_seq_midi_event 16384 1 snd_seq_midi
snd_rawmidi 36864 1 snd_seq_midi
snd_seq 69632 2 snd_seq_midi,snd_seq_midi_event
snd_seq_device 16384 3 snd_seq,snd_seq_midi,snd_rawmidi
snd_timer 36864 2 snd_seq,snd_pcm
snd 90112 7 snd_seq,snd_seq_device,snd_intel8x0,snd_timer,snd_ac97_codec,snd_pcm,snd_rawmidi
soundcore 16384 1 snd
$ aplay -l
aplay: device_list:276: no soundcards found...
$ aplay -L
default
Playback/recording through the PulseAudio sound server
null
Discard all samples (playback) or generate zero samples (capture)
samplerate
Rate Converter Plugin Using Samplerate Library
speexrate
Rate Converter Plugin Using Speex Resampler
jack
JACK Audio Connection Kit
oss
Open Sound System
pulse
PulseAudio Sound Server
upmix
Plugin for channel upmix (4,6,8)
vdownmix
Plugin for channel downmix (stereo) with a simple spacialization
$ alsamixer
cannot open mixer: No such file or directory
$ aplay /usr/share/sounds/alsa/Noise.wav
Playing WAVE '/usr/share/sounds/alsa/Noise.wav' : Signed 16 bit Little Endian, Rate 48000 Hz, Mono
答案1
令人惊讶的是,真正的解决方案是将我的用户添加到声音的按执行分组
sudo usermod -a -G audio $USER
本地用户不需要这个,但 SSH 用户需要。
答案2
我不得不
sudo apt install linux-modules-extra-`uname -r`
sudo reboot
..我在尝试手动加载适当的驱动程序后发现了这一点:
$ sudo modprobe snd-intel8x0
modprobe: FATAL: Module snd-intel8x0 not found in directory /lib/modules/5.4.0-97-generic