我遇到了完全相同的问题;我在 Ubuntu 11.04 Natty 上。我禁用了pulseaudio 启动(例如10.10 - How can I replace pulseaudio with alsa? - Ask Ubuntu 或PulseAudio - ArchWiki):
$ cat /etc/pulse/client.conf | grep -ve '^#\|^$'
; default-sink =
; default-source =
; default-server =
autospawn = no
; daemon-binary = /usr/bin/pulseaudio
; extra-arguments = --log-target=syslog
; cookie-file =
; enable-shm = yes
; shm-size-bytes = 0 # setting this 0 will use the system-default, usually 64 MiB
$ pgrep pulse
$
在这种情况下,我会得到:
$ aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: Intel [HDA Intel], device 0: ALC269 Analog [ALC269 Analog]
Subdevices: 1/1
Subdevice #0: subdevice #0
$ aplay -L
null
Discard all samples (playback) or generate zero samples (capture)
default:CARD=Intel
HDA Intel, ALC269 Analog
Default Audio Device
front:CARD=Intel,DEV=0
HDA Intel, ALC269 Analog
Front speakers
...
hw:CARD=Intel,DEV=0
HDA Intel, ALC269 Analog
Direct hardware device without any conversions
plughw:CARD=Intel,DEV=0
HDA Intel, ALC269 Analog
Hardware device with all software conversions
...
...但是,即使我明确指定了设备hw0:0,它也应该直接通过 ALSA 在设备上播放样本,绕过任何服务器:
aplay -f cd -v -Dhw:0,0 --test-position loop_s16_stereo.wav
...
BUFPOS: avg5507/16508 min0/0 max22016/22016 (22016) (0:0/0)
BUFPOS: avg2754/19261 min0/0 max22016/22016 (22016) (0:0/0)
... 我什至会看到设备设置 - 和缓冲区位置正在更改 - 仍然没有声音?甚至alsamixer 也显示所有控件都设置为最大值!
好吧,只是偶然,我首先启用了pulseaudio:
pulseaudio --start
... 大约一分钟的启动完成后,然后启动 System / Preferences / Sound,或者在这里:
gnome-volume-control
...我意识到,就在“输出音量”栏旁边,有一个“静音”复选框 - 它已被选中!所以我取消选中它,声音测试开始工作;关闭gnome-volume-control,然后再次关闭pulseaudio:
pulseaudio --kill
现在,我无法再启动 gnome-volume-control(不管 10.10 - How do I adjust the volume without pulseaudio? - Ask Ubuntu 中的提示如何 - 显然早期版本允许通过“设备”下拉菜单选择后端:old.png,但较新版本不要: new.png;因此如果没有pulseaudio,它们将始终以“等待音响系统响应”而失败)。
但是,现在当我运行 aplay 命令时 - 它会播放(按原样播放)!
这个静音显然与gconf-editor 中/desktop/gnome/sound/ 路径下的一个键有关(请参阅gnome - How to disable Alert volume from the command line? - Ask Ubuntu),但我不知道是哪一个;我只是注意到,目前,enable_esd、event_sounds 和 input_feedback_sounds 都为我检查 - 这显然使 aplay 命令正常工作,即使没有 pulseaudio。
希望这对某人有所帮助,
干杯!