更改 PulseAudio 源端口:“availability=no”和优先级

更改 PulseAudio 源端口:“availability=no”和优先级

我有一台 Thinkpad T450s,它配备了三个“真实”麦克风输入:内部麦克风阵列(物理麦克风位于网络摄像头旁边的 LCD 边框上)、通过组合耳机/麦克风 4 极插孔的“线路输入”,以及通过对接端口“线路输入”。 PulseAudio 将所有三个端口显示为属于单个 ALSA 源(请参阅下面的“pacmd list-sources”输出)。

  * index: 2
    name: <alsa_input.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: front-left: 23093 /  35% / -27.18 dB,   front-right: 23093 /  35% / -27.18 dB
            balance 0.00
    base volume: 13076 /  20% / -42.00 dB
    volume steps: 65537
    muted: no
    current latency: 0.00 ms
    max rewind: 0 KiB
    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 .. 371.52 ms
    card: 1 <alsa_card.pci-0000_00_1b.0>
    module: 7
    properties:
        alsa.resolution_bits = "16"
        device.api = "alsa"
        device.class = "sound"
        alsa.class = "generic"
        alsa.subclass = "generic-mix"
        alsa.name = "ALC3232 Analog"
        alsa.id = "ALC3232 Analog"
        alsa.subdevice = "0"
        alsa.subdevice_name = "subdevice #0"
        alsa.device = "0"
        alsa.card = "1"
        alsa.card_name = "HDA Intel PCH"
        alsa.long_card_name = "HDA Intel PCH at 0xe1234000 irq 47"
        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 = "9ca0"
        device.product.name = "Wildcat Point-LP High Definition Audio Controller"
        device.form_factor = "internal"
        device.string = "front:1"
        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 ALC3232"
        alsa.components = "HDA:10ec0292,17aa5036,00100001"
        module-udev-detect.discovered = "1"
        device.icon_name = "audio-card-pci"
    ports:
        analog-input-internal-mic: Internal Microphone (priority 8900, latency offset 0 usec, available: unknown)
            properties:
                device.icon_name = "audio-input-microphone"
        analog-input-dock-mic: Dock Microphone (priority 7800, latency offset 0 usec, available: no)
            properties:
                device.icon_name = "audio-input-microphone"
        analog-input-mic: Microphone (priority 8700, latency offset 0 usec, available: no)
            properties:
                device.icon_name = "audio-input-microphone"
    active port: <analog-input-internal-mic>

当前的行为是,当两个线路输入均未连接时(耳机/麦克风插孔为空,笔记本电脑未连接),内部麦克风阵列处于活动状态(如上面的 pacmd 输出所示)。但是,当通过耳机/麦克风插孔连接线路输入时,例如插入智能手机专用的 4 极耳塞组时,ALSA 源会将端口切换到线路输入端口“模拟输入麦克风” '。内部麦克风阵列端口“模拟输入内部麦克风”的可用性现在显示为“否”。见下文。

...
    ports:
        analog-input-internal-mic: Internal Microphone (priority 8900, latency offset 0 usec, available: no)
            properties:
                device.icon_name = "audio-input-microphone"
        analog-input-dock-mic: Dock Microphone (priority 7800, latency offset 0 usec, available: no)
            properties:
                device.icon_name = "audio-input-microphone"
        analog-input-mic: Microphone (priority 8700, latency offset 0 usec, available: yes)
            properties:
                device.icon_name = "audio-input-microphone"
    active port: <analog-input-mic>

我想改变这种行为,以便无论如何,内部麦克风阵列优先,因为内部麦克风阵列的音质优于我拥有的麦克风。这有两个问题:

  1. 内部麦克风端口的可用性更改为“否”,这样,如果我手动更改端口(“pacmd set-source-port 2 Analog-input-internal-mic”),则没有实际的声音输入

  2. 内部麦克风端口的优先级似乎低于其他两个端口,这意味着即使我解决了可用性问题,每次通过插孔插入麦克风时我都必须通过 pavucontrol 或 pacmd 手动设置它

我确信这是一个软件/固件问题,因为我在 Windows 中完全按照所需设置了行为。

有什么办法可以解决这些问题吗?这在某种程度上是寻找解决方案的最后努力,因为这似乎是一个低级 ALSA 驱动程序问题(可用性)以及 99.99% 的用户永远不会触及的问题(端口优先级)。任何输入都值得赞赏,除了我能找到的“pacmd set-sink-port/set-source-port”之外,基本上没有关于 PulseAudio 端口的文档。

  • 系统:Thinkpad T450s
  • 发行版:Debian 测试(延伸)

答案1

我需要将我的模拟输入耳机麦克风设置为“禁用/否”,并找到了这篇文章https://bugs.freedesktop.org/show_bug.cgi?id=101798

在文件 /usr/share/pulseaudio/alsa-mixer/paths/nalog-input-headphone-mic.conf 中,在块中 [General] priority = 88 更改优先级,

并在块中

[Jack Headphone Mic] required-any = any state.plugged =unknown

将“未知”改为“否”。现在“模拟输入耳机麦克风”是“否”

 ports:
            analog-input-internal-mic: Internal Microphone (priority 8900, latency offset 0 usec, available: yes)
                    properties:
                            device.icon_name = "audio-input-microphone"
            analog-input-headphone-mic: Microphone (priority 8700, latency offset 0 usec, available: no)
                    properties:
                            device.icon_name = "audio-input-microphone"
            analog-input-headset-mic: Headset Microphone (priority 8800, latency offset 0 usec, available: yes)
                    properties:
                            device.icon_name = "audio-input-microphone"
    active port: <analog-input-internal-mic>

相关内容