如何设置pulseaudio以使用2个配置文件中的数字和模拟端口?

如何设置pulseaudio以使用2个配置文件中的数字和模拟端口?

我最近安装了 Debian 测试,并使用 Xfce 作为我的桌面环境。我使用的是主板内置的Realtek声卡。

在 Windows 上,或者当我尝试使用 GNOME 的 Debian 时,我能够轻松地在数字和模拟输出(S/PDIF 和耳机)之间切换,但是到目前为止,我只能通过使用pavucontrol.

数字立体声 (IEC958) 输出配置文件仅显示一个端口:数字输出(S/PDIF)。 这模拟立体声输出配置文件显示两个端口:线路输出(未插入)耳机(已插入)

有没有一种方法可以将耳机和 S/PDIF 端口放在一个配置文件上,或者这就是pulseaudio 的工作方式?

这是相关部分pacmd list-cards

index: 1
name: <alsa_card.pci-0000_00_1b.0>
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 0xf7130000 irq 30"
    alsa.driver_name = "snd_hda_intel"
    device.bus_path = "pci-0000:00:1b.0"
    sysfs.path = "/devices/pci0000:00/0000:00:1b.0/sound/card0"
    device.bus = "pci"
    device.vendor.id = "8086"
    device.vendor.name = "Intel Corporation"
    device.product.id = "8c20"
    device.product.name = "8 Series/C220 Series Chipset High Definition 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 60, available: unknown)
    input:iec958-stereo: Digital Stereo (IEC958) Input (priority 55, available: unknown)
    output:analog-stereo: Analog Stereo Output (priority 6000, available: unknown)
    output:analog-stereo+input:analog-stereo: Analog Stereo Duplex (priority 6060, available: unknown)
    output:analog-stereo+input:iec958-stereo: Analog Stereo Output + Digital Stereo (IEC958) Input (priority 6055, available: unknown)
    output:analog-surround-21: Analog Surround 2.1 Output (priority 800, available: no)
    output:analog-surround-21+input:analog-stereo: Analog Surround 2.1 Output + Analog Stereo Input (priority 860, available: unknown)
    output:analog-surround-21+input:iec958-stereo: Analog Surround 2.1 Output + Digital Stereo (IEC958) Input (priority 855, available: unknown)
    output:analog-surround-40: Analog Surround 4.0 Output (priority 700, available: no)
    output:analog-surround-40+input:analog-stereo: Analog Surround 4.0 Output + Analog Stereo Input (priority 760, available: unknown)
    output:analog-surround-40+input:iec958-stereo: Analog Surround 4.0 Output + Digital Stereo (IEC958) Input (priority 755, available: unknown)
    output:analog-surround-41: Analog Surround 4.1 Output (priority 800, available: no)
    output:analog-surround-41+input:analog-stereo: Analog Surround 4.1 Output + Analog Stereo Input (priority 860, available: unknown)
    output:analog-surround-41+input:iec958-stereo: Analog Surround 4.1 Output + Digital Stereo (IEC958) Input (priority 855, available: unknown)
    output:analog-surround-50: Analog Surround 5.0 Output (priority 700, available: no)
    output:analog-surround-50+input:analog-stereo: Analog Surround 5.0 Output + Analog Stereo Input (priority 760, available: unknown)
    output:analog-surround-50+input:iec958-stereo: Analog Surround 5.0 Output + Digital Stereo (IEC958) Input (priority 755, available: unknown)
    output:analog-surround-51: Analog Surround 5.1 Output (priority 800, available: no)
    output:analog-surround-51+input:analog-stereo: Analog Surround 5.1 Output + Analog Stereo Input (priority 860, available: unknown)
    output:analog-surround-51+input:iec958-stereo: Analog Surround 5.1 Output + Digital Stereo (IEC958) Input (priority 855, available: unknown)
    output:iec958-stereo: Digital Stereo (IEC958) Output (priority 5500, available: unknown)
    output:iec958-stereo+input:analog-stereo: Digital Stereo (IEC958) Output + Analog Stereo Input (priority 5560, available: unknown)
    output:iec958-stereo+input:iec958-stereo: Digital Stereo Duplex (IEC958) (priority 5555, available: unknown)
    off: Off (priority 0, available: unknown)
active profile: <output:iec958-stereo>
sinks:
    alsa_output.pci-0000_00_1b.0.iec958-stereo/#36: Built-in Audio Digital Stereo (IEC958)
sources:
    alsa_output.pci-0000_00_1b.0.iec958-stereo.monitor/#46: Monitor of Built-in Audio Digital Stereo (IEC958)
ports:
    analog-input-front-mic: Front Microphone (priority 8500, latency offset 0 usec, available: yes)
        properties:
            device.icon_name = "audio-input-microphone"
    analog-input-rear-mic: Rear Microphone (priority 8200, latency offset 0 usec, available: no)
        properties:
            device.icon_name = "audio-input-microphone"
    analog-input-linein: Line In (priority 8100, latency offset 0 usec, available: no)
        properties:

    iec958-stereo-input: Digital Input (S/PDIF) (priority 0, latency offset 0 usec, available: unknown)
        properties:

    analog-output-lineout: Line Out (priority 9900, latency offset 0 usec, available: no)
        properties:

    analog-output-headphones: Headphones (priority 9000, latency offset 0 usec, available: yes)
        properties:
            device.icon_name = "audio-headphones"
    iec958-stereo-output: Digital Output (S/PDIF) (priority 0, latency offset 0 usec, available: unknown)
        properties:

答案1

对于其他人在寻找解决方案时发现这个问题,这对我有用。

打开/usr/share/pulseaudio/alsa-mixer/profile-sets/default.conf,并将其添加到其中:

[Profile output:analog-stereo+output:iec958-stereo+input:analog-stereo]
description = Digital Stereo (IEC958) Output + Analog Stereo Duplex
output-mappings = analog-stereo iec958-stereo
input-mappings = analog-stereo

这将创建一个包含模拟立体声输入+输出和数字立体声输出的配置文件。

要应用更改,请重新启动 PulseAudio 守护程序:

pulseaudio --kill
pulseaudio --start

现在您应该看到能够在 pavucontrol 中使用新的配置文件,并同时使用两个输出。

相关内容