PulseAudio:“module-alsa-sink”无法通过“module-udev-detect”自动加载

PulseAudio:“module-alsa-sink”无法通过“module-udev-detect”自动加载

简而言之,在我的计算机上,

  1. 显示卡片配置文件Analog Stereo Output(来自和 PulseAudio 音量控制 GUI)Analog Stereo Duplexavailable: nopactl list cards
  2. 当我启动 Ubuntu 20.04 时,声音输出只有一个虚拟输出选项。也是如此pactl list sinks(详见下文)。
  3. pactl load-module module-detect我可以通过或进行脏修复pactl load-module module-alsa-sink。换句话说,一旦我运行其中任何一个,我就会得到 所示的接收器pactl list sinks
  4. 即使我做了 3,卡配置文件仍然不可用。
  5. 不知道是不是驱动问题,手动修复后声音有时候还是不稳定,每次打开声音相关的应用都会听到“bzzz”。

我的 Intel NUC10i7107FNH 中只有板载声卡。而且我只使用插入的耳机插孔。

所以我的问题是为什么会发生这种情况?看来我的硬件和驱动程序没有问题。

为什么module-udev-detect不做它的工作(根据PulseAudio文档module-udev-detect是处理所有事情的主要方法,而不是module-detect,我们不应该手动调用module-alsa-sinks)。如何修复它?

Linux 版本

请注意,这是 Ubuntu 20.04 Desktop 的全新安装。ALSA 和 PulseAudio 的所有配置均处于默认状态。

5.8.0-43-generic #49~20.04.1-Ubuntu SMP Fri Feb 5 09:57:56 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux

声卡信息和编解码器

$ cat /proc/asound/cards
 0 [PCH            ]: HDA-Intel - HDA Intel PCH
                      HDA Intel PCH at 0x6023110000 irq 178
$ cat /proc/asound/card0/codec\#0 | grep Codec
Codec: Realtek ALC256

列出模块

$ lsmod | grep snd_hda_intel
snd_hda_intel          53248  2
snd_intel_dspcfg       24576  3 snd_hda_intel,snd_sof_pci,snd_sof_intel_hda_common
snd_hda_codec         139264  5 snd_hda_codec_generic,snd_hda_codec_hdmi,snd_hda_intel,snd_hda_codec_realtek,snd_soc_hdac_hda
snd_hda_core           94208  9 snd_hda_codec_generic,snd_hda_codec_hdmi,snd_hda_intel,snd_hda_ext_core,snd_hda_codec,snd_hda_codec_realtek,snd_sof_intel_hda_common,snd_soc_hdac_hda,snd_sof_intel_hda
snd_pcm               114688  9 snd_hda_codec_hdmi,snd_hda_intel,snd_hda_codec,snd_sof,snd_sof_intel_hda_common,snd_compress,snd_soc_core,snd_hda_core,snd_pcm_dmaengine
snd                    94208  17 snd_hda_codec_generic,snd_seq,snd_seq_device,snd_hda_codec_hdmi,snd_hwdep,snd_hda_intel,snd_hda_codec,snd_hda_codec_realtek,snd_timer,snd_compress,snd_soc_core,snd_pcm,snd_rawmidi

输出自pactl list cards

>>= pactl list cards
Card #0
    Name: alsa_card.pci-0000_00_1f.3
    Driver: module-alsa-card.c
    Owner Module: 7
    Properties:
        alsa.card = "0"
        alsa.card_name = "HDA Intel PCH"
        alsa.long_card_name = "HDA Intel PCH at 0x6023110000 irq 178"
        alsa.driver_name = "snd_hda_intel"
        device.bus_path = "pci-0000:00:1f.3"
        sysfs.path = "/devices/pci0000:00/0000:00:1f.3/sound/card0"
        device.bus = "pci"
        device.vendor.id = "8086"
        device.vendor.name = "Intel Corporation"
        device.product.id = "02c8"
        device.form_factor = "internal"
        device.string = "0"
        device.description = "Built-in Audio"
        module-udev-detect.discovered = "1"
        device.icon_name = "audio-card-pci"
    Profiles:
        input:analog-stereo: Analog Stereo Input (sinks: 0, sources: 1, priority: 65, available: yes)
        output:analog-stereo: Analog Stereo Output (sinks: 1, sources: 0, priority: 6500, available: no)
        output:analog-stereo+input:analog-stereo: Analog Stereo Duplex (sinks: 1, sources: 1, priority: 6565, available: no)
...
...
...

输出自pactl list sinks

$ pactl list sinks                                 
Sink #0
    State: SUSPENDED
    Name: auto_null
    Description: Dummy Output
    Driver: module-null-sink.c
    Sample Specification: s16le 2ch 44100Hz
    Channel Map: front-left,front-right
    Owner Module: 14
    Mute: no
    Volume: front-left: 11097 /  17% / -46.28 dB,   front-right: 11097 /  17% / -46.28 dB
            balance 0.00
    Base Volume: 65536 / 100% / 0.00 dB
    Monitor Source: auto_null.monitor
    Latency: 0 usec, configured 0 usec
    Flags: DECIBEL_VOLUME LATENCY SET_FORMATS 
    Properties:
        device.description = "Dummy Output"
        device.class = "abstract"
        device.icon_name = "audio-card"
    Formats:
        pcm

尝试修复:

$ pactl load-module module-alsa-sink 
24

$ pactl list sinks                  
Sink #1
    State: IDLE
    Name: alsa_output.default
    Description: Built-in Audio
    Driver: module-alsa-sink.c
    Sample Specification: s32le 2ch 48000Hz
    Channel Map: front-left,front-right
    Owner Module: 24
    Mute: no
    Volume: front-left: 45876 /  70% / -9.29 dB,   front-right: 45876 /  70% / -9.29 dB
            balance 0.00
    Base Volume: 65536 / 100% / 0.00 dB
    Monitor Source: alsa_output.default.monitor
    Latency: 242825 usec, configured 341333 usec
    Flags: HARDWARE DECIBEL_VOLUME LATENCY 
    Properties:
        alsa.resolution_bits = "32"
        device.api = "alsa"
        device.class = "sound"
        alsa.class = "generic"
        alsa.subclass = "generic-mix"
        alsa.name = "ALC256 Analog"
        alsa.id = "ALC256 Analog"
        alsa.subdevice = "0"
        alsa.subdevice_name = "subdevice #0"
        alsa.device = "0"
        alsa.card = "0"
        alsa.card_name = "HDA Intel PCH"
        alsa.long_card_name = "HDA Intel PCH at 0x6023110000 irq 178"
        alsa.driver_name = "snd_hda_intel"
        device.bus_path = "pci-0000:00:1f.3"
        sysfs.path = "/devices/pci0000:00/0000:00:1f.3/sound/card0"
        device.bus = "pci"
        device.vendor.id = "8086"
        device.vendor.name = "Intel Corporation"
        device.product.id = "02c8"
        device.form_factor = "internal"
        device.string = "default"
        device.buffering.buffer_size = "131072"
        device.buffering.fragment_size = "8192"
        device.access_mode = "mmap+timer"
        device.description = "Built-in Audio"
        device.icon_name = "audio-card-pci"
    Formats:
        pcm

相关内容