脉冲音频系统声音不工作,但卡与 alsa 兼容

脉冲音频系统声音不工作,但卡与 alsa 兼容

我为此绞尽了脑汁。我已经花了一天多的时间研究这个问题,关注了所有我能找到的文章。

历史:

我为锁定构建了一台新机器(仅 Ubuntu 20.04)。相当高端,但很标准。

  • 有源扬声器从后部线路输出端口和通用 USB 网络摄像头(用于 Zoom 会议,因为摄像头内置麦克风,所以很实用)运行。到目前为止一切正常,还算不错。
  • 网络摄像头麦克风质量很差,所以买了一个便宜的 USB 麦克风,质量也很差,但能用。
  • 决定使用我已有的心形麦克风。因此,我买了一个 Shure motiv mvi XLR 转 USB 设备。问题就从这里开始。无论我做什么(由于 Shure 有一个用于监听的耳机输出),Ubuntu 都会将其视为有效的接收器,并且由于是 USB,所以一直将其设置为默认输出。

我尝试了很多方法,最终找到了一个解决办法,那就是将下面的程序作为启动应用程序运行:

pactl set-default-sink pactl set-default-sink

(看起来很奇怪,但论坛推荐了它并且它确实有效。)几个月后,经过多次系统更新后,我发现我不再需要“启动应用程序”并将其禁用。

快进到昨天,我目前的问题出现了。我决定购买一个外部 DAC(Cambridge Audio Dacmagic Plus),现在我听不到任何系统声音、网络浏览器声音等。屏幕上settings > sounds正确列出了默认设备,但单击“测试”并按下扬声器按钮却没有声音。

运行后lsUSB,我就可以看到设备了。

运行后aplay -L,设备列表如下:

surround21
    2.1 Surround output to Front and Subwoofer speakers
surround40
    4.0 Surround output to Front and Rear speakers
surround41
    4.1 Surround output to Front, Rear and Subwoofer speakers
surround50
    5.0 Surround output to Front, Center and Rear speakers
surround51
    5.1 Surround output to Front, Center, Rear and Subwoofer speakers
surround71
    7.1 Surround output to Front, Center, Side, Rear and Woofer speakers
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
default
    Playback/recording through the PulseAudio sound server
sysdefault:CARD=C10
    Cambridge Audio USB Audio 1.0, USB Audio
    Default Audio Device
front:CARD=C10,DEV=0
    Cambridge Audio USB Audio 1.0, USB Audio
    Front speakers
surround21:CARD=C10,DEV=0
    Cambridge Audio USB Audio 1.0, USB Audio
    2.1 Surround output to Front and Subwoofer speakers
surround40:CARD=C10,DEV=0
    Cambridge Audio USB Audio 1.0, USB Audio
    4.0 Surround output to Front and Rear speakers
surround41:CARD=C10,DEV=0
    Cambridge Audio USB Audio 1.0, USB Audio
    4.1 Surround output to Front, Rear and Subwoofer speakers
surround50:CARD=C10,DEV=0
    Cambridge Audio USB Audio 1.0, USB Audio
    5.0 Surround output to Front, Center and Rear speakers
surround51:CARD=C10,DEV=0
    Cambridge Audio USB Audio 1.0, USB Audio
    5.1 Surround output to Front, Center, Rear and Subwoofer speakers
surround71:CARD=C10,DEV=0
    Cambridge Audio USB Audio 1.0, USB Audio
    7.1 Surround output to Front, Center, Side, Rear and Woofer speakers
iec958:CARD=C10,DEV=0
    Cambridge Audio USB Audio 1.0, USB Audio
    IEC958 (S/PDIF) Digital Audio Output
dmix:CARD=C10,DEV=0
    Cambridge Audio USB Audio 1.0, USB Audio
    Direct sample mixing device
dsnoop:CARD=C10,DEV=0
    Cambridge Audio USB Audio 1.0, USB Audio
    Direct sample snooping device
hw:CARD=C10,DEV=0
    Cambridge Audio USB Audio 1.0, USB Audio
    Direct hardware device without any conversions
plughw:CARD=C10,DEV=0
    Cambridge Audio USB Audio 1.0, USB Audio
    Hardware device with all software conversions
usbstream:CARD=C10
    Cambridge Audio USB Audio 1.0
    USB Stream Output
sysdefault:CARD=PCH
    HDA Intel PCH, ALC1220 Analog
    Default Audio Device
front:CARD=PCH,DEV=0
    HDA Intel PCH, ALC1220 Analog
    Front speakers
surround21:CARD=PCH,DEV=0
    HDA Intel PCH, ALC1220 Analog
    2.1 Surround output to Front and Subwoofer speakers
surround40:CARD=PCH,DEV=0
    HDA Intel PCH, ALC1220 Analog
    4.0 Surround output to Front and Rear speakers
surround41:CARD=PCH,DEV=0
    HDA Intel PCH, ALC1220 Analog
    4.1 Surround output to Front, Rear and Subwoofer speakers
surround50:CARD=PCH,DEV=0
    HDA Intel PCH, ALC1220 Analog
    5.0 Surround output to Front, Center and Rear speakers
surround51:CARD=PCH,DEV=0
    HDA Intel PCH, ALC1220 Analog
    5.1 Surround output to Front, Center, Rear and Subwoofer speakers
surround71:CARD=PCH,DEV=0
    HDA Intel PCH, ALC1220 Analog
    7.1 Surround output to Front, Center, Side, Rear and Woofer speakers
iec958:CARD=PCH,DEV=0
    HDA Intel PCH, ALC1220 Digital
    IEC958 (S/PDIF) Digital Audio Output
dmix:CARD=PCH,DEV=0
    HDA Intel PCH, ALC1220 Analog
    Direct sample mixing device
dmix:CARD=PCH,DEV=1
    HDA Intel PCH, ALC1220 Digital
    Direct sample mixing device
dsnoop:CARD=PCH,DEV=0
    HDA Intel PCH, ALC1220 Analog
    Direct sample snooping device
dsnoop:CARD=PCH,DEV=1
    HDA Intel PCH, ALC1220 Digital
    Direct sample snooping device
hw:CARD=PCH,DEV=0
    HDA Intel PCH, ALC1220 Analog
    Direct hardware device without any conversions
hw:CARD=PCH,DEV=1
    HDA Intel PCH, ALC1220 Digital
    Direct hardware device without any conversions
plughw:CARD=PCH,DEV=0
    HDA Intel PCH, ALC1220 Analog
    Hardware device with all software conversions
plughw:CARD=PCH,DEV=1
    HDA Intel PCH, ALC1220 Digital
    Hardware device with all software conversions
usbstream:CARD=PCH
    HDA Intel PCH
    USB Stream Output
hdmi:CARD=NVidia,DEV=0
    HDA NVidia, HDMI 0
    HDMI Audio Output
hdmi:CARD=NVidia,DEV=1
    HDA NVidia, HDMI 1
    HDMI Audio Output
hdmi:CARD=NVidia,DEV=2
    HDA NVidia, HDMI 2
    HDMI Audio Output
hdmi:CARD=NVidia,DEV=3
    HDA NVidia, HDMI 3
    HDMI Audio Output
dmix:CARD=NVidia,DEV=3
    HDA NVidia, HDMI 0
    Direct sample mixing device
dmix:CARD=NVidia,DEV=7
    HDA NVidia, HDMI 1
    Direct sample mixing device
dmix:CARD=NVidia,DEV=8
    HDA NVidia, HDMI 2
    Direct sample mixing device
dmix:CARD=NVidia,DEV=9
    HDA NVidia, HDMI 3
    Direct sample mixing device
dsnoop:CARD=NVidia,DEV=3
    HDA NVidia, HDMI 0
    Direct sample snooping device
dsnoop:CARD=NVidia,DEV=7
    HDA NVidia, HDMI 1
    Direct sample snooping device
dsnoop:CARD=NVidia,DEV=8
    HDA NVidia, HDMI 2
    Direct sample snooping device
dsnoop:CARD=NVidia,DEV=9
    HDA NVidia, HDMI 3
    Direct sample snooping device
hw:CARD=NVidia,DEV=3
    HDA NVidia, HDMI 0
    Direct hardware device without any conversions
hw:CARD=NVidia,DEV=7
    HDA NVidia, HDMI 1
    Direct hardware device without any conversions
hw:CARD=NVidia,DEV=8
    HDA NVidia, HDMI 2
    Direct hardware device without any conversions
hw:CARD=NVidia,DEV=9
    HDA NVidia, HDMI 3
    Direct hardware device without any conversions
plughw:CARD=NVidia,DEV=3
    HDA NVidia, HDMI 0
    Hardware device with all software conversions
plughw:CARD=NVidia,DEV=7
    HDA NVidia, HDMI 1
    Hardware device with all software conversions
plughw:CARD=NVidia,DEV=8
    HDA NVidia, HDMI 2
    Hardware device with all software conversions
plughw:CARD=NVidia,DEV=9
    HDA NVidia, HDMI 3
    Hardware device with all software conversions
usbstream:CARD=NVidia
    HDA NVidia
    USB Stream Output
sysdefault:CARD=MVi
    Shure MVi, USB Audio
    Default Audio Device
front:CARD=MVi,DEV=0
    Shure MVi, USB Audio
    Front speakers
surround21:CARD=MVi,DEV=0
    Shure MVi, USB Audio
    2.1 Surround output to Front and Subwoofer speakers
surround40:CARD=MVi,DEV=0
    Shure MVi, USB Audio
    4.0 Surround output to Front and Rear speakers
surround41:CARD=MVi,DEV=0
    Shure MVi, USB Audio
    4.1 Surround output to Front, Rear and Subwoofer speakers
surround50:CARD=MVi,DEV=0
    Shure MVi, USB Audio
    5.0 Surround output to Front, Center and Rear speakers
surround51:CARD=MVi,DEV=0
    Shure MVi, USB Audio
    5.1 Surround output to Front, Center, Rear and Subwoofer speakers
surround71:CARD=MVi,DEV=0
    Shure MVi, USB Audio
    7.1 Surround output to Front, Center, Side, Rear and Woofer speakers
iec958:CARD=MVi,DEV=0
    Shure MVi, USB Audio
    IEC958 (S/PDIF) Digital Audio Output
dmix:CARD=MVi,DEV=0
    Shure MVi, USB Audio
    Direct sample mixing device
dsnoop:CARD=MVi,DEV=0
    Shure MVi, USB Audio
    Direct sample snooping device
hw:CARD=MVi,DEV=0
    Shure MVi, USB Audio
    Direct hardware device without any conversions
plughw:CARD=MVi,DEV=0
    Shure MVi, USB Audio
    Hardware device with all software conversions
usbstream:CARD=MVi
    Shure MVi
    USB Stream Output
usbstream:CARD=Camera
    UVC Camera
    USB Stream Output
  • 运行aplay -D plughw:C10 /usr/share/sounds/alsa/Front_Center.wav并播放(C10 是 DAC 名称)
  • 运行speaker-test -c 2 -D plughw:C10时我依次从每个扬声器中听到声音。
  • 即使运行 zoom,如果我在设置中选择 DAC,一切都会运行正常
  • 但是运行speaker-test -c 2 -D defaultspeaker-test -c 2 -D pulse我得到:
speaker-test 1.2.2 

Playback device is default
Stream parameters are 48000Hz, S16_LE, 2 channels
Using 16 octaves of pink noise
Rate set to 48000Hz (requested 48000Hz)
Buffer size range from 96 to 1048576
Period size range from 32 to 349526
Using max buffer size 1048576
Periods = 4
ALSA lib pcm_pulse.c:752:(pulse_prepare) PulseAudio: Unable to create stream: No such entity 

Unable to set hw params for playback: Input/output error
Setting of hwparams failed: Input/output error

如果我跑步aplay -D default /usr/share/sounds/alsa/Front_Center.wav我会得到:

ALSA lib pcm_pulse.c:752:(pulse_prepare) PulseAudio: Unable to create stream: No such entity

aplay: set_params:1407: Unable to install hw params:
ACCESS:  RW_INTERLEAVED
FORMAT:  S16_LE
SUBFORMAT:  STD
SAMPLE_BITS: 16
FRAME_BITS: 16
CHANNELS: 1
RATE: 48000
PERIOD_TIME: 125000
PERIOD_SIZE: 6000
PERIOD_BYTES: 12000
PERIODS: 4
BUFFER_TIME: 500000
BUFFER_SIZE: 24000
BUFFER_BYTES: 48000
TICK_TIME: [0 0]
  • 我尝试过许多建议,例如重新安装、重新初始化pulseaudioalsa_base
  • 我根据各种主题和帖子单独对配置文件进行了大量调整。
  • 我已经检查pavucontrol并使用过alsamixer。各种“修复”使情况变得更糟并被恢复,但问题仍然存在。
  • 我已尝试多次重新启动脉冲守护进程,并且它启动时没有出现错误。

我知道这会是一件愚蠢而明显的事情。:)

非常感谢您的帮助。

答案1

我无法回答你的问题。不过,我以前也问过类似的问题,现在得到了答案。尝试使用https://paste.ubuntu.com/或类似服务,并提供指向终端输出的链接。我认为这些包含大量文字的问题往往会让人望而却步。

相关内容