音频驱动程序错误地映射到 Nvidia,导致 ubuntu 20.04 没有音频输入

音频驱动程序错误地映射到 Nvidia,导致 ubuntu 20.04 没有音频输入

当前内核是 5.15.10(自定义版本,无法降级,因为我的笔记本电脑有非常新的硬件,较低的内核不支持它们的某些驱动程序)。声音芯片是 Realtek ACL287。不知何故,在执行以下操作后,系统不显示任何音频输入和输出:

sudo apt-get remove --purge pulseaudio
sudo apt-get install pulseaudio
mv ~/.config/pulse ~/.config/new_pulse_conf

扬声器恢复了,但集成麦克风没有恢复(而且,无法再通过蓝牙配对任何音频设备)

我尝试过的解决方案没有声音 - Ubuntu 20.04 LTS

  1. 在 /etc/modprobe.d/alsa-base.conf 末尾添加选项 snd-hda-intel dmic_detect=0。
  2. 以root身份编辑/etc/modprobe.d/blacklist.conf,并在文件末尾添加黑名单snd_soc_skl。

还尝试了这里的所有解决方案:声卡未检测到

最后我发现问题出在 nvidia 驱动程序上,因为它以某种方式让系统将其选为音频设备而不是英特尔设备。

lspci 的输出:

lspci | grep Audio
01:00.1 Audio device: NVIDIA Corporation Device 2291 (rev a1)

输出aplay -l

**** List of PLAYBACK Hardware Devices ****
card 0: PCH [HDA Intel PCH], device 0: ALC287 Analog [ALC287 Analog]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: PCH [HDA Intel PCH], device 3: HDMI 0 [HDMI 0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: PCH [HDA Intel PCH], device 7: HDMI 1 [HDMI 1]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: PCH [HDA Intel PCH], device 8: HDMI 2 [HDMI 2]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: PCH [HDA Intel PCH], device 9: HDMI 3 [HDMI 3]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: PCH [HDA Intel PCH], device 10: HDMI 4 [HDMI 4]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: PCH [HDA Intel PCH], device 11: HDMI 5 [HDMI 5]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: PCH [HDA Intel PCH], device 12: HDMI 6 [HDMI 6]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: PCH [HDA Intel PCH], device 13: HDMI 7 [HDMI 7]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: PCH [HDA Intel PCH], device 14: HDMI 8 [HDMI 8]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: PCH [HDA Intel PCH], device 15: HDMI 9 [HDMI 9]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: PCH [HDA Intel PCH], device 16: HDMI 10 [HDMI 10]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: PCH [HDA Intel PCH], device 17: HDMI 11 [HDMI 11]
  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 1 [HDMI 1]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: NVidia [HDA NVidia], device 8: HDMI 2 [HDMI 2]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: NVidia [HDA NVidia], device 9: HDMI 3 [HDMI 3]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: NVidia [HDA NVidia], device 10: HDMI 4 [HDMI 4]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: NVidia [HDA NVidia], device 11: HDMI 5 [HDMI 5]
  Subdevices: 1/1

尝试使用覆盖驱动程序sudo driverctl set-override 0000:00:1f.3 snd_hda_intel,也尝试过sudo modprobe snd_hda_intel

当前输出:

sudo driverctl list-devices | grep snd_hda_intel
0000:00:1f.3 snd_hda_intel [*]
0000:01:00.1 snd_hda_intel

pactl 不显示任何输入源:

pactl list short sources
0   alsa_output.pci-0000_00_1f.3.analog-stereo.monitor  module-alsa-card.c  s16le 2ch 48000Hz   SUSPENDED

我的 Alsa 信息位于此处:http://alsa-project.org/db/?f=9399f1580f85e78cb2115e6242ba93c9bfdb204a

也尝试过强制 alsa 重新加载:sudo alsa force-reload并且也尝试过pavucontrol

不知道如果不同时弄乱 nvidia gpu 驱动程序和音频驱动程序我该怎么办。

答案1

经过搜索和尝试。问题是,由于 Intel 和 Nvidia 的驱动程序太多,导致 alsa 出现问题。对我有用的解决方案如下:

rm -r .config/pulse
sudo apt-get remove --purge pulseaudio
sudo apt-get install pulseaudio
pulseaudio -k
pulseaudio -vvv 

在执行最后一步时,它删除了不必要的驱动程序,但检索有效驱动程序需要很长时间。它可能需要几个小时,并且在生成正确的映射时会陷入困境。我不得不关闭它,但重新启动后,音频(输入/输出)实际上又开始工作了。也许再次重新启动会消除效果。

另外,对于遇到类似问题的其他用户,值得尝试: mv ~/.config/pulse ~/.config/new_pulse_conf重新安装后。重启后可以正常工作(但只能正常工作一次)。

相关内容