当尝试更改声卡上的哪个输出时,pacmd“无法设置接收端口”

当尝试更改声卡上的哪个输出时,pacmd“无法设置接收端口”

Linux linux 3.0.0-14-generic #23-Ubuntu SMP 2011 年 11 月 21 日星期一 20:28:43 UTC x86_64 x86_64 x86_64 GNU/Linux

梦魇豹猫

我有一张华硕 Xonar DG 声卡,它有多个输出可供选择。

有时我想使用常规扬声器输出并让其通过我的扬声器,但有时我想能够使用前面板音频端口来连接我的耳机。

我尝试切换两者的输出端口pavucontrol和内置的 Ubuntu 声音面板,但只要音频流开始播放,端口就会从“耳机”变回“扬声器”,并且音频会继续从扬声器中传出。

所以我转到 pacmd 并尝试改变它...

>>> list-sinks
3 sink(s) available.
    index: 0
    name: <alsa_output.pci-0000_03_00.1.hdmi-stereo>
    driver: <module-alsa-card.c>
    flags: HARDWARE DECIBEL_VOLUME LATENCY DYNAMIC_LATENCY
    state: SUSPENDED
    suspend cause: IDLE 
    priority: 9050
    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: 0.00 ms
    max request: 0 KiB
    max rewind: 0 KiB
    monitor source: 0
    sample spec: s16le 2ch 44100Hz
    channel map: front-left,front-right
                 Stereo
    used by: 0
    linked by: 0
    configured latency: 0.00 ms; range is 0.50 .. 1999.82 ms
    card: 0 <alsa_card.pci-0000_03_00.1>
    module: 4
    properties:
        alsa.resolution_bits = "16"
        device.api = "alsa"
        device.class = "sound"
        alsa.class = "generic"
        alsa.subclass = "generic-mix"
        alsa.name = "HDMI 0"
        alsa.id = "HDMI 0"
        alsa.subdevice = "0"
        alsa.subdevice_name = "subdevice #0"
        alsa.device = "3"
        alsa.card = "2"
        alsa.card_name = "HD-Audio Generic"
        alsa.long_card_name = "HD-Audio Generic at 0xfbbfc000 irq 78"
        alsa.driver_name = "snd_hda_intel"
        device.bus_path = "pci-0000:03:00.1"
        sysfs.path = "/devices/pci0000:00/0000:00:03.0/0000:03:00.1/sound/card2"
        device.bus = "pci"
        device.vendor.id = "1002"
        device.vendor.name = "ATI Technologies Inc"
        device.product.id = "aa50"
        device.product.name = "Cypress HDMI Audio [Radeon HD 5800 Series]"
        device.string = "hdmi:2"
        device.buffering.buffer_size = "352768"
        device.buffering.fragment_size = "176384"
        device.access_mode = "mmap+timer"
        device.profile.name = "hdmi-stereo"
        device.profile.description = "Digital Stereo (HDMI)"
        device.description = "Cypress HDMI Audio [Radeon HD 5800 Series] Digital Stereo (HDMI)"
        alsa.mixer_name = "ATI R6xx HDMI"
        alsa.components = "HDA:1002aa01,00aa0100,00100200"
        module-udev-detect.discovered = "1"
        device.icon_name = "audio-card-pci"
    ports:
        HDMI: HDMI (priority 0, available: no)
    active port: <HDMI>
    index: 1
    name: <alsa_output.pci-0000_00_1b.0.analog-stereo>
    driver: <module-alsa-card.c>
    flags: HARDWARE HW_MUTE_CTRL HW_VOLUME_CTRL DECIBEL_VOLUME LATENCY DYNAMIC_LATENCY
    state: SUSPENDED
    suspend cause: IDLE 
    priority: 9959
    volume: 0: 101% 1: 101%
            0: 0.25 dB 1: 0.25 dB
            balance 0.00
    base volume: 100%
                 0.00 dB
    volume steps: 65537
    muted: no
    current latency: 0.00 ms
    max request: 0 KiB
    max rewind: 0 KiB
    monitor source: 1
    sample spec: s16le 2ch 44100Hz
    channel map: front-left,front-right
                 Stereo
    used by: 0
    linked by: 0
    configured latency: 0.00 ms; range is 0.50 .. 1999.82 ms
    card: 1 <alsa_card.pci-0000_00_1b.0>
    module: 5
    properties:
        alsa.resolution_bits = "16"
        device.api = "alsa"
        device.class = "sound"
        alsa.class = "generic"
        alsa.subclass = "generic-mix"
        alsa.name = "ALC889 Analog"
        alsa.id = "ALC889 Analog"
        alsa.subdevice = "0"
        alsa.subdevice_name = "subdevice #0"
        alsa.device = "0"
        alsa.card = "1"
        alsa.card_name = "HDA Intel"
        alsa.long_card_name = "HDA Intel at 0xfb8f8000 irq 77"
        alsa.driver_name = "snd_hda_intel"
        device.bus_path = "pci-0000:00:1b.0"
        sysfs.path = "/devices/pci0000:00/0000:00:1b.0/sound/card1"
        device.bus = "pci"
        device.vendor.id = "8086"
        device.vendor.name = "Intel Corporation"
        device.product.id = "3a3e"
        device.product.name = "82801JI (ICH10 Family) HD Audio Controller"
        device.form_factor = "internal"
        device.string = "front:1"
        device.buffering.buffer_size = "352768"
        device.buffering.fragment_size = "176384"
        device.access_mode = "mmap+timer"
        device.profile.name = "analog-stereo"
        device.profile.description = "Analog Stereo"
        device.description = "Internal Audio Analog Stereo"
        alsa.mixer_name = "Realtek ALC889"
        alsa.components = "HDA:10ec0889,104383c0,00100004"
        module-udev-detect.discovered = "1"
        device.icon_name = "audio-card-pci"
    ports:
        analog-output: Analog Output (priority 9900, available: unknown)
        analog-output-headphones: Analog Headphones (priority 9000, available: no)
    active port: <analog-output-headphones>
  * index: 2
    name: <alsa_output.pci-0000_08_01.0.analog-stereo>
    driver: <module-alsa-card.c>
    flags: HARDWARE DECIBEL_VOLUME LATENCY DYNAMIC_LATENCY
    state: SUSPENDED
    suspend cause: IDLE 
    priority: 9059
    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: 0.00 ms
    max request: 0 KiB
    max rewind: 0 KiB
    monitor source: 3
    sample spec: s16le 2ch 44100Hz
    channel map: front-left,front-right
                 Stereo
    used by: 0
    linked by: 0
    configured latency: 0.00 ms; range is 36.00 .. 2000.00 ms
    card: 2 <alsa_card.pci-0000_08_01.0>
    module: 6
    properties:
        alsa.resolution_bits = "16"
        device.api = "alsa"
        device.class = "sound"
        alsa.class = "generic"
        alsa.subclass = "generic-mix"
        alsa.name = "Multichannel"
        alsa.id = "Multichannel"
        alsa.subdevice = "0"
        alsa.subdevice_name = "subdevice #0"
        alsa.device = "0"
        alsa.card = "0"
        alsa.card_name = "Xonar DG"
        alsa.long_card_name = "C-Media Oxygen HD Audio at 0xe800, irq 17"
        alsa.driver_name = "snd_oxygen"
        device.bus_path = "pci-0000:08:01.0"
        sysfs.path = "/devices/pci0000:00/0000:00:1e.0/0000:08:01.0/sound/card0"
        device.bus = "pci"
        device.vendor.id = "13f6"
        device.vendor.name = "C-Media Electronics Inc"
        device.product.id = "8788"
        device.product.name = "CMI8788 [Oxygen HD Audio]"
        device.string = "front:0"
        device.buffering.buffer_size = "352800"
        device.buffering.fragment_size = "352800"
        device.access_mode = "mmap+timer"
        device.profile.name = "analog-stereo"
        device.profile.description = "Analog Stereo"
        device.description = "CMI8788 [Oxygen HD Audio] Analog Stereo"
        alsa.mixer_name = "CMI8786"
        alsa.components = "CS4245 CMI8786"
        module-udev-detect.discovered = "1"
        device.icon_name = "audio-card-pci"
    ports:
        analog-output;output-speaker: Analog Output / Speaker (priority 9910, available: unknown)
        analog-output;output-headphones-1: Analog Output / Headphones 1 (priority 9909, available: unknown)
        analog-output;output-headphones-2: Analog Output / Headphones 2 (priority 9908, available: unknown)
    active port: <analog-output;output-speaker>
>>> set-sink-port 2 analog-output;output-headphones-1
Failed to set sink port to 'analog-output;output-headphones-1'.

嘘。有什么想法吗?

/var/log/dmesg 或 /var/log/syslog 中没有出现任何内容,我不确定我还应该在哪里查找...

答案1

对我来说,用引号()括住端口名称是"..."有效的。所以尝试一下

pacmd set-sink-port 2 "analog-output;output-headphones-1"

答案2

从输出中list-sinks我们可以看到,默认情况下,您的耳机接收器的索引为1,您的扬声器接收器的索引为2(HDMI 为0)。如果您有 PulseAudio 的默认设置,您应该能够通过发出以下命令在这两个接收器之间切换:

pacmd set-default-sink 1 # for headphones
pacmd set-default-sink 2 # for speakers

也可以看看这个答案用于在活动流播放时更改接收器输出以及如何禁用流设备恢复。

相关内容