Problem with mic on Realtek ALC256

From: dinu rr <rrdinu_at_gmail.com>
Date: Mon, 13 Dec 2021 20:57:07 UTC
I have installed FreeBSD 13 on my Optiplex 7080 mini tower, with KDE/Plasma
desktop. Sound output works fine through the internal speaker, headphone
and HDMI. I am able to switch these outputs with the plasma pulse audio
volume controller. Connecting a headphone to the front audio port switches
output from internal speaker to headphones automatically, as expected.

However, I am yet to get a mic working on this machine, in FreeBSD.
Headphone mic used to work fine with ubuntu that came preinstalled with
this machine, hence, I believe that the hardware is alright.

I have listed the outputs of some commands that I have come across from the
Handbook and the forums, while I was researching for a solution.

% cat /dev/sndstat

Installed devices:
pcm0: <Realtek ALC256 (Analog 2.0+HP)> (play) default
pcm1: <Realtek ALC256 (Rear Analog Line-out)> (play)
pcm2: <Intel Kaby Lake (HDMI/DP 8ch)> (play)
No devices installed from userspace.

% dmesg | grep hda*

hdac0: <Intel Comet Lake-H HDA Controller> mem
0x91330000-0x91333fff,0x91000000-0x910fffff at device 31.3 on pci0
hdacc0: <Realtek ALC256 HDA CODEC> at cad 0 on hdac0
hdaa0: <Realtek ALC256 Audio Function Group> at nid 1 on hdacc0
pcm0: <Realtek ALC256 (Analog 2.0+HP)> at nid 20,33 on hdaa0
pcm1: <Realtek ALC256 (Rear Analog Line-out)> at nid 27 on hdaa0
hdacc1: <Intel Kaby Lake HDA CODEC> at cad 2 on hdac0
hdaa1: <Intel Kaby Lake Audio Function Group> at nid 1 on hdacc1
pcm2: <Intel Kaby Lake (HDMI/DP 8ch)> at nid 3 on hdaa1

The internal speaker and headphone work through pcm0. The front audio port
uses a 4-pin jack, for headphone and mic.

Could anyone please help me to get the mic working? Please advise me on
what additional information is required to investigate the issue. Thanks in
advance.