为什么关闭 pavucontrol 时音频延迟会变高?

为什么关闭 pavucontrol 时音频延迟会变高?

我正在使用 ThinkPad thunderbolt 3 dock gen 2。它上面的输出工作正常,但只有当我打开 pavucontrol 时才如此。当我没有打开它时,连接到底座的耳机会发出噼啪声,就像延迟太大了一样。我使用的是带有标准 Gnome shell 的 Ubuntu 20.04 桌面。

$ pacmd list-cards

4 card(s) available.
    index: 0
    name: <alsa_card.pci-0000_01_00.1>
    driver: <module-alsa-card.c>
    owner module: 23
    properties:
        alsa.card = "1"
        alsa.card_name = "HDA NVidia"
        alsa.long_card_name = "HDA NVidia at 0xa4000000 irq 17"
        alsa.driver_name = "snd_hda_intel"
        device.bus_path = "pci-0000:01:00.1"
        sysfs.path = "/devices/pci0000:00/0000:00:01.0/0000:01:00.1/sound/card1"
        device.bus = "pci"
        device.vendor.id = "10de"
        device.vendor.name = "NVIDIA Corporation"
        device.product.id = "0fb9"
        device.product.name = "GP107GL High Definition Audio Controller"
        device.string = "1"
        device.description = "GP107GL High Definition Audio Controller"
        module-udev-detect.discovered = "1"
        device.icon_name = "audio-card-pci"
    profiles:
        output:hdmi-stereo: Digital Stereo (HDMI) Output (priority 5900, available: no)
        output:hdmi-surround: Digital Surround 5.1 (HDMI) Output (priority 800, available: no)
        output:hdmi-surround71: Digital Surround 7.1 (HDMI) Output (priority 800, available: no)
        output:hdmi-stereo-extra1: Digital Stereo (HDMI 2) Output (priority 5700, available: no)
        output:hdmi-surround-extra1: Digital Surround 5.1 (HDMI 2) Output (priority 600, available: no)
        output:hdmi-surround71-extra1: Digital Surround 7.1 (HDMI 2) Output (priority 600, available: no)
        output:hdmi-stereo-extra2: Digital Stereo (HDMI 3) Output (priority 5700, available: no)
        output:hdmi-surround-extra2: Digital Surround 5.1 (HDMI 3) Output (priority 600, available: no)
        output:hdmi-surround71-extra2: Digital Surround 7.1 (HDMI 3) Output (priority 600, available: no)
        off: Off (priority 0, available: unknown)
    active profile: <off>
    ports:
        hdmi-output-0: HDMI / DisplayPort (priority 5900, latency offset 0 usec, available: no)
            properties:
                device.icon_name = "video-display"
        hdmi-output-1: HDMI / DisplayPort 2 (priority 5800, latency offset 0 usec, available: no)
            properties:
                device.icon_name = "video-display"
        hdmi-output-2: HDMI / DisplayPort 3 (priority 5700, latency offset 0 usec, available: no)
            properties:
                device.icon_name = "video-display"
    index: 3
    name: <alsa_card.pci-0000_00_1f.3>
    driver: <module-alsa-card.c>
    owner module: 26
    properties:
        alsa.card = "0"
        alsa.card_name = "HDA Intel PCH"
        alsa.long_card_name = "HDA Intel PCH at 0x404a108000 irq 192"
        alsa.driver_name = "snd_hda_intel"
        device.bus_path = "pci-0000:00:1f.3"
        sysfs.path = "/devices/pci0000:00/0000:00:1f.3/sound/card0"
        device.bus = "pci"
        device.vendor.id = "8086"
        device.vendor.name = "Intel Corporation"
        device.product.id = "a348"
        device.product.name = "Cannon Lake PCH cAVS"
        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 (priority 65, available: unknown)
        output:analog-stereo: Analog Stereo Output (priority 6500, available: unknown)
        output:analog-stereo+input:analog-stereo: Analog Stereo Duplex (priority 6565, available: unknown)
        off: Off (priority 0, available: unknown)
    active profile: <output:analog-stereo+input:analog-stereo>
    sinks:
        alsa_output.pci-0000_00_1f.3.analog-stereo/#2: Built-in Audio Analog Stereo
    sources:
        alsa_output.pci-0000_00_1f.3.analog-stereo.monitor/#4: Monitor of Built-in Audio Analog Stereo
        alsa_input.pci-0000_00_1f.3.analog-stereo/#5: Built-in Audio Analog Stereo
    ports:
        analog-input-internal-mic: Internal Microphone (priority 8900, latency offset 0 usec, available: yes)
            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"
        analog-output-speaker: Speakers (priority 10000, latency offset 0 usec, available: yes)
            properties:
                device.icon_name = "audio-speakers"
        analog-output-headphones: Headphones (priority 9900, latency offset 0 usec, available: no)
            properties:
                device.icon_name = "audio-headphones"
    index: 4
    name: <alsa_card.usb-Microsoft_Microsoft___LifeCam_Cinema_TM_-02>
    driver: <module-alsa-card.c>
    owner module: 30
    properties:
        alsa.card = "3"
        alsa.card_name = "Microsoft® LifeCam Cinema(TM)"
        alsa.long_card_name = "Microsoft Microsoft® LifeCam Cinema(TM) at usb-0000:09:00.0-2.1.4, high speed"
        alsa.driver_name = "snd_usb_audio"
        device.bus_path = "pci-0000:09:00.0-usb-0:2.1.4:1.2"
        sysfs.path = "/devices/pci0000:00/0000:00:1b.4/0000:04:00.0/0000:05:01.0/0000:07:00.0/0000:08:02.0/0000:09:00.0/usb3/3-2/3-2.1/3-2.1.4/3-2.1.4:1.2/sound/card3"
        udev.id = "usb-Microsoft_Microsoft®_LifeCam_Cinema_TM_-02"
        device.bus = "usb"
        device.vendor.id = "045e"
        device.vendor.name = "Microsoft Corp."
        device.product.id = "075d"
        device.product.name = "LifeCam Cinema"
        device.serial = "Microsoft_Microsoft®_LifeCam_Cinema_TM_"
        device.form_factor = "webcam"
        device.string = "3"
        device.description = "LifeCam Cinema"
        module-udev-detect.discovered = "1"
        device.icon_name = "camera-web-usb"
    profiles:
        input:mono-fallback: Mono Input (priority 1, available: unknown)
        input:multichannel-input: Multichannel Input (priority 1, available: unknown)
        off: Off (priority 0, available: unknown)
    active profile: <input:mono-fallback>
    sources:
        alsa_input.usb-Microsoft_Microsoft___LifeCam_Cinema_TM_-02.mono-fallback/#17: LifeCam Cinema Mono
    ports:
        analog-input-mic: Microphone (priority 8700, latency offset 0 usec, available: unknown)
            properties:
                device.icon_name = "audio-input-microphone"
        multichannel-input: Multichannel Input (priority 0, latency offset 0 usec, available: unknown)
            properties:

    index: 18
    name: <alsa_card.usb-Lenovo_ThinkPad_Thunderbolt_3_Dock_USB_Audio_000000000000-00>
    driver: <module-alsa-card.c>
    owner module: 45
    properties:
        alsa.card = "2"
        alsa.card_name = "ThinkPad Thunderbolt 3 Dock USB"
        alsa.long_card_name = "Lenovo ThinkPad Thunderbolt 3 Dock USB at usb-0000:09:00.0-2.1.1.4, full speed"
        alsa.driver_name = "snd_usb_audio"
        device.bus_path = "pci-0000:09:00.0-usb-0:2.1.1.4:1.0"
        sysfs.path = "/devices/pci0000:00/0000:00:1b.4/0000:04:00.0/0000:05:01.0/0000:07:00.0/0000:08:02.0/0000:09:00.0/usb3/3-2/3-2.1/3-2.1.1/3-2.1.1.4/3-2.1.1.4:1.0/sound/card2"
        udev.id = "usb-Lenovo_ThinkPad_Thunderbolt_3_Dock_USB_Audio_000000000000-00"
        device.bus = "usb"
        device.vendor.id = "17ef"
        device.vendor.name = "Lenovo"
        device.product.id = "3083"
        device.product.name = "ThinkPad Thunderbolt 3 Dock USB Audio"
        device.serial = "Lenovo_ThinkPad_Thunderbolt_3_Dock_USB_Audio_000000000000"
        device.string = "2"
        device.description = "ThinkPad Thunderbolt 3 Dock USB Audio"
        module-udev-detect.discovered = "1"
        device.icon_name = "audio-card-usb"
    profiles:
        input:mono-fallback: Mono Input (priority 1, available: unknown)
        input:multichannel-input: Multichannel Input (priority 1, available: unknown)
        output:analog-stereo: Analog Stereo Output (priority 6500, available: unknown)
        output:analog-stereo+input:mono-fallback: Analog Stereo Output + Mono Input (priority 6501, available: unknown)
        output:analog-stereo+input:multichannel-input: Analog Stereo Output + Multichannel Input (priority 6501, available: unknown)
        output:iec958-stereo: Digital Stereo (IEC958) Output (priority 5500, available: unknown)
        output:iec958-stereo+input:mono-fallback: Digital Stereo (IEC958) Output + Mono Input (priority 5501, available: unknown)
        output:iec958-stereo+input:multichannel-input: Digital Stereo (IEC958) Output + Multichannel Input (priority 5501, available: unknown)
        off: Off (priority 0, available: unknown)
    active profile: <output:analog-stereo+input:multichannel-input>
    sinks:
        alsa_output.usb-Lenovo_ThinkPad_Thunderbolt_3_Dock_USB_Audio_000000000000-00.analog-stereo/#22: ThinkPad Thunderbolt 3 Dock USB Audio Analog Stereo
    sources:
        alsa_output.usb-Lenovo_ThinkPad_Thunderbolt_3_Dock_USB_Audio_000000000000-00.analog-stereo.monitor/#45: Monitor of ThinkPad Thunderbolt 3 Dock USB Audio Analog Stereo
        alsa_input.usb-Lenovo_ThinkPad_Thunderbolt_3_Dock_USB_Audio_000000000000-00.multichannel-input/#47: ThinkPad Thunderbolt 3 Dock USB Audio Multichannel
    ports:
        analog-input-headset-mic: Headset Microphone (priority 8800, latency offset 0 usec, available: unknown)
            properties:
                device.icon_name = "audio-input-microphone"
        multichannel-input: Multichannel Input (priority 0, latency offset 0 usec, available: unknown)
            properties:

        analog-output: Analog Output (priority 9900, latency offset 0 usec, available: unknown)
            properties:

        iec958-stereo-output: Digital Output (S/PDIF) (priority 0, latency offset 0 usec, available: unknown)
            properties:

当我打开 pavucontrol 时,这是我的接收器:

2 sink(s) available.
    index: 2
    name: <alsa_output.pci-0000_00_1f.3.analog-stereo>
    driver: <module-alsa-card.c>
    flags: HARDWARE HW_MUTE_CTRL HW_VOLUME_CTRL DECIBEL_VOLUME LATENCY DYNAMIC_LATENCY
    state: IDLE
    suspend cause: (none)
    priority: 9039
    volume: front-left: 65536 / 100% / 0.00 dB,   front-right: 65536 / 100% / 0.00 dB
            balance 0.00
    base volume: 65536 / 100% / 0.00 dB
    volume steps: 65537
    muted: no
    current latency: 30.90 ms
    max request: 7 KiB
    max rewind: 7 KiB
    monitor source: 4
    sample spec: s16le 2ch 48000Hz
    channel map: front-left,front-right
                 Stereo
    used by: 0
    linked by: 1
    configured latency: 40.00 ms; range is 0.50 .. 341.33 ms
    card: 3 <alsa_card.pci-0000_00_1f.3>
    module: 26
    properties:
        alsa.resolution_bits = "16"
        device.api = "alsa"
        device.class = "sound"
        alsa.class = "generic"
        alsa.subclass = "generic-mix"
        alsa.name = "ALC285 Analog"
        alsa.id = "ALC285 Analog"
        alsa.subdevice = "0"
        alsa.subdevice_name = "subdevice #0"
        alsa.device = "0"
        alsa.card = "0"
        alsa.card_name = "HDA Intel PCH"
        alsa.long_card_name = "HDA Intel PCH at 0x404a108000 irq 192"
        alsa.driver_name = "snd_hda_intel"
        device.bus_path = "pci-0000:00:1f.3"
        sysfs.path = "/devices/pci0000:00/0000:00:1f.3/sound/card0"
        device.bus = "pci"
        device.vendor.id = "8086"
        device.vendor.name = "Intel Corporation"
        device.product.id = "a348"
        device.product.name = "Cannon Lake PCH cAVS"
        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"
        module-udev-detect.discovered = "1"
        device.icon_name = "audio-card-pci"
    ports:
        analog-output-speaker: Speakers (priority 10000, latency offset 0 usec, available: yes)
            properties:
                device.icon_name = "audio-speakers"
        analog-output-headphones: Headphones (priority 9900, latency offset 0 usec, available: no)
            properties:
                device.icon_name = "audio-headphones"
    active port: <analog-output-speaker>
  * index: 22
    name: <alsa_output.usb-Lenovo_ThinkPad_Thunderbolt_3_Dock_USB_Audio_000000000000-00.analog-stereo>
    driver: <module-alsa-card.c>
    flags: HARDWARE HW_MUTE_CTRL DECIBEL_VOLUME LATENCY DYNAMIC_LATENCY
    state: RUNNING
    suspend cause: (none)
    priority: 9049
    volume: front-left: 15631 /  24% / -37.35 dB,   front-right: 15631 /  24% / -37.35 dB
            balance 0.00
    base volume: 65536 / 100% / 0.00 dB
    volume steps: 65537
    muted: no
    current latency: 42.68 ms
    max request: 7 KiB
    max rewind: 7 KiB
    monitor source: 45
    sample spec: s16le 2ch 48000Hz
    channel map: front-left,front-right
                 Stereo
    used by: 1
    linked by: 3
    configured latency: 40.00 ms; range is 0.50 .. 1837.50 ms
    card: 18 <alsa_card.usb-Lenovo_ThinkPad_Thunderbolt_3_Dock_USB_Audio_000000000000-00>
    module: 45
    properties:
        alsa.resolution_bits = "16"
        device.api = "alsa"
        device.class = "sound"
        alsa.class = "generic"
        alsa.subclass = "generic-mix"
        alsa.name = "USB Audio"
        alsa.id = "USB Audio"
        alsa.subdevice = "0"
        alsa.subdevice_name = "subdevice #0"
        alsa.device = "0"
        alsa.card = "2"
        alsa.card_name = "ThinkPad Thunderbolt 3 Dock USB"
        alsa.long_card_name = "Lenovo ThinkPad Thunderbolt 3 Dock USB at usb-0000:09:00.0-2.1.1.4, full speed"
        alsa.driver_name = "snd_usb_audio"
        device.bus_path = "pci-0000:09:00.0-usb-0:2.1.1.4:1.0"
        sysfs.path = "/devices/pci0000:00/0000:00:1b.4/0000:04:00.0/0000:05:01.0/0000:07:00.0/0000:08:02.0/0000:09:00.0/usb3/3-2/3-2.1/3-2.1.1/3-2.1.1.4/3-2.1.1.4:1.0/sound/card2"
        udev.id = "usb-Lenovo_ThinkPad_Thunderbolt_3_Dock_USB_Audio_000000000000-00"
        device.bus = "usb"
        device.vendor.id = "17ef"
        device.vendor.name = "Lenovo"
        device.product.id = "3083"
        device.product.name = "ThinkPad Thunderbolt 3 Dock USB Audio"
        device.serial = "Lenovo_ThinkPad_Thunderbolt_3_Dock_USB_Audio_000000000000"
        device.string = "front:2"
        device.buffering.buffer_size = "352800"
        device.buffering.fragment_size = "176400"
        device.access_mode = "mmap+timer"
        device.profile.name = "analog-stereo"
        device.profile.description = "Analog Stereo"
        device.description = "ThinkPad Thunderbolt 3 Dock USB Audio Analog Stereo"
        module-udev-detect.discovered = "1"
        device.icon_name = "audio-card-usb"
    ports:
        analog-output: Analog Output (priority 9900, latency offset 0 usec, available: unknown)
            properties:

    active port: <analog-output>

关闭 pavucontrol 后,请注意两个接收器上的延迟如何变化:

2 sink(s) available.
    index: 2
    name: <alsa_output.pci-0000_00_1f.3.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: 9039
    volume: front-left: 65536 / 100% / 0.00 dB,   front-right: 65536 / 100% / 0.00 dB
            balance 0.00
    base volume: 65536 / 100% / 0.00 dB
    volume steps: 65537
    muted: no
    current latency: 0.00 ms
    max request: 0 KiB
    max rewind: 0 KiB
    monitor source: 4
    sample spec: s16le 2ch 48000Hz
    channel map: front-left,front-right
                 Stereo
    used by: 0
    linked by: 0
    configured latency: 0.00 ms; range is 0.50 .. 341.33 ms
    card: 3 <alsa_card.pci-0000_00_1f.3>
    module: 26
    properties:
        alsa.resolution_bits = "16"
        device.api = "alsa"
        device.class = "sound"
        alsa.class = "generic"
        alsa.subclass = "generic-mix"
        alsa.name = "ALC285 Analog"
        alsa.id = "ALC285 Analog"
        alsa.subdevice = "0"
        alsa.subdevice_name = "subdevice #0"
        alsa.device = "0"
        alsa.card = "0"
        alsa.card_name = "HDA Intel PCH"
        alsa.long_card_name = "HDA Intel PCH at 0x404a108000 irq 192"
        alsa.driver_name = "snd_hda_intel"
        device.bus_path = "pci-0000:00:1f.3"
        sysfs.path = "/devices/pci0000:00/0000:00:1f.3/sound/card0"
        device.bus = "pci"
        device.vendor.id = "8086"
        device.vendor.name = "Intel Corporation"
        device.product.id = "a348"
        device.product.name = "Cannon Lake PCH cAVS"
        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"
        module-udev-detect.discovered = "1"
        device.icon_name = "audio-card-pci"
    ports:
        analog-output-speaker: Speakers (priority 10000, latency offset 0 usec, available: yes)
            properties:
                device.icon_name = "audio-speakers"
        analog-output-headphones: Headphones (priority 9900, latency offset 0 usec, available: no)
            properties:
                device.icon_name = "audio-headphones"
    active port: <analog-output-speaker>
  * index: 22
    name: <alsa_output.usb-Lenovo_ThinkPad_Thunderbolt_3_Dock_USB_Audio_000000000000-00.analog-stereo>
    driver: <module-alsa-card.c>
    flags: HARDWARE HW_MUTE_CTRL DECIBEL_VOLUME LATENCY DYNAMIC_LATENCY
    state: RUNNING
    suspend cause: (none)
    priority: 9049
    volume: front-left: 15631 /  24% / -37.35 dB,   front-right: 15631 /  24% / -37.35 dB
            balance 0.00
    base volume: 65536 / 100% / 0.00 dB
    volume steps: 65537
    muted: no
    current latency: 628.73 ms
    max request: 183 KiB
    max rewind: 183 KiB
    monitor source: 45
    sample spec: s16le 2ch 48000Hz
    channel map: front-left,front-right
                 Stereo
    used by: 1
    linked by: 1
    configured latency: 980.00 ms; range is 0.50 .. 1837.50 ms
    card: 18 <alsa_card.usb-Lenovo_ThinkPad_Thunderbolt_3_Dock_USB_Audio_000000000000-00>
    module: 45
    properties:
        alsa.resolution_bits = "16"
        device.api = "alsa"
        device.class = "sound"
        alsa.class = "generic"
        alsa.subclass = "generic-mix"
        alsa.name = "USB Audio"
        alsa.id = "USB Audio"
        alsa.subdevice = "0"
        alsa.subdevice_name = "subdevice #0"
        alsa.device = "0"
        alsa.card = "2"
        alsa.card_name = "ThinkPad Thunderbolt 3 Dock USB"
        alsa.long_card_name = "Lenovo ThinkPad Thunderbolt 3 Dock USB at usb-0000:09:00.0-2.1.1.4, full speed"
        alsa.driver_name = "snd_usb_audio"
        device.bus_path = "pci-0000:09:00.0-usb-0:2.1.1.4:1.0"
        sysfs.path = "/devices/pci0000:00/0000:00:1b.4/0000:04:00.0/0000:05:01.0/0000:07:00.0/0000:08:02.0/0000:09:00.0/usb3/3-2/3-2.1/3-2.1.1/3-2.1.1.4/3-2.1.1.4:1.0/sound/card2"
        udev.id = "usb-Lenovo_ThinkPad_Thunderbolt_3_Dock_USB_Audio_000000000000-00"
        device.bus = "usb"
        device.vendor.id = "17ef"
        device.vendor.name = "Lenovo"
        device.product.id = "3083"
        device.product.name = "ThinkPad Thunderbolt 3 Dock USB Audio"
        device.serial = "Lenovo_ThinkPad_Thunderbolt_3_Dock_USB_Audio_000000000000"
        device.string = "front:2"
        device.buffering.buffer_size = "352800"
        device.buffering.fragment_size = "176400"
        device.access_mode = "mmap+timer"
        device.profile.name = "analog-stereo"
        device.profile.description = "Analog Stereo"
        device.description = "ThinkPad Thunderbolt 3 Dock USB Audio Analog Stereo"
        module-udev-detect.discovered = "1"
        device.icon_name = "audio-card-usb"
    ports:
        analog-output: Analog Output (priority 9900, latency offset 0 usec, available: unknown)
            properties:

    active port: <analog-output>

相关内容