在Ubuntu 20.04中重新启动后,只有"虚拟输出"(声音) - 损坏的驱动程序/模块

分享于 

13分钟阅读

ubuntu

  繁體

问题:

我现在用Ubuntu 20.04超过一个月了,重新启动后,声音和WiFi没了,

  • 没有/proc/asound目录,
  • 
     $ cat /proc/asound/cards
    
    
     0 [PCH ]: HDA-Intel - HDA Intel PCH
    
    
     HDA Intel PCH at 0x604b108000 irq 159
    
    
     1 [NVidia ]: HDA-Intel - HDA NVidia
    
    
     HDA NVidia at 0xa4000000 irq 17
    
    
    
    
  • $ lsmod | grep snd 无输出,比较(也比较)
  • 
     $ lsmod | grep snd_hda_intel
    
    
     snd_hda_intel 53248 10
    
    
     snd_intel_dspcfg 24576 3 snd_hda_intel,snd_sof_pci,snd_sof_intel_hda_common
    
    
     snd_hda_codec 131072 5 snd_hda_codec_generic,snd_hda_codec_hdmi,snd_hda_intel,snd_hda_codec_realtek,snd_soc_hdac_hda
    
    
     snd_hda_core 90112 9 snd_hda_codec_generic,snd_hda_codec_hdmi,snd_hda_intel,snd_hda_ext_core,snd_hda_codec,snd_hda_codec_realtek,snd_sof_intel_hda_common,snd_soc_hdac_hda,snd_sof_intel_hda
    
    
     snd_pcm 106496 9 snd_hda_codec_hdmi,snd_hda_intel,snd_hda_codec,snd_sof,snd_sof_intel_hda_common,snd_soc_core,snd_hda_core,snd_pcm_dmaengine
    
    
     snd 90112 33 snd_hda_codec_generic,snd_seq,snd_seq_device,snd_hda_codec_hdmi,snd_hwdep,snd_hda_intel,snd_hda_codec,snd_hda_codec_realtek,snd_timer,snd_compress,thinkpad_acpi,snd_soc_core,snd_pcm,snd_rawmidi
    
    
    
    
  • 内核模块
  • 
     $ dpkg -L linux-modules-5.4.0-40-generic | grep snd
    
    
     /lib/modules/5.4.0-40-generic/kernel/sound/core/seq/snd-seq-dummy.ko
    
    
     /lib/modules/5.4.0-40-generic/kernel/sound/core/seq/snd-seq-midi-emul.ko
    
    
     /lib/modules/5.4.0-40-generic/kernel/sound/core/seq/snd-seq-midi-event.ko
    
    
     /lib/modules/5.4.0-40-generic/kernel/sound/core/seq/snd-seq-midi.ko
    
    
     /lib/modules/5.4.0-40-generic/kernel/sound/core/seq/snd-seq-virmidi.ko
    
    
     /lib/modules/5.4.0-40-generic/kernel/sound/core/seq/snd-seq.ko
    
    
     /lib/modules/5.4.0-40-generic/kernel/sound/core/snd-compress.ko
    
    
     /lib/modules/5.4.0-40-generic/kernel/sound/core/snd-hrtimer.ko
    
    
     /lib/modules/5.4.0-40-generic/kernel/sound/core/snd-hwdep.ko
    
    
     /lib/modules/5.4.0-40-generic/kernel/sound/core/snd-pcm-dmaengine.ko
    
    
     /lib/modules/5.4.0-40-generic/kernel/sound/core/snd-pcm.ko
    
    
     /lib/modules/5.4.0-40-generic/kernel/sound/core/snd-rawmidi.ko
    
    
     /lib/modules/5.4.0-40-generic/kernel/sound/core/snd-seq-device.ko
    
    
     /lib/modules/5.4.0-40-generic/kernel/sound/core/snd-timer.ko
    
    
     /lib/modules/5.4.0-40-generic/kernel/sound/core/snd.ko
    
    
     /lib/modules/5.4.0-40-generic/kernel/sound/drivers/pcsp/snd-pcsp.ko
    
    
     /lib/modules/5.4.0-40-generic/kernel/sound/pci/snd-ens1370.ko
    
    
    
    

    如何加载这些模块?

  • inxi
  • 
     $ inxi -SA
    
    
     System: Host: Hydrus1 Kernel: 5.4.0-40-generic x86_64 bits: 64 Desktop: Gnome 3.36.1 Distro: Ubuntu 20.04 LTS (Focal Fossa) 
    
    
     Audio: Device-1: Intel 6 Series/C200 Series Family High Definition Audio driver: N/A 
    
    
     Device-2: NVIDIA GF104 High Definition Audio driver: N/A 
    
    
    
    
    
     $ inxi -SA
    
    
     System: Host: ViaLactea Kernel: 5.4.0-40-generic x86_64 bits: 64 Console: tty 0 Distro: Ubuntu 20.04 LTS (Focal Fossa)
    
    
     Audio: Device-1: Intel Cannon Lake PCH cAVS driver: snd_hda_intel
    
    
     Device-2: NVIDIA GP107GL High Definition Audio driver: snd_hda_intel
    
    
     Sound Server: ALSA v: k5.4.0-40-generic
    
    
    
    
  • lspci

    
    $ lspci -nnk | grep -A 1 Audio
    
    
    00:1b.0 Audio device [0403]: Intel Corporation 6 Series/C200 Series Chipset Family High Definition Audio Controller [8086:1c20] (rev 04)
    
    
     DeviceName: Onboard Audio
    
    
     Subsystem: Dell 6 Series/C200 Series Chipset Family High Definition Audio Controller [1028:04a4]
    
    
    00:1c.0 PCI bridge [0604]: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 1 [8086:1c10] (rev b4)
    
    
    --
    
    
    01:00.1 Audio device [0403]: NVIDIA Corporation GF104 High Definition Audio Controller [10de:0beb] (rev a1)
    
    
     Subsystem: Dell GF104 High Definition Audio Controller [1028:04a4]
    
    
    03:00.0 Network controller [0280]: Intel Corporation Centrino Ultimate-N 6300 [8086:422b] (rev 35)
    
    
    
    
  • 
     $ lspci -nnk | grep -n -A 4 Audio
    
    
     49:00:1f.3 Audio device [0403]: Intel Corporation Cannon Lake PCH cAVS [8086:a348] (rev 10)
    
    
     50- Subsystem: Lenovo Cannon Lake PCH cAVS [17aa:225f]
    
    
     51- Kernel driver in use: snd_hda_intel
    
    
     52- Kernel modules: snd_hda_intel, snd_sof_pci
    
    
     53-00:1f.4 SMBus [0c05]: Intel Corporation Cannon Lake PCH SMBus Controller [8086:a323] (rev 10)
    
    
     --
    
    
     67:01:00.1 Audio device [0403]: NVIDIA Corporation GP107GL High Definition Audio Controller [10de:0fb9] (rev a1)
    
    
     68- Kernel driver in use: snd_hda_intel
    
    
     69- Kernel modules: snd_hda_intel
    
    
     70-70:00.0 Unassigned class [ff00]: Realtek Semiconductor Co., Ltd. RTS525A PCI Express Card Reader [10ec:525a] (rev 01)
    
    
     71- Subsystem: Lenovo RTS525A PCI Express Card Reader [17aa:225f]
    
    
    
    
  • 
    $ uname -a
    
    
    Linux Hydrus1 5.4.0-40-generic #44-Ubuntu SMP Tue Jun 23 00:01:04 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
    
    
    
    
  • 测试声音

    
    $ aplay -l
    
    
    aplay: device_list:274: no soundcards found...
    
    
    
    
  • 
     $ aplay -l
    
    
     **** List of PLAYBACK Hardware Devices ****
    
    
     card 0: PCH [HDA Intel PCH], device 0: ALC285 Analog [ALC285 Analog]
    
    
     Subdevices: 0/1
    
    
     Subdevice #0: subdevice #0
    
    
     card 0: PCH [HDA Intel PCH], device 3: HDMI 0 [HDMI 0]
    
    
     Subdevices: 1/1
    
    
     Subdevice #0: subdevice #0
    
    
     ...
    
    
    
    
  • lshw
  • 
     $ lshw -C multimedia
    
    
     WARNING: you should run this program as super-user.
    
    
     *-multimedia UNCLAIMED 
    
    
     description: Audio device
    
    
     product: GF104 High Definition Audio Controller
    
    
     vendor: NVIDIA Corporation
    
    
     physical id: 0.1
    
    
     bus info: pci@0000:01:00.1
    
    
     version: a1
    
    
     width: 32 bits
    
    
     clock: 33MHz
    
    
     capabilities: bus_master cap_list
    
    
     configuration: latency=0
    
    
     resources: memory:e0080000-e0083fff
    
    
     *-multimedia UNCLAIMED
    
    
     description: Audio device
    
    
     product: 6 Series/C200 Series Chipset Family High Definition Audio Controller
    
    
     vendor: Intel Corporation
    
    
     physical id: 1b
    
    
     bus info: pci@0000:00:1b.0
    
    
     version: 04
    
    
     width: 64 bits
    
    
     clock: 33MHz
    
    
     capabilities: bus_master cap_list
    
    
     configuration: latency=0
    
    
     resources: memory:e1e50000-e1e53fff
    
    
     WARNING: output may be incomplete or inaccurate, you should run this program as super-user.
    
    
    
    
    
     $ sudo lshw -C multimedia
    
    
     *-multimedia 
    
    
     description: Audio device
    
    
     product: GP104 High Definition Audio Controller
    
    
     vendor: NVIDIA Corporation
    
    
     physical id: 0.1
    
    
     bus info: pci@0000:01:00.1
    
    
     version: a1
    
    
     width: 32 bits
    
    
     clock: 33MHz
    
    
     capabilities: pm msi pciexpress bus_master cap_list
    
    
     configuration: driver=snd_hda_intel latency=0
    
    
     resources: irq:17 memory:f7080000-f7083fff
    
    
    
    
  • alsa软件包

    
    $ dpkg -l | grep alsa
    
    
    ii alsa-base 1.0.25+dfsg-0ubuntu5 all ALSA driver configuration files
    
    
    ii alsa-tools-gui 1.1.7-1ubuntu1 amd64 GUI based ALSA utilities for specific hardware
    
    
    ii alsa-topology-conf 1.2.2-1 all ALSA topology configuration files
    
    
    ii alsa-ucm-conf 1.2.2-1ubuntu0.1 all ALSA Use Case Manager configuration files
    
    
    ii alsa-utils 1.2.2-1ubuntu1 amd64 Utilities for configuring and using ALSA
    
    
    ii gstreamer1.0-alsa:amd64 1.16.2-4 amd64 GStreamer plugin for ALSA
    
    
    ii libsox-fmt-alsa:amd64 14.4.2+git20190427-2 amd64 SoX alsa format I/O library
    
    
    
    
  • 如果插入耳机,就没有声音。

  • 尝试重新加载

    
    $ sudo alsa force-reload
    
    
    [sudo] password for user1: 
    
    
    Unloading ALSA sound driver modules: (none loaded).
    
    
    Loading ALSA sound driver modules: (none to reload).
    
    
    
    
  • 自动处理可载入模块

    
    $ grep intel /etc/modprobe.d/alsa-base.conf 
    
    
    options snd-intel8x0m index=-2
    
    
    
    

  • 答案1:

    尝试检查所有依赖项是否正确:

    
    modprobe --show-depends snd_hda_intel 
    
    
    
    

    并检查内核模块是否存在:

    
    find /lib/modules/$(uname -r)/kernel/sound -name snd-hda-intel.ko
    
    
    
    

    也可以安装它 sudo apt install alsa-utils 运行脚本alsa-info,这将帮助你打印所有必要的信息,以便解决问题。

    由于内核本身丢失,你必须通过这个包安装它,例如:

    
    sudo apt install linux-modules-extra-$(uname -r)-generic
    
    
    
    

    答案2:

  • 在S1中:

    
     $ modprobe --show-depends snd_hda_intel
    
    
     modprobe: FATAL: Module snd_hda_intel not found in directory /lib/modules/5.4.0-40-generic
    
    
    
    

    在S2中:

    
     $ modprobe --show-depends snd_hda_intel
    
    
     insmod /lib/modules/5.4.0-40-generic/kernel/sound/soundcore.ko
    
    
     install /sbin/modprobe --ignore-install snd $CMDLINE_OPTS && { /sbin/modprobe --quiet --use-blacklist snd-ioctl32 ; /sbin/modprobe --quiet --use-blacklist snd-seq ; }
    
    
     insmod /lib/modules/5.4.0-40-generic/kernel/sound/core/snd-timer.ko
    
    
     install /sbin/modprobe --ignore-install snd-pcm $CMDLINE_OPTS && { /sbin/modprobe --quiet --use-blacklist snd-pcm-oss ; : ; }
    
    
     insmod /lib/modules/5.4.0-40-generic/kernel/sound/core/snd-hwdep.ko
    
    
     insmod /lib/modules/5.4.0-40-generic/kernel/sound/hda/snd-hda-core.ko
    
    
     insmod /lib/modules/5.4.0-40-generic/kernel/sound/pci/hda/snd-hda-codec.ko
    
    
     insmod /lib/modules/5.4.0-40-generic/kernel/sound/hda/snd-intel-dspcfg.ko
    
    
     insmod /lib/modules/5.4.0-40-generic/kernel/sound/pci/hda/snd-hda-intel.ko
    
    
    
    
  • 在S2中,我检查了所有者软件包中最后四个文件。

    
     $ dpkg -S /lib/modules/5.4.0-40-generic/kernel/sound/hda/snd-hda-core.ko
    
    
     linux-modules-extra-5.4.0-40-generic: /lib/modules/5.4.0-40-generic/kernel/sound/hda/snd-hda-core.ko
    
    
    
    

    我检查了,这个软件包没有安装在S1中。

  • iapt-get 软件包,重启,现在一切都恢复正常。

  • 结果是 linux-modules-extra-5.4.0-39-generic 也没有安装。

  • 在(已编译)内核驱动程序与(可加载)内核驱动程序/模块上:请参见这个


  • 答案3

    在最近的硬件升级之后,我遇到了Ubuntu 20.04的声音问题。

    可以进行以下更改,也许它也适合你。

    
    options snd-hda-intel model=auto
    
    
    
    

    在文件/etc/modprob.d/alsa-base.conf的末尾。



    bro  模块  Drive  OUT  Ubuntu  sound