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 미터는 움직이지 않습니다.

스피커 테스트 -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의 알려진 버그이며 거의 1년 동안 지속되었습니다.

tldr; 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

관련 정보