Earphone mic doesn't work on Ubuntu 21.10

This issue can be resolved by following these steps:

  1. Find out your machine's codecs with cat /proc/asound/card*/codec* | grep Codec
  2. In my case I saw Codec: Realtek ALC236 Codec: Intel Kabylake HDMI.
  3. Go to www.kernel.org and lookup your codec. In my case it was Realtek ALC23x
  4. I chose dell-headset-multi as the other codec options did not work for me.
  5. Add the line options snd-hda-intel model=dell-headset-multi in the alsa-base.conf file by opening the file with the command sudo gedit /etc/modprobe.d/alsa-base.conf and edit it.
  6. Save and close the file. Reboot your system for the changes to take effect.