
問題:運行任一主要 Linux 聲音測試命令列應用程式阿普拉或者帕普萊結果沒有聲音,但也沒有錯誤,程式不會退出。
問題:為什麼他們不退出?
原始問題文字如下
嘗試使用以下任一方式播放 wav 文件阿普拉或者帕普萊結果導致命令掛起並不得不被殺死。兩個應用程式均未報告任何錯誤,系統日誌中也未顯示任何內容
這是在 VirtualBox 中運行的 Lubuntu。
一年前我遇到了類似的問題,並透過運行解決了這個問題
pulseaudio -k && sudo alsa force-reload
但 alsa 強制重新載入現在總是失敗。
Unloading ALSA sound driver modules: snd-seq-midi snd-seq-midi-event snd-seq snd-rawmidi snd-seq-device snd-hda-codec-idt snd-hda-codec-generic snd-hda-intel snd-hda-codec snd-hda-core snd-hwdep snd-pcm snd-timer (failed: modules still loaded: snd-hda-codec-idt snd-hda-codec-generic snd-hda-codec snd-hda-core snd-hwdep snd-pcm snd-timer).
Loading ALSA sound driver modules: snd-seq-midi snd-seq-midi-event snd-seq snd-rawmidi snd-seq-device snd-hda-codec-idt snd-hda-codec-generic snd-hda-intel snd-hda-codec snd-hda-core snd-hwdep snd-pcm snd-timer.
卸載並重新安裝pulseaudio和alsa。
我真正想要的是確鑿無疑的證據。指示出了什麼問題的錯誤訊息。
aplay -L 和任何pulseaudio資訊實用程式都正確顯示intel HD(在VirtualBox中更改為AC97有相同的問題)
pavucontrol 將顯示應用程式嘗試播放聲音,但 VU 計不會移動。
peaker-test -c 2 -t wav 不會掛起,但不會發出聲音。
透過 Firefox 的 YouTube 只會播放 2-3 秒,然後拒絕繼續播放並且聽不到任何聲音。
編輯 - 根據建議的更多技術信息https://alsa.opensrc.org/TroubleShooting
$ cat /proc/asound/version
Advanced Linux Sound Architecture Driver Version k4.15.0-70-generic.
$ grep VERSION_STR /usr/include/alsa/version.h
#define SND_LIB_VERSION_STR "1.1.3"
$ lspci | egrep -i audio
00:05.0 Audio device: Intel Corporation 82801FB/FBM/FR/FW/FRW (ICH6 Family) High Definition Audio Controller (rev 01)
$ ls /proc/asound/cards
/proc/asound/cards
$ ls -l /proc/asound/cards
-r--r--r-- 1 root root 0 Nov 24 16:49 /proc/asound/cards
$ cat /proc/asound/cards
0 [Intel ]: HDA-Intel - HDA Intel
HDA Intel at 0xf0804000 irq 21
$ ls /dev/snd/
by-path controlC0 hwC0D0 pcmC0D0c pcmC0D0p pcmC0D1c pcmC0D1p pcmC0D2c seq timer
$ file /usr/share/alsa/alsa.conf
/usr/share/alsa/alsa.conf: ASCII text
$ lsmod | egrep snd
snd_hda_codec_idt 57344 1
snd_hda_codec_generic 73728 1 snd_hda_codec_idt
snd_hda_intel 45056 5
snd_hda_codec 126976 3 snd_hda_codec_generic,snd_hda_intel,snd_hda_codec_idt
snd_hda_core 81920 4 snd_hda_codec_generic,snd_hda_intel,snd_hda_codec,snd_hda_codec_idt
snd_hwdep 20480 1 snd_hda_codec
snd_pcm 98304 4 snd_hda_intel,snd_hda_codec,snd_hda_core
snd_seq_midi 16384 0
snd_seq_midi_event 16384 1 snd_seq_midi
snd_rawmidi 32768 1 snd_seq_midi
snd_seq 65536 2 snd_seq_midi,snd_seq_midi_event
snd_seq_device 16384 3 snd_seq,snd_seq_midi,snd_rawmidi
snd_timer 32768 3 snd_seq,snd_pcm
snd 81920 18 snd_hda_codec_generic,snd_seq,snd_seq_device,snd_hwdep,snd_hda_intel,snd_hda_codec,snd_timer,snd_pcm,snd_hda_codec_idt,snd_rawmidi
soundcore 16384 1 snd
$ dmesg | egrep snd
[ 3.920091] snd_hda_codec_idt hdaudioC0D0: autoconfig for STAC9221 A1: line_outs=3 (0xc/0xf/0xb/0x0/0x0) type:speaker
[ 3.920093] snd_hda_codec_idt hdaudioC0D0: speaker_outs=0 (0x0/0x0/0x0/0x0/0x0)
[ 3.920094] snd_hda_codec_idt hdaudioC0D0: hp_outs=1 (0xa/0x0/0x0/0x0/0x0)
[ 3.920094] snd_hda_codec_idt hdaudioC0D0: mono: mono_out=0x0
[ 3.920095] snd_hda_codec_idt hdaudioC0D0: dig-out=0x10/0x0
[ 3.920095] snd_hda_codec_idt hdaudioC0D0: inputs:
[ 3.920096] snd_hda_codec_idt hdaudioC0D0: Mic=0xd
[ 3.920097] snd_hda_codec_idt hdaudioC0D0: Line=0xe
[ 3.920097] snd_hda_codec_idt hdaudioC0D0: CD=0x15
[ 3.920098] snd_hda_codec_idt hdaudioC0D0: dig-in=0x11
[ 13.864016] snd_hda_intel 0000:00:05.0: Invalid position buffer, using LPIB read method instead.
$ dmesg | egrep -i sound
[ 3.944086] input: HDA Intel Mic as /devices/pci0000:00/0000:00:05.0/sound/card0/input8
[ 3.944115] input: HDA Intel Line as /devices/pci0000:00/0000:00:05.0/sound/card0/input9
[ 3.944139] input: HDA Intel Speaker Front as /devices/pci0000:00/0000:00:05.0/sound/card0/input10
[ 3.944256] input: HDA Intel Speaker CLFE as /devices/pci0000:00/0000:00:05.0/sound/card0/input11
[ 3.944280] input: HDA Intel Front Headphone as /devices/pci0000:00/0000:00:05.0/sound/card0/input12
[ 3.944302] input: HDA Intel SPDIF In as /devices/pci0000:00/0000:00:05.0/sound/card0/input13
答案1
我不太相信這一點,但這是 VirtualBox 中的一個已知錯誤,並且已經存在了近一年了。
太棒了; 有一個定時值需要設定為100ms。關閉您的虛擬機器並運行
VBoxManage setextradata global VBoxInternal2/Audio/ALSAAudio/BufferSizeMs "100"
您也可以嘗試還原到 VirtualBox 的早期版本,其中該值是預設值。
由於我剛剛從頭開始建立了一個新的主機系統,並且主機系統在任何其他有聲音的應用程式中都沒有問題,因此 VirtualBox 不可能是問題,主機也不可能是問題。
這個問題目前正在以下地方討論
https://forums.gentoo.org/viewtopic-t-1104042-highlight-virtualbox.html
https://forums.virtualbox.org/viewtopic.php?f=7&t=95560
https://forums.virtualbox.org/viewtopic.php?f=7&t=93940