我怎样才能恢复 pacmd list-cards 中未列出的声卡?

我怎样才能恢复 pacmd list-cards 中未列出的声卡?

我在跑

$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 20.04.1 LTS
Release:    20.04
Codename:   focal

我的声卡列在

$ lspci -v
...
00:1b.0 Audio device: Intel Corporation 5 Series/3400 Series Chipset High Definition Audio (rev 06)
    Subsystem: Micro-Star International Co., Ltd. [MSI] 5 Series/3400 Series Chipset High Definition Audio
    Flags: bus master, fast devsel, latency 0, IRQ 36
    Memory at f7ff8000 (64-bit, non-prefetchable) [size=16K]
    Capabilities: <access denied>
    Kernel driver in use: snd_hda_intel
    Kernel modules: snd_hda_intel
...
01:00.1 Audio device: NVIDIA Corporation GF104 High Definition Audio Controller (rev a1)
    Flags: bus master, fast devsel, latency 0, IRQ 17
    Memory at fbc7c000 (32-bit, non-prefetchable) [size=16K]
    Capabilities: <access denied>
    Kernel driver in use: snd_hda_intel
    Kernel modules: snd_hda_intel
...

直到昨天,我的声音一直正常工作,无需通过英特尔声卡进行任何特殊配置。昨天它停止了,我找不到原因。也许是在使用 docker 时无意中发生了一些更新或配置更改,对声音没有任何影响。我可以排除硬件缺陷,因为在 Windows 下一切都保持不变。

未找到英特尔声卡

$ pacmd list-cards
1 card(s) available.
    index: 0
    name: <alsa_card.pci-0000_01_00.1>
    driver: <module-alsa-card.c>
    owner module: 7
    properties:
        alsa.card = "1"
        alsa.card_name = "HDA NVidia"
        alsa.long_card_name = "HDA NVidia at 0xfbc7c000 irq 17"
        alsa.driver_name = "snd_hda_intel"
        device.bus_path = "pci-0000:01:00.1"
        sysfs.path = "/devices/pci0000:00/0000:00:03.0/0000:01:00.1/sound/card1"
        device.bus = "pci"
        device.vendor.id = "10de"
        device.vendor.name = "NVIDIA Corporation"
        device.product.id = "0beb"
        device.product.name = "GF104 High Definition Audio Controller"
        device.string = "1"
        device.description = "GF104 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)
        output:hdmi-stereo-extra3: Digital Stereo (HDMI 4) Output (priority 5700, available: no)
        output:hdmi-surround-extra3: Digital Surround 5.1 (HDMI 4) Output (priority 600, available: no)
        output:hdmi-surround71-extra3: Digital Surround 7.1 (HDMI 4) 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"
        hdmi-output-3: HDMI / DisplayPort 4 (priority 5600, latency offset 0 usec, available: no)
            properties:
                device.icon_name = "video-display"

但在

$ cat /proc/asound/cards
 0 [MID            ]: HDA-Intel - HDA Intel MID
                      HDA Intel MID at 0xf7ff8000 irq 36
 1 [NVidia         ]: HDA-Intel - HDA NVidia
                      HDA NVidia at 0xfbc7c000 irq 17

以及

$ aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: MID [HDA Intel MID], device 0: ALC889 Analog [ALC889 Analog]
  Subdevices: 0/1
  Subdevice #0: subdevice #0
card 0: MID [HDA Intel MID], device 1: ALC889 Digital [ALC889 Digital]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: NVidia [HDA NVidia], device 3: HDMI 0 [HDMI 0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: NVidia [HDA NVidia], device 7: HDMI 0 [HDMI 0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: NVidia [HDA NVidia], device 8: HDMI 0 [HDMI 0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: NVidia [HDA NVidia], device 9: HDMI 0 [HDMI 0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

$ pavucontrol只显示Dummy Output

我已经尝试过了

  1. sudo apt-get install --reinstall alsa-base pulseaudio sudo alsa force-reloadUbuntu 20.10 重启后声音停止工作

  2. pulseaudio -k && sudo alsa force-reloadUbuntu 16.04 中的“虚拟输出”没有声音(虽然没有尝试在 BIOS 中禁用)

  3. sudo killall pulseaudio rm -rf ~/.config/pulse pulseaudio -kpactl 中的声卡消失了

我还发现LSPCI 找到了我的声卡,但 alsa 和 pacmd 没有找到但没有可以接受的答案所以我不想再弄乱任何事情。

有什么办法可以修复这个问题吗?

更新:我尝试将 dist-upgrade 升级到 20.10 来修复这个问题,但没有成功。但有些事情发生了变化:

$ pacmd list-cards
2 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 0xfbc7c000 irq 17"
        alsa.driver_name = "snd_hda_intel"
        device.bus_path = "pci-0000:01:00.1"
        sysfs.path = "/devices/pci0000:00/0000:00:03.0/0000:01:00.1/sound/card1"
        device.bus = "pci"
        device.vendor.id = "10de"
        device.vendor.name = "NVIDIA Corporation"
        device.product.id = "0beb"
        device.product.name = "GF104 High Definition Audio Controller"
        device.string = "1"
        device.description = "GF104 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)
        output:hdmi-stereo-extra3: Digital Stereo (HDMI 4) Output (priority 5700, available: no)
        output:hdmi-surround-extra3: Digital Surround 5.1 (HDMI 4) Output (priority 600, available: no)
        output:hdmi-surround71-extra3: Digital Surround 7.1 (HDMI 4) 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"
        hdmi-output-3: HDMI / DisplayPort 4 (priority 5600, latency offset 0 usec, available: no)
            properties:
                device.icon_name = "video-display"
    index: 1
    name: <alsa_card.pci-0000_00_1b.0>
    driver: <module-alsa-card.c>
    owner module: 24
    properties:
        alsa.card = "0"
        alsa.card_name = "HDA Intel MID"
        alsa.long_card_name = "HDA Intel MID at 0xf7ff8000 irq 36"
        alsa.driver_name = "snd_hda_intel"
        device.bus_path = "pci-0000:00:1b.0"
        sysfs.path = "/devices/pci0000:00/0000:00:1b.0/sound/card0"
        device.bus = "pci"
        device.vendor.id = "8086"
        device.vendor.name = "Intel Corporation"
        device.product.id = "3b56"
        device.product.name = "5 Series/3400 Series Chipset High Definition Audio"
        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: no)
        output:analog-stereo: Analog Stereo Output (priority 6500, available: unknown)
        output:analog-stereo+input:analog-stereo: Analog Stereo Duplex (priority 6565, available: no)
        output:analog-surround-21: Analog Surround 2.1 Output (priority 1300, available: unknown)
        output:analog-surround-21+input:analog-stereo: Analog Surround 2.1 Output + Analog Stereo Input (priority 1365, available: no)
        output:analog-surround-40: Analog Surround 4.0 Output (priority 1200, available: unknown)
        output:analog-surround-40+input:analog-stereo: Analog Surround 4.0 Output + Analog Stereo Input (priority 1265, available: no)
        output:analog-surround-41: Analog Surround 4.1 Output (priority 1300, available: unknown)
        output:analog-surround-41+input:analog-stereo: Analog Surround 4.1 Output + Analog Stereo Input (priority 1365, available: no)
        output:analog-surround-50: Analog Surround 5.0 Output (priority 1200, available: unknown)
        output:analog-surround-50+input:analog-stereo: Analog Surround 5.0 Output + Analog Stereo Input (priority 1265, available: no)
        output:analog-surround-51: Analog Surround 5.1 Output (priority 1300, available: unknown)
        output:analog-surround-51+input:analog-stereo: Analog Surround 5.1 Output + Analog Stereo Input (priority 1365, available: no)
        output:analog-surround-71: Analog Surround 7.1 Output (priority 1200, available: unknown)
        output:analog-surround-71+input:analog-stereo: Analog Surround 7.1 Output + Analog Stereo Input (priority 1265, available: no)
        output:iec958-stereo: Digital Stereo (IEC958) Output (priority 5500, available: unknown)
        output:iec958-stereo+input:analog-stereo: Digital Stereo (IEC958) Output + Analog Stereo Input (priority 5565, available: no)
        off: Off (priority 0, available: unknown)
    active profile: <output:analog-surround-51>
    ports:
        analog-input-front-mic: Front Microphone (priority 8500, latency offset 0 usec, available: no)
            properties:
                device.icon_name = "audio-input-microphone"
        analog-input-rear-mic: Rear Microphone (priority 8200, latency offset 0 usec, available: no)
            properties:
                device.icon_name = "audio-input-microphone"
        analog-input-linein: Line In (priority 8100, latency offset 0 usec, available: no)
            properties:
                
        analog-output-lineout: Line Out (priority 9000, latency offset 0 usec, available: yes)
            properties:
                
        analog-output-headphones: Headphones (priority 9900, latency offset 0 usec, available: no)
            properties:
                device.icon_name = "audio-headphones"
        iec958-stereo-output: Digital Output (S/PDIF) (priority 0, latency offset 0 usec, available: unknown)
            properties:

pavucontrol仍然只显示虚拟设备。升级后,设备出现在“声音设置”中,但没有输出任何内容,更改配置文件后消失。几分钟后,重新执行上述命令,现在显示设备,但不播放任何声音,也没有在“测试”对话框中显示任何扬声器。

更新:我对此感到非常沮丧。所以我创建了一个备份和一个安装脚本,以便将来毫不费力地从头开始设置我的系统。重新安装后,一切都恢复正常。很抱歉没有为遇到此问题的人发布解决方案。

答案1

也许这个答案可以帮助一些人。我遇到了同样的问题,在脉冲下找不到 GPU 输出设备。原来我安装了 NVIDIA 服务器驱动程序。

您可以通过输入来检查$nvidia-smi NVIDIA 驱动程序版本

相关内容