PulseAudio 和 ALSA - 将端口设置为单独的输出设备

PulseAudio 和 ALSA - 将端口设置为单独的输出设备

我正在尝试将“内置音频模拟立体声”分离为两个独立的设备(前面板音频和后面板音频,它们目前是合二为一的)。在 Kubuntu 14.04 上使用 Realtek ALC887。我以前在 Windows 中单独使用过前面板和后面板,效果很好,所以我知道声卡可以做到这一点。

我跟着并将以下几行添加到我的 /etc/pulse/default.pa 的底部

load-module module-remap-sink sink_name=speakers remix=no master=alsa_output.pci-0000_00_14.2.analog-stereo channels=2 master_channel_map=front-left,front-right channel_map=front-left,front-right
load-module module-remap-sink sink_name=headphones remix=no master=alsa_output.pci-0000_00_14.2.analog-stereo channels=2 master_channel_map=rear-left,rear-right channel_map=rear-left,rear-right

我还尝试使用“channel_map=front-left,front-right”,如链接所示

它让我成功了一半,它在我的播放设备下给了我两个“重新映射的内置音频模拟立体声”设备,但第一个仍然只是结合了我的扬声器(后面板)和我的耳机(前面板),而第二个没有效果。

在此之前,我只能通过耳机获取音频,但一旦我使用 hdajackretask 并设置我的端口,我就能让音频通过它们两个。

“pacmd list-sinks”输出(不包括我的 HDMI 音频和键盘的音频插孔):

最后两行显然是上面两行相加的结果

  * index: 2
    name: <alsa_output.pci-0000_00_14.2.analog-stereo>
    driver: <module-alsa-card.c>
    flags: HARDWARE HW_MUTE_CTRL HW_VOLUME_CTRL DECIBEL_VOLUME LATENCY DYNAMIC_LATENCY
    state: RUNNING
    suspend cause: 
    priority: 9959
    volume: 0: 100% 1: 100%
            0: 0.00 dB 1: 0.00 dB
            balance 0.00
    base volume: 100%
                 0.00 dB
    volume steps: 65537
    muted: no
    current latency: 16.70 ms
    max request: 3 KiB
    max rewind: 64 KiB
    monitor source: 3
    sample spec: s16le 2ch 44100Hz
    channel map: front-left,front-right
                 Stereo
    used by: 2
    linked by: 5
    configured latency: 20.00 ms; range is 0.50 .. 371.52 ms
    card: 2 <alsa_card.pci-0000_00_14.2>
    module: 7
    properties:
            alsa.resolution_bits = "16"
            device.api = "alsa"
            device.class = "sound"
            alsa.class = "generic"
            alsa.subclass = "generic-mix"
            alsa.name = "ALC887-VD Analog"
            alsa.id = "ALC887-VD Analog"
            alsa.subdevice = "0"
            alsa.subdevice_name = "subdevice #0"
            alsa.device = "0"
            alsa.card = "0"
            alsa.card_name = "HDA ATI SB"
            alsa.long_card_name = "HDA ATI SB at 0xfe300000 irq 16"
            alsa.driver_name = "snd_hda_intel"
            device.bus_path = "pci-0000:00:14.2"
            sysfs.path = "/devices/pci0000:00/0000:00:14.2/sound/card0"
            device.bus = "pci"
            device.vendor.id = "1002"
            device.vendor.name = "Advanced Micro Devices, Inc. [AMD/ATI]"
            device.product.id = "4383"
            device.product.name = "SBx00 Azalia (Intel HDA)"
            device.form_factor = "internal"
            device.string = "front:0"
            device.buffering.buffer_size = "65536"
            device.buffering.fragment_size = "32768"
            device.access_mode = "mmap+timer"
            device.profile.name = "analog-stereo"
            device.profile.description = "Analog Stereo"
            device.description = "Built-in Audio Analog Stereo"
            alsa.mixer_name = "Realtek ALC887-VD"
            alsa.components = "HDA:10ec0887,10438444,00100302"
            module-udev-detect.discovered = "1"
            device.icon_name = "audio-card-pci"
    ports:
            analog-output: Analog Output (priority 9900, latency offset 0 usec, available: unknown)
                    properties:

            analog-output-headphones: Headphones (priority 9000, latency offset 0 usec, available: yes)
                    properties:
                            device.icon_name = "audio-headphones"
    active port: <analog-output-headphones>
index: 3
    name: <speakers>
    driver: <module-remap-sink.c>
    flags: DECIBEL_VOLUME LATENCY DYNAMIC_LATENCY
    state: IDLE
    suspend cause: 
    priority: 1000
    volume: 0: 100% 1: 100%
            0: 0.00 dB 1: 0.00 dB
            balance 0.00
    base volume: 100%
                 0.00 dB
    volume steps: 65537
    muted: no
    current latency: 16.55 ms
    max request: 3 KiB
    max rewind: 64 KiB
    monitor source: 5
    sample spec: s16le 2ch 44100Hz
    channel map: front-left,front-right
                 Stereo
    used by: 0
    linked by: 1
    configured latency: 20.00 ms; range is 0.50 .. 371.52 ms
    module: 21
    properties:
            device.master_device = "alsa_output.pci-0000_00_14.2.analog-stereo"
            device.class = "filter"
            device.description = "Remapped Built-in Audio Analog Stereo"
            device.icon_name = "audio-card"
index: 4
    name: <headphones>
    driver: <module-remap-sink.c>
    flags: DECIBEL_VOLUME LATENCY DYNAMIC_LATENCY
    state: IDLE
    suspend cause: 
    priority: 1000
    volume: 0: 100% 1: 100%
            0: 0.00 dB 1: 0.00 dB
            balance 0.00
    base volume: 100%
                 0.00 dB
    volume steps: 65537
    muted: no
    current latency: 16.44 ms
    max request: 3 KiB
    max rewind: 64 KiB
    monitor source: 6
    sample spec: s16le 2ch 44100Hz
    channel map: front-left,front-right
                 Stereo
    used by: 0
    linked by: 1
    configured latency: 20.00 ms; range is 0.50 .. 371.52 ms
    module: 22
    properties:
            device.master_device = "alsa_output.pci-0000_00_14.2.analog-stereo"
            device.class = "filter"
            device.description = "Remapped Built-in Audio Analog Stereo"
            device.icon_name = "audio-card"

如您所见,“analog-output”和“analog-output-headphones”都列在同一个接收器“alsa_output.pci-0000_00_14.2.analog-stereo”下

有什么方法可以解决我遇到的问题(上面加粗的部分)?或者是否有其他方法可以实现我的目标?

抱歉,如果我的措辞让人困惑,这对我来说是一个全新的领域。任何帮助我都非常感谢!

答案1

好的,我已成功设置了不同的设置。希望这对您有所帮助

首先,我的立体声音响插入绿色端口,耳机插入主板上的黑色端口(红色为麦克风)

在 pavucontrol 配置菜单中,我设置 模拟环绕 5.1 输出 + 模拟立体声输入查看我的内置音频配置文件

名称取自pacmd list-sinks:alsa_output.pci-0000_00_1b.0.analog-surround-51

/etc/pulse/default.pa:

load-module module-remap-sink sink_name=speakers remix=no master=alsa_output.pci-0000_00_1b.0.analog-surround-51 channels=2 master_channel_map=front-left,front-right channel_map=front-left,front-right

load-module module-remap-sink sink_name=headphones remix=no master=alsa_output.pci-0000_00_1b.0.analog-surround-51 channels=2 master_channel_map=rear-left,rear-right channel_map=front-left,front-right

重新启动 pulseaudio: pulseaudio --kill pulseaudio --start

现在,我可以从 pavucontrol 设置重新映射内置音频模拟环绕 5.1(遗憾的是,名称没有显示。。)每个应用程序都可以在耳机和立体声之间切换

编辑:当我第一次尝试像您一样在前面板上实现此效果时,我注意到当我插入和拔出耳机插孔时,pavucontrol 中的配置文件会发生变化。如果您在尝试这些重新映射之前为两个端口设置相同的配置文件,可能会有所帮助。

答案2

您使用了master_channel_map=rear-left,rear-right channel_map=rear-left,rear-right第二个,但实际上应该是master_channel_map=rear-left,rear-right channel_map=front-left,front-right

相关内容