7

After installing Ubuntu 20.04, I noticed that sound is not working on my system.

aplay -l was giving me Sound card not detected error.

Running inxi -A | grep driver gave me ... driver: sof-audio-pci

I tried some solutions on AskUbuntu, but they did not work and all of them used driver snd_hda_intel. Other pages said that firmwares for this driver are not shipped with distribution.

Is it possible to make sound work for Ubuntu 20.04?

Olimjon
  • 7,542
  • 2
  • 27
  • 54

3 Answers3

20

As I said the sound driver I was running was sof-audio-pci, which had no normal firmware at the moment.

I searched nearly 3 hours trying to solve this headache and finally found the solution, just disable this "sof" driver and fall back to intel:

Do:

sudo gedit /etc/default/grub

Change

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"

to:

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash snd_hda_intel.dmic_detect=0"

Then do:

sudo update-grub

and Reboot.

You can check if soundcards are detected with:

aplay -l

Source

Olimjon
  • 7,542
  • 2
  • 27
  • 54
  • Excellent!!!! After spending hours with hunting down my 'no sound' problem, this did the trick! Thank you! – T. Greg O'Neil Aug 04 '22 at 21:24
  • Although this answer fixed my audio, it disabled my microphone. For a more holistic solution, see my answer below. – Mahmoud Jun 08 '23 at 23:25
  • snd_hda_intel.dmic_detect=0 is now deprecated. What fixed the problem for me was snd-intel-dspcfg.dsp_driver. The value =3, using SOF driver, was the right one for me to get speakers+headphones+microphone working. – PLNech Feb 02 '24 at 10:54
  • Just wanna add some SEO breadcrumbs for the next poor soul: Meteor Lake-P HD Audio Controller RedmiBook Pro 16 card 0: sofhdadsp [sof-hda-dsp], device 0: HDA Analog

    The above solution finally fixed my laptop's audio issue!

    It's my understanding from page 6 of google that our audio setup is too new for ubuntu to figure out on its own. Good luck!

    – Shon Jun 01 '24 at 05:24
12

I had a similar problem on Arch Linux on a Lenovo Thinkpad X13 with kernel version 5.10. The solution is "similar" to @Olimjon, but I changed another kernel module parameter. Indeed, modinfo snd_hda_intel states that:

parm:           dmic_detect:Allow DSP driver selection (bypass this driver) (0=off, 1=on) (default=1); deprecated, use snd-intel-dspcfg.dsp_driver option instead (bool)

Running modinfo snd_intel_dspcfg gives the following info:

parm:           dsp_driver:Force the DSP driver for Intel DSP (0=auto, 1=legacy, 2=SST, 3=SOF) (int)

So I added snd_intel_dspcfg.dsp_driver=1 to my GRUB_CMDLINE_LINUX_DEFAULT to get the same effect. The other values give me no audio.

Also, you should note that both solutions break the internal microphone.

rgouicem
  • 221
5

The accepted answer is only a temporary solution, as after implementing it, my microphone no longer worked.

A more permanent solution would be to install the SOF firmware binaries from here: https://github.com/thesofproject/sof-bin

Specifically:

  1. Clone the repository: git clone https://github.com/thesofproject/sof-bin.git
  2. Change to directory: cd sof-bin
  3. Follow: https://github.com/thesofproject/sof-bin#install-process-with-installsh
sudo mv /lib/firmware/intel/sof* some_backup_location/
sudo mv /usr/local/bin/sof-*     some_backup_location/ # optional
sudo ./install.sh v2.2.x/v2.2
  1. Reboot

After this the sound output as well as the microphone were working (Ubuntu 23.04, Lenovo X1 Gen8)

Note: Make sure that the snd_hda_intel.dmic_detect=0 or snd_intel_dspcfg.dsp_driver=1 settings are not set in GRUB_CMDLINE_LINUX_DEFAULT or /etc/modprobe.d/alsa-base.conf

Votti
  • 33
Mahmoud
  • 226
  • @Votti thanks a lot for the extra steps! Very helpful. – Mahmoud Jun 08 '23 at 23:18
  • how to tell which version should be attempted? – con Jul 26 '23 at 22:05
  • @con why not use the latest release? https://github.com/thesofproject/sof-bin/releases/tag/v2.2.6 – Mahmoud Jul 26 '23 at 22:18
  • version 2.2.x seems to work the best, i.e. my headphones work, but speakers don't – con Jul 26 '23 at 22:34
  • @con, did you make sure that the snd_hda_intel.dmic_detect=0 or snd_intel_dspcfg.dsp_driver=1 settings are not set in GRUB_CMDLINE_LINUX_DEFAULT or /etc/modprobe.d/alsa-base.conf? – Mahmoud Jul 26 '23 at 22:47
  • yes, I made sure that neither the bash variable GRUB_CMDLINE_LINUX_DEFAULT nor snd_hda_intel.dmic_detect are set in /etc/modprobe.d/alsa-base.conf my question is @ https://askubuntu.com/questions/1479661/new-22-04-install-cannot-play-sound-on-speakers – con Jul 26 '23 at 22:50
  • Not fully working for me on HP Dragonfly 13.5 inch G4 Notebook PC with Linux 6.4.6-3-rt8-MANJARO. I got some sound out of the speakers but not very low and certainly not using the different speakers of the computers. – cmbarbu Aug 18 '23 at 16:45
  • @cmbarbu can you try the suggestions listed here and see if they work? – Mahmoud Aug 18 '23 at 16:48
  • @cmbarbu did any of the suggestions work? If so, could you please add an answer to this question so that others know about a solution? – Mahmoud Aug 22 '23 at 21:56
  • This answer alone didn't solve my problem. Post installing sof firmware error message in dmesg disappeared but still the speakers and headphones didn't work. I added the following line to /etc/modprobe.d/alsa-base.conf: options snd-hda-intel model=dell-headset-multi Post this do a shutdown and start system again, go to settings and no you could choose the output device as either headphones or speakers. Although my laptop (Lenovo Thinkpad E50) or sound card has nothing to do with Dell, somehow this works. Source: https://askubuntu.com/a/1386838 – user2329744 Mar 04 '25 at 09:16