aplayとpaplayは決して完了しない

aplayとpaplayは決して完了しない

問題: Linuxのサウンドテスト用コマンドラインアプリケーションのいずれかを実行すると、遊びまたはパプレイ音は出ませんが、エラーも発生せず、プログラムは終了しません。

質問: なぜ彼らは退出しないのですか?

元の質問文は以下のとおりです

どちらかでwavファイルを再生しようとしています遊びまたはパプレイコマンドがハングアップし、強制終了することになります。どちらのアプリケーションからもエラーは報告されず、syslogにも何も表示されません。

これはVirtualBoxで実行されているLubuntuです。

1年前にも同様の問題がありましたが、

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 メーターは動きません。

speaker-test -c 2 -t wav はハングしませんが、音は出ません。

Firefox 経由の YouTube は、2 ~ 3 秒しか再生されず、その後は再生されなくなり、音も聞こえなくなります。

編集 - 提案されたより技術的な情報https://alsa.opensrc.org/トラブルシューティング

$ 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 の既知のバグであり、ほぼ 1 年前から存在しています。

要約: 100msに設定する必要があるタイミング値があります。VMをシャットダウンして実行します。

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

https://www.virtualbox.org/ticket/18342

https://www.virtualbox.org/ticket/18820

関連情報