通过多个通道路由 PulseAudio,不会损失质量

通过多个通道路由 PulseAudio,不会损失质量

我想要通过多个输出通道来路由 PulseAudio。

pactl list short sinks
0   alsa_output.pci-0000_00_0e.0.analog-stereo  module-alsa-card.c  s16le 2ch 44100Hz   SUSPENDED
1   alsa_output.usb-BurrBrown_from_Texas_Instruments_USB_AUDIO_DAC-00.analog-stereo module-alsa-card.c  s16le 2ch 44100Hz   SUSPENDED
pactl info | grep 'Default Sink'
Default Sink: alsa_output.pci-0000_00_0e.0.analog-stereo
pactl list cards
Card #0
    Name: alsa_card.pci-0000_00_0e.0
    Driver: module-alsa-card.c
    Owner Module: 1
    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
Card #1
    Name: alsa_card.usb-BurrBrown_from_Texas_Instruments_USB_AUDIO_DAC-00
    Driver: module-alsa-card.c
    Owner Module: 2
    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

我希望能够通过 3 个配置文件路由音频

output:analog-stereo+input:analog-stereo(当前活动个人资料)在卡 0

output:hdmi-stereo+input:analog-stereo 在卡 0

output:analog-stereo在卡片 1 中

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

目前只有这个能产生声音

aplay -D plughw:0,0 /usr/share/sounds/alsa/Front_Right.wav

我需要它路由到hw:0,0hw:0,3hw:1,0

我如何将其重新路由至所有三个?

如果有任何我可以查看的文档那就太好了。

更新

我尝试了以下步骤

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

现在我播放两个文件时都能听到声音

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-combine-sink sink_name=combined slaves=analog,hdmi
pactl set-default-sink combined

然后我运行了以下命令

paplay --device=combined /usr/share/sounds/alsa/Front_Left.wav

我第一次运行它时,它在两个设备上都播放音频。但从第二次开始,它只在接收器上hw:0,0播放analog

我认为不同的配置文件具有不同的优先级,不知道这是否会对输出产生影响。我不确定我需要查看哪些来源才能了解此行为。

相关内容