Realtek Audio Drivers for Ubuntu

The best thing to do would be to remove alsa and reinstall it. The same thing happened to me when I switched motherboards, and this fixed it.

  1. Remove the ALSA packages.

     sudo apt-get --purge remove linux-sound-base alsa-base alsa-utils
    
  2. Reinstall the same packages.

     sudo apt-get install linux-sound-base alsa-base alsa-utils
    

    Packages gdm and ubuntu-desktop are also removed in this process if you are using Gnome. They need to be reinstalled:

     sudo apt-get install gdm ubuntu-desktop
     # or 
     sudo apt-get install gdm3 ubuntu-desktop
    

    If you are using Xubuntu this will also happen to you.

     sudo apt-get install gdm xubuntu-desktop
    
  3. Reboot.

     sudo reboot
    

I had the same problem (internal mic not working) with my Lenovo Ideapad 320, which runs Ubuntu 18.04.

I installed GNOME ALSA Mixer from the Ubuntu Softwares Panel and followed another topic instruction: put the "Capture" full on the right and "Internal" empty on the left, as the following image:

see this screenshot

It worked well for me.