Score:1

Audio driver mapped wrongly to Nvidia causing no audio input ubuntu 20.04

br flag

Current kernel is 5.15.10 (custom build, cannot downgrade as my laptop has very new hardware, lower kernels do not support some drivers for them). Sound chip is Realtek ACL287. Somehow the system does not show any audio input and output, after doing the following:

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

The speaker came back but not the integrated microphone (also, cannot pair any audio devices through bluetooth anymore)

Solutions that I've tried from No sound - Ubuntu 20.04 LTS:

  1. Add options snd-hda-intel dmic_detect=0 at the end of /etc/modprobe.d/alsa-base.conf.
  2. Edit /etc/modprobe.d/blacklist.conf as root and add the blacklist snd_soc_skl at the end of the file.

Also tried all the solutions that are from here: Sound card not detecting

Finally I figured out that the problem is due to the nvidia driver as it somehow makes the system to pick it up as the audio device instead of intel one.

Output of lspci:

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

Output for 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

Tried to override the driver using sudo driverctl set-override 0000:00:1f.3 snd_hda_intel and also tried sudo modprobe snd_hda_intel.

The current output:

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

pactl does not show any input source as:

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

My Alsa information is located here: http://alsa-project.org/db/?f=9399f1580f85e78cb2115e6242ba93c9bfdb204a

Tried also force alsa reload: sudo alsa force-reload and also tried pavucontrol.

No idea what I could do without mess up nvidia gpu driver and audio driver at the same time..

user10489 avatar
in flag
When you purged the audio driver, it probably took out other things with it, including the bluetooth audio system. This step was damaging and probably unnecessary. You should look in /var/log/apt/history.log and try to reverse the damage by reinstalling what was uninstalled.
zsbeta avatar
br flag
Mmm, that could be: `pulseaudio-module-bluetooth` , although reinstalling it does not solve bluetooth connection issue, and the system does have its own bluetooth module.
user10489 avatar
in flag
Not sure if reinstalling that one module is enough, might be others.
zsbeta avatar
br flag
Actually, it started to work after fixing the audio driver mapping problem as well.
Score:0
br flag

After searching and trying. The problem is that somehow alsa having problem due to too many possible drivers from both Intel and Nvidia. The solution that worked for me is the following:

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

While doing the last step, it removed the unnecessary drivers, but it was taking ages in retrieving the valid driver. It could take hours, and got stacked in generating the correct mapping. I had to kill it, but after rebooting actually the audio (input/output) started to work again. Maybe another reboot will undo the effect.

Also, for other how had similar problem, worth trying to do: mv ~/.config/pulse ~/.config/new_pulse_conf after the re-installation. It worked once after rebooting (only once tho).

user10489 avatar
in flag
The correct solution here is to change the audio priorities rather than removing the drivers. You just need to change the audio selection to the correct one, and adjust the configs so that it is always chosen by default after dynamic events like reboots and headphone plug/unplug.
desmond13 avatar
np flag
@user10489, could you be more specific in how to do that?
user10489 avatar
in flag
Not an expert, was hoping someone else would answer. Maybe I'll do some research later and write something up. A good start is to look in `/etc/alsa/conf.d/`
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.