Pulseaudio 在系统模式下通过多个通道听起来很糟糕

Pulseaudio 在系统模式下通过多个通道听起来很糟糕

我跟着解决方案并设置我的 pulseaudio 系统以在多个音频通道上工作。但我面临的一个问题是,更改/etc/pulse/default.pa在 pulseaudio 重新启动时没有生效。所以我添加了一个包含这些更改的脚本文件并运行了它。

pactl set-card-profile 0 output:hdmi-stereo 
pactl set-default-sink alsa_output.pci-0000_00_0e.0.hdmi-stereo

# the above steps are necessary for some reason to get audio out of hw:0,3 (hdmi-stereo) & hw:0,0 (analog-stereo). without them i only get audio from hw:0,0.
# tested with the following
#aplay -D plughw:0,3 /usr/share/sounds/alsa/Front_Right.wav
#aplay -D plughw:0,0 /usr/share/sounds/alsa/Front_Right.wav

pactl load-module module-alsa-sink device=hw:0,0 sink_name=analog
pactl load-module module-alsa-sink device=hw:0,3 sink_name=hdmi
pactl load-module module-alsa-sink device=hw:1,0 sink_name=usb
pactl load-module module-combine-sink sink_name=combined slaves=analog,hdmi,usb
pactl set-default-sink combined

我定义了 3 个接收器,但只有 2 个同时有音频。但我认为这与修改default-sample-channels为正确的数字有关。但真正的问题是音频质量太差。当只有 1 个接收器时,音频清晰得多。没有问题。但经过此更改后,音频在播放时几乎无法识别。如果不重新启动整个系统,我无法在不同的频道之间切换。任何有助于改进这些的想法或文档都将不胜感激。

编辑此内容以说明 3 个音频通道是什么。我有 HDMI 端口、USB 和 3.5 毫米插孔。我需要音频同时通过所有这些端口。

更新:我意识到我正在系统模式下运行 pulseaudio,要修改的确切文件是 system.pa 而不是 default.pa。这就是之前的更改无效的原因。我尝试将这些行添加到 system.pa 并重新启动 pulseaudio,但该方法也一直失败,并显示以下消息

Stopped PulseAudio system server.
Starting PulseAudio system server...
Running in system mode, but --disallow-exit not set.
Running in system mode, but --disallow-module-loading not set.
Running in system mode, forcibly disabling SHM mode.
Running in system mode, forcibly disabling exit idle time.

OK, so you are running PA in system mode. Please make sure that you actually do want to do that.
Please read http://www.freedesktop.org/wiki/Software/PulseAudio/Documentation/User/WhatIsWrongWithSystemWide/ for an explanation why system mode is usually a bad idea.
Failed to load module "module-alsa-sink" (argument: "device=hw:0,0 sink_name=analog"): initialization failed.
pulseaudio.service: Main process exited, code=exited, status=1/FAILURE
Failed to start PulseAudio system server.
pulseaudio.service: Unit entered failed state.
pulseaudio.service: Failed with result 'exit-code'.
:~$ pactl list cards
Card #0
    Name: alsa_card.pci-0000_00_0e.0
    Driver: module-alsa-card.c
    Owner Module: 1
    Properties:
        alsa.card = "0"
        alsa.card_name = "HDA Intel PCH"
        alsa.long_card_name = "HDA Intel PCH at 0x82510000 irq 130"
        alsa.driver_name = "snd_hda_intel"
        device.bus_path = "pci-0000:00:0e.0"
        sysfs.path = "/devices/pci0000:00/0000:00:0e.0/sound/card0"
        device.bus = "pci"
        device.vendor.id = "8086"
        device.vendor.name = "Intel Corporation"
        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: 60, available: yes)
        output:analog-stereo: Analog Stereo Output (sinks: 1, sources: 0, priority: 6000, available: yes)
        output:analog-stereo+input:analog-stereo: Analog Stereo Duplex (sinks: 1, sources: 1, priority: 6060, available: yes)
        output:hdmi-stereo: Digital Stereo (HDMI) Output (sinks: 1, sources: 0, priority: 5400, available: yes)
        output:hdmi-stereo+input:analog-stereo: Digital Stereo (HDMI) Output + Analog Stereo Input (sinks: 1, sources: 1, priority: 5460, available: yes)
        output:hdmi-stereo-extra1: Digital Stereo (HDMI 2) Output (sinks: 1, sources: 0, priority: 5200, available: no)
        output:hdmi-stereo-extra1+input:analog-stereo: Digital Stereo (HDMI 2) Output + Analog Stereo Input (sinks: 1, sources: 1, priority: 5260, available: yes)
        output:hdmi-surround-extra1: Digital Surround 5.1 (HDMI 2) Output (sinks: 1, sources: 0, priority: 100, available: no)
        output:hdmi-surround-extra1+input:analog-stereo: Digital Surround 5.1 (HDMI 2) Output + Analog Stereo Input (sinks: 1, sources: 1, priority: 160, available: yes)
        output:hdmi-surround71-extra1: Digital Surround 7.1 (HDMI 2) Output (sinks: 1, sources: 0, priority: 100, available: no)
        output:hdmi-surround71-extra1+input:analog-stereo: Digital Surround 7.1 (HDMI 2) Output + Analog Stereo Input (sinks: 1, sources: 1, priority: 160, available: yes)
        output:hdmi-stereo-extra2: Digital Stereo (HDMI 3) Output (sinks: 1, sources: 0, priority: 5200, available: no)
        output:hdmi-stereo-extra2+input:analog-stereo: Digital Stereo (HDMI 3) Output + Analog Stereo Input (sinks: 1, sources: 1, priority: 5260, available: yes)
        output:hdmi-surround-extra2: Digital Surround 5.1 (HDMI 3) Output (sinks: 1, sources: 0, priority: 100, available: no)
        output:hdmi-surround-extra2+input:analog-stereo: Digital Surround 5.1 (HDMI 3) Output + Analog Stereo Input (sinks: 1, sources: 1, priority: 160, available: yes)
        output:hdmi-surround71-extra2: Digital Surround 7.1 (HDMI 3) Output (sinks: 1, sources: 0, priority: 100, available: no)
        output:hdmi-surround71-extra2+input:analog-stereo: Digital Surround 7.1 (HDMI 3) Output + Analog Stereo Input (sinks: 1, sources: 1, priority: 160, available: yes)
        off: Off (sinks: 0, sources: 0, priority: 0, available: yes)
    Active Profile: output:analog-stereo+input:analog-stereo
    Ports:
        analog-input-internal-mic: Internal Microphone (priority: 8900, latency offset: 0 usec)
            Properties:
                device.icon_name = "audio-input-microphone"
            Part of profile(s): input:analog-stereo, output:analog-stereo+input:analog-stereo, output:hdmi-stereo+input:analog-stereo, output:hdmi-stereo-extra1+input:analog-stereo, output:hdmi-surround-extra1+input:analog-stereo, output:hdmi-surround71-extra1+input:analog-stereo, output:hdmi-stereo-extra2+input:analog-stereo, output:hdmi-surround-extra2+input:analog-stereo, output:hdmi-surround71-extra2+input:analog-stereo
        analog-input-headphone-mic: Microphone (priority: 8700, latency offset: 0 usec)
            Properties:
                device.icon_name = "audio-input-microphone"
            Part of profile(s): input:analog-stereo, output:analog-stereo+input:analog-stereo, output:hdmi-stereo+input:analog-stereo, output:hdmi-stereo-extra1+input:analog-stereo, output:hdmi-surround-extra1+input:analog-stereo, output:hdmi-surround71-extra1+input:analog-stereo, output:hdmi-stereo-extra2+input:analog-stereo, output:hdmi-surround-extra2+input:analog-stereo, output:hdmi-surround71-extra2+input:analog-stereo
        analog-output: Analog Output (priority: 9900, latency offset: 0 usec)
            Part of profile(s): output:analog-stereo, output:analog-stereo+input:analog-stereo
        hdmi-output-0: HDMI / DisplayPort (priority: 5900, latency offset: 0 usec, available)
            Properties:
                device.icon_name = "video-display"
                device.product.name = "MSI MP243"
            Part of profile(s): output:hdmi-stereo, output:hdmi-stereo+input:analog-stereo
        hdmi-output-1: HDMI / DisplayPort 2 (priority: 5800, latency offset: 0 usec, not available)
            Properties:
                device.icon_name = "video-display"
            Part of profile(s): output:hdmi-stereo-extra1, output:hdmi-stereo-extra1+input:analog-stereo, output:hdmi-surround-extra1, output:hdmi-surround-extra1+input:analog-stereo, output:hdmi-surround71-extra1, output:hdmi-surround71-extra1+input:analog-stereo
        hdmi-output-2: HDMI / DisplayPort 3 (priority: 5700, latency offset: 0 usec, not available)
            Properties:
                device.icon_name = "video-display"
            Part of profile(s): output:hdmi-stereo-extra2, output:hdmi-stereo-extra2+input:analog-stereo, output:hdmi-surround-extra2, output:hdmi-surround-extra2+input:analog-stereo, output:hdmi-surround71-extra2, output:hdmi-surround71-extra2+input:analog-stereo

Card #1
    Name: alsa_card.usb-BurrBrown_from_Texas_Instruments_USB_AUDIO_DAC-00
    Driver: module-alsa-card.c
    Owner Module: 2
    Properties:
        alsa.card = "1"
        alsa.card_name = "USB AUDIO    DAC"
        alsa.long_card_name = "BurrBrown from Texas Instruments USB AUDIO    DAC at usb-0000:00:15.0-5, full s"
        alsa.driver_name = "snd_usb_audio"
        device.bus_path = "pci-0000:00:15.0-usb-0:5:1.0"
        sysfs.path = "/devices/pci0000:00/0000:00:15.0/usb1/1-5/1-5:1.0/sound/card1"
        udev.id = "usb-BurrBrown_from_Texas_Instruments_USB_AUDIO_DAC-00"
        device.bus = "usb"
        device.vendor.id = "08bb"
        device.vendor.name = "Texas Instruments"
        device.product.id = "27c7"
        device.product.name = "USB AUDIO    DAC"
        device.serial = "BurrBrown_from_Texas_Instruments_USB_AUDIO_DAC"
        device.string = "1"
        device.description = "USB AUDIO    DAC"
        module-udev-detect.discovered = "1"
        device.icon_name = "audio-card-usb"
    Profiles:
        output:analog-mono: Analog Mono Output (sinks: 1, sources: 0, priority: 200, available: yes)
        output:analog-stereo: Analog Stereo Output (sinks: 1, sources: 0, priority: 6000, available: yes)
        output:iec958-stereo: Digital Stereo (IEC958) Output (sinks: 1, sources: 0, priority: 5500, available: yes)
        off: Off (sinks: 0, sources: 0, priority: 0, available: yes)
    Active Profile: output:analog-stereo
    Ports:
        analog-output: Analog Output (priority: 9900, latency offset: 0 usec)
            Part of profile(s): output:analog-mono, output:analog-stereo
        iec958-stereo-output: Digital Output (S/PDIF) (priority: 0, latency offset: 0 usec)
            Part of profile(s): output:iec958-stereo
~$ aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: PCH [HDA Intel PCH], device 0: ALC662 rev3 Analog [ALC662 rev3 Analog]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: PCH [HDA Intel PCH], device 3: HDMI 0 [HDMI 0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: PCH [HDA Intel PCH], device 7: HDMI 1 [HDMI 1]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: PCH [HDA Intel PCH], device 8: HDMI 2 [HDMI 2]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: DAC [USB AUDIO    DAC], device 0: USB Audio [USB Audio]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

我使用hw:0,0,hw:0,3,hw:1,0

所以我的问题是双重的

  1. load-module 行在终端和脚本文件上工作正常。不确定 system.pa 文件出了什么问题。
  2. 当我使用组合水槽时,音频质量很差。

相关内容