Ubuntu 21.04 上的 USB 耳机没有声音输出

Ubuntu 21.04 上的 USB 耳机没有声音输出

我刚刚从 Ubuntu 20.04 升级到 21.04。升级后,我无法将任何声音输出到 USB 耳机。耳机上的麦克风可以正常工作。输出到内置扬声器或耳机插孔也可以正常工作。

这在 Ubuntu 20.04 上运行良好。

在“声音”设置中,如果我尝试测试耳机,则不会显示任何扬声器。我测试的两款 USB 耳机(Sennheiser PC 8 和 Plantronics 5200)都出现这种情况

据我所知,音频实现已从 Pulseaudio 更改为 Pipewire。我通过 Google 找到的所有内容仍然指 Pulseaudio。所以我有点迷茫。

如能得到有关如何调试此问题的任何建议,我们将不胜感激。

测试弹出窗口中未显示扬声器

更新:

pactl 列表卡

显示耳机。我认为这看起来不错……但我不是专家。

Card #71
Name: alsa_card.usb-Sennheiser_Communications_Sennheiser_USB_headset-00
Driver: alsa
Owner Module: n/a
Properties:
    device.enum.api = "udev"
    device.api = "alsa"
    media.class = "Audio/Device"
    api.alsa.path = "hw:1"
    api.alsa.card = "1"
    api.alsa.card.name = "Sennheiser USB headset"
    api.alsa.card.longname = "Sennheiser Communications Sennheiser USB headset at usb-0000:00:14.0-2, full sp"
    device.plugged.usec = "998216405"
    device.bus_path = "pci-0000:00:14.0-usb-0:2:1.0"
    device.sysfs.path = "/sys/devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2:1.0/sound/card1"
    device.bus-id = "usb-Sennheiser_Communications_Sennheiser_USB_headset-00"
    device.bus = "usb"
    device.subsystem = "sound"
    device.vendor.id = "5013"
    device.vendor.name = "Sennheiser Communications"
    device.product.id = "37"
    device.product.name = "Headset [PC 8]"
    device.serial = "Sennheiser_Communications_Sennheiser_USB_headset"
    device.form_factor = "headset"
    device.name = "alsa_card.usb-Sennheiser_Communications_Sennheiser_USB_headset-00"
    device.description = "Headset [PC 8]"
    device.nick = "Sennheiser USB headset"
    device.icon_name = "audio-headset-usb"
    api.alsa.use-acp = "true"
    api.acp.auto-profile = "false"
    api.acp.auto-port = "false"
    api.dbus.ReserveDevice1 = "Audio1"
    factory.id = "14"
    client.id = "31"
    object.id = "71"
    object.path = "alsa:pcm:1"
    alsa.card = "1"
    alsa.card_name = "Sennheiser USB headset"
    alsa.long_card_name = "Sennheiser Communications Sennheiser USB headset at usb-0000:00:14.0-2, full sp"
    alsa.driver_name = "snd_usb_audio"
    device.string = "1"
Profiles:
    off: Off (sinks: 0, sources: 0, priority: 0, available: yes)
    output:analog-stereo+input:mono-fallback: Analog Stereo Output + Mono Input (sinks: 1, sources: 1, priority: 6501, available: yes)
    output:analog-stereo: Analog Stereo Output (sinks: 1, sources: 0, priority: 6500, available: yes)
    pro-audio: Pro Audio (sinks: 1, sources: 1, priority: 1, available: yes)
    input:mono-fallback: Mono Input (sinks: 0, sources: 1, priority: 1, available: yes)
Active Profile: output:analog-stereo+input:mono-fallback
Ports:
    analog-input-mic: Microphone (type: Mic, priority: 8700, latency offset: 0 usec, availability unknown)
        Properties:
            port.type = "mic"
            device.icon_name = "audio-input-microphone"
            card.profile.port = "0"
        Part of profile(s): input:mono-fallback, output:analog-stereo+input:mono-fallback
    analog-output-headphones: Headphones (type: Headphones, priority: 9900, latency offset: 0 usec, availability unknown)
        Properties:
            port.type = "headphones"
            device.icon_name = "audio-headphones"
            card.profile.port = "1"
        Part of profile(s): output:analog-stereo, output:analog-stereo+input:mono-fallback

但是,pactl list sinks short没有显示出来,只有内置扬声器在工作:

43  alsa_output.pci-0000_00_1f.3.analog-stereo  PipeWire    s32le 2ch 48000Hz   SUSPENDED

继续研究,我最终发现问题在于journalctl --user -u pipewire

Aug 02 10:46:32 backxp-HP-EliteBook-840-G5 pipewire[2007]: ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition 'cards.USB-Audio.pcm.front.0:CARD=1'
Aug 02 10:46:32 backxp-HP-EliteBook-840-G5 pipewire[2007]: ALSA lib conf.c:4745:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
Aug 02 10:46:32 backxp-HP-EliteBook-840-G5 pipewire[2007]: ALSA lib conf.c:5233:(snd_config_expand) Evaluate error: No such file or directory
Aug 02 10:46:32 backxp-HP-EliteBook-840-G5 pipewire[2007]: ALSA lib pcm.c:2660:(snd_pcm_open_noupdate) Unknown PCM front:1
Aug 02 10:46:32 backxp-HP-EliteBook-840-G5 pipewire[2007]: 'front:1': playback open failed: No such file or directory
Aug 02 10:46:32 backxp-HP-EliteBook-840-G5 pipewire[2007]: adapter 0x55c2e968c8b0: can't get format: No such file or directory
Aug 02 10:46:32 backxp-HP-EliteBook-840-G5 pipewire[2007]: usage: node.name=<string>

这让我看到了以下错误报告: https://gitlab.freedesktop.org/pipewire/pipewire/-/issues/332

我有 pipewire 0.3.32,所以我不明白为什么这不能解决我的问题。

答案1

在我的问题末尾提到的错误得到正确解决之前,我的问题的正确答案(和解决方法)似乎是手动重新启动所有与 Pipewire 相关的服务:

systemctl --user restart pipewire-media-session pipewire-pulse pipewire

更新:我已为此提交了一个新的 Pipewire 问题,因为我似乎无法重新打开前一个问题:https://gitlab.freedesktop.org/pipewire/pipewire/-/issues/1478

相关内容