如何让“模拟立体声”和“数字立体声 (HDMI)”同时显示在 PulseAudio 输出端口中?

如何让“模拟立体声”和“数字立体声 (HDMI)”同时显示在 PulseAudio 输出端口中?

正如标题所述,我无法在 PulseAudio 中看到内置选项Analog StereoDigital Stereo (HDMI)输出选项。我可以在“配置”选项卡中更改配置文件,并在 和 之间切换Analog Stereo OutputDigital Stereo (HDMI 5) Output并且声音输出按预期工作。但是,“输出设备”选项卡仅显示一个输出接收器或另一个,因此 PulseAudio 托盘插件不提供更改输出端口的选项。

在此输入图像描述

输出来自pacmd list-cards

$ pacmd list-cards
1 card(s) available.
    index: 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 0x601d170000 irq 164"
        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 = "34c8"
        device.product.name = "Smart Sound Technology Audio Controller"
        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 (priority 65, available: unknown)
        output:analog-stereo: Analog Stereo Output (priority 6500, available: unknown)
        output:analog-stereo+input:analog-stereo: Analog Stereo Duplex (priority 6565, available: unknown)
        output:hdmi-stereo: Digital Stereo (HDMI) Output (priority 5900, available: no)
        output:hdmi-stereo+input:analog-stereo: Digital Stereo (HDMI) Output + Analog Stereo Input (priority 5965, available: no)
        output:hdmi-surround: Digital Surround 5.1 (HDMI) Output (priority 800, available: no)
        output:hdmi-surround+input:analog-stereo: Digital Surround 5.1 (HDMI) Output + Analog Stereo Input (priority 865, available: no)
        output:hdmi-surround71: Digital Surround 7.1 (HDMI) Output (priority 800, available: no)
        output:hdmi-surround71+input:analog-stereo: Digital Surround 7.1 (HDMI) Output + Analog Stereo Input (priority 865, available: no)
        output:hdmi-stereo-extra1: Digital Stereo (HDMI 2) Output (priority 5700, available: no)
        output:hdmi-stereo-extra1+input:analog-stereo: Digital Stereo (HDMI 2) Output + Analog Stereo Input (priority 5765, available: no)
        output:hdmi-surround-extra1: Digital Surround 5.1 (HDMI 2) Output (priority 600, available: no)
        output:hdmi-surround-extra1+input:analog-stereo: Digital Surround 5.1 (HDMI 2) Output + Analog Stereo Input (priority 665, available: no)
        output:hdmi-surround71-extra1: Digital Surround 7.1 (HDMI 2) Output (priority 600, available: no)
        output:hdmi-surround71-extra1+input:analog-stereo: Digital Surround 7.1 (HDMI 2) Output + Analog Stereo Input (priority 665, available: no)
        output:hdmi-stereo-extra2: Digital Stereo (HDMI 3) Output (priority 5700, available: no)
        output:hdmi-stereo-extra2+input:analog-stereo: Digital Stereo (HDMI 3) Output + Analog Stereo Input (priority 5765, available: no)
        output:hdmi-surround-extra2: Digital Surround 5.1 (HDMI 3) Output (priority 600, available: no)
        output:hdmi-surround-extra2+input:analog-stereo: Digital Surround 5.1 (HDMI 3) Output + Analog Stereo Input (priority 665, available: no)
        output:hdmi-surround71-extra2: Digital Surround 7.1 (HDMI 3) Output (priority 600, available: no)
        output:hdmi-surround71-extra2+input:analog-stereo: Digital Surround 7.1 (HDMI 3) Output + Analog Stereo Input (priority 665, available: no)
        output:hdmi-stereo-extra3: Digital Stereo (HDMI 4) Output (priority 5700, available: no)
        output:hdmi-stereo-extra3+input:analog-stereo: Digital Stereo (HDMI 4) Output + Analog Stereo Input (priority 5765, available: no)
        output:hdmi-surround-extra3: Digital Surround 5.1 (HDMI 4) Output (priority 600, available: no)
        output:hdmi-surround-extra3+input:analog-stereo: Digital Surround 5.1 (HDMI 4) Output + Analog Stereo Input (priority 665, available: no)
        output:hdmi-surround71-extra3: Digital Surround 7.1 (HDMI 4) Output (priority 600, available: no)
        output:hdmi-surround71-extra3+input:analog-stereo: Digital Surround 7.1 (HDMI 4) Output + Analog Stereo Input (priority 665, available: no)
        output:hdmi-stereo-extra4: Digital Stereo (HDMI 5) Output (priority 5700, available: unknown)
        output:hdmi-stereo-extra4+input:analog-stereo: Digital Stereo (HDMI 5) Output + Analog Stereo Input (priority 5765, available: unknown)
        output:hdmi-surround-extra4: Digital Surround 5.1 (HDMI 5) Output (priority 600, available: unknown)
        output:hdmi-surround-extra4+input:analog-stereo: Digital Surround 5.1 (HDMI 5) Output + Analog Stereo Input (priority 665, available: unknown)
        output:hdmi-surround71-extra4: Digital Surround 7.1 (HDMI 5) Output (priority 600, available: unknown)
        output:hdmi-surround71-extra4+input:analog-stereo: Digital Surround 7.1 (HDMI 5) Output + Analog Stereo Input (priority 665, available: unknown)
        output:hdmi-stereo-extra5: Digital Stereo (HDMI 6) Output (priority 5700, available: no)
        output:hdmi-stereo-extra5+input:analog-stereo: Digital Stereo (HDMI 6) Output + Analog Stereo Input (priority 5765, available: no)
        output:hdmi-surround-extra5: Digital Surround 5.1 (HDMI 6) Output (priority 600, available: no)
        output:hdmi-surround-extra5+input:analog-stereo: Digital Surround 5.1 (HDMI 6) Output + Analog Stereo Input (priority 665, available: no)
        output:hdmi-surround71-extra5: Digital Surround 7.1 (HDMI 6) Output (priority 600, available: no)
        output:hdmi-surround71-extra5+input:analog-stereo: Digital Surround 7.1 (HDMI 6) Output + Analog Stereo Input (priority 665, available: no)
        output:hdmi-stereo-extra6: Digital Stereo (HDMI 7) Output (priority 5700, available: no)
        output:hdmi-stereo-extra6+input:analog-stereo: Digital Stereo (HDMI 7) Output + Analog Stereo Input (priority 5765, available: no)
        output:hdmi-surround-extra6: Digital Surround 5.1 (HDMI 7) Output (priority 600, available: no)
        output:hdmi-surround-extra6+input:analog-stereo: Digital Surround 5.1 (HDMI 7) Output + Analog Stereo Input (priority 665, available: no)
        output:hdmi-surround71-extra6: Digital Surround 7.1 (HDMI 7) Output (priority 600, available: no)
        output:hdmi-surround71-extra6+input:analog-stereo: Digital Surround 7.1 (HDMI 7) Output + Analog Stereo Input (priority 665, available: no)
        off: Off (priority 0, available: unknown)
    active profile: <output:analog-stereo+input:analog-stereo>
    sinks:
        alsa_output.pci-0000_00_1f.3.analog-stereo/#2: Built-in Audio Analog Stereo
    sources:
        alsa_output.pci-0000_00_1f.3.analog-stereo.monitor/#2: Monitor of Built-in Audio Analog Stereo
        alsa_input.pci-0000_00_1f.3.analog-stereo/#3: Built-in Audio Analog Stereo
    ports:
        analog-input-internal-mic: Internal Microphone (priority 8900, latency offset 0 usec, available: unknown)
            properties:
                device.icon_name = "audio-input-microphone"
        analog-input-mic: Microphone (priority 8700, latency offset 0 usec, available: no)
            properties:
                device.icon_name = "audio-input-microphone"
        analog-output-speaker: Speakers (priority 10000, latency offset 0 usec, available: unknown)
            properties:
                device.icon_name = "audio-speakers"
        analog-output-headphones: Headphones (priority 9900, latency offset 0 usec, available: no)
            properties:
                device.icon_name = "audio-headphones"
        hdmi-output-0: HDMI / DisplayPort (priority 5900, latency offset 0 usec, available: no)
            properties:
                device.icon_name = "video-display"
        hdmi-output-1: HDMI / DisplayPort 2 (priority 5800, latency offset 0 usec, available: no)
            properties:
                device.icon_name = "video-display"
        hdmi-output-2: HDMI / DisplayPort 3 (priority 5700, latency offset 0 usec, available: no)
            properties:
                device.icon_name = "video-display"
        hdmi-output-3: HDMI / DisplayPort 4 (priority 5600, latency offset 0 usec, available: no)
            properties:
                device.icon_name = "video-display"
        hdmi-output-4: HDMI / DisplayPort 5 (priority 5500, latency offset 0 usec, available: yes)
            properties:
                device.icon_name = "video-display"
                device.product.name = "SAMSUNG"
        hdmi-output-5: HDMI / DisplayPort 6 (priority 5400, latency offset 0 usec, available: no)
            properties:
                device.icon_name = "video-display"
        hdmi-output-6: HDMI / DisplayPort 7 (priority 5300, latency offset 0 usec, available: no)
            properties:
                device.icon_name = "video-display"

我是否需要定义包含两个音频接收器的自定义 PulseAudio 配置文件?我在其他安装中没有看到这个问题,在其他安装中,连接时会自动出现新的输出端口。我Xubuntu 20.04.1 LTS在 LG Gram 17 上使用。

提前致谢!

答案1

由于模拟和各种 HDMI 接收器来自同一张卡,默认配置似乎将它们全部配置到一个配置文件中,这意味着一次只能使用一个配置文件。因此确实需要一个自定义配置文件来解决这个问题。

对于我的情况,我按照以下说明进行操作在pulseaudio中编写配置文件。我创建了2个文件:

/etc/udev/rules.d/91-pulseaudio-intel.rules

# Custom Profile for onboard Intel 8086:a171

SUBSYSTEM!="sound", GOTO="xpulseaudio_end"
ACTION!="change", GOTO="xpulseaudio_end"
KERNEL!="card*", GOTO="xpulseaudio_end"

SUBSYSTEMS=="pci", ATTRS{vendor}=="0x8086", ATTRS{device}=="0xa171", ENV{PULSE_PROFILE_SET}="intel-hdmi+analog.conf"

LABEL="xpulseaudio_end"

/usr/share/pulseaudio/alsa-mixer/profile-sets/intel-hdmi+analog.conf

[General]
; # Instead of defining all profiles manually, autogenerate
; # them by combining every input mapping with every output mapping
auto-profiles = yes

[Mapping analog-stereo]
device-strings = front:%f
channel-map = left,right
paths-output = analog-output-speaker analog-output-headphones
paths-input = analog-input-internal-mic analog-input-headset-mic
priority = 15

[Mapping hdmi-stereo]
description = Digital Stereo (HDMI)
device-strings = hdmi:%f
paths-output = hdmi-output-0
channel-map = left,right
priority = 9
direction = output

[Profile output:analog-stereo+output:hdmi-stereo+input:analog-stereo]
description = Analog Stereo + Digital Stereo (HDMI) + Analog Stereo Input
output-mappings = analog-stereo hdmi-stereo
input-mappings = analog-stereo

[Profile output:analog-stereo+output:hdmi-stereo]
description = Analog Stereo + Digital Stereo (HDMI)
output-mappings = analog-stereo hdmi-stereo

之后就是跑步的问题了

$ sudo udevadm trigger -ssound
$ pulseaudio -k

现在水槽是分开的。

我只需要模拟立体声和 HDMI-0 作为接收器,麦克风作为源。您提到了 HDMI-5,因此您可能想在路径输出中使用 hdmi-stereo-extra4。如果您还需要其他 HDMI 接收器,只需添加它们的映射,并且 - 如果您想要单独使用所有它们的选项 - 为每个“启用”接收器和源的组合提供一个配置文件。

Ubuntu 20.04 中的文件/usr/share/pulseaudio/alsa-mixer/profile-sets/default.conf(或脉冲音频 git 存储库) 有多种映射可供您复制。

相关内容