[Simple] Internal Microphone on FreeBSD 13R

Have a simple issue here:


The internal soundcard plays audio, how do I get the mic working?
Code:
# cat /dev/sndstat

Installed devices:
pcm0: <Realtek ALC257 (Analog)> (play/rec) default
pcm1: <Realtek ALC257 (Right Analog Headphones)> (play)
pcm2: <Intel Kaby Lake (HDMI/DP 8ch)> (play)
No devices installed from userspace.
Any pointers as to what should be the next step?

P.S. mixer command shows speaker and mic levels, rec command is present. How do I enable mic?
 
I also kept these under /boot/loader.conf [ Not sure if they're deprecated now ]
Code:
snd_driver_load="YES"
snd_hda_load="YES"
 
Not an immediate answer to your question but it is advisable to load sound in rc.conf and not in loader.conf.
via:
Code:
kld_list="snd_driver"
What is the output when you do
Code:
/usr/sbin/mixer
 
Thanks for the response. I made the changes in rc.conf as suggested.

Here's the output from :

# /usr/sbin/mixer

Code:
Mixer vol      is currently set to  85:85
Mixer pcm      is currently set to 100:100
Mixer speaker  is currently set to 100:100
Mixer mic      is currently set to  98:98
Mixer rec      is currently set to  37:37
Mixer ogain    is currently set to 100:100
Recording source: mic
 
Okay so I had tried that earlier but regardless, I tried again and the file is totally silent. Volume controls are fine and other wave files play just perfect. The one I recorded didn't. So, what can I try next?
 
By default mixer opens /dev/mixer0 but there are often other mixers available.
Try mixer -f /dev/mixer1 and so on with all the /dev/mixer* you have to see what's in there.
 
Code:
# mixer -f /dev/mixer0
Mixer vol      is currently set to  85:85
Mixer pcm      is currently set to 100:100
Mixer speaker  is currently set to 100:100
Mixer mic      is currently set to  98:98
Mixer rec      is currently set to  37:37
Mixer ogain    is currently set to 100:100
Recording source: mic


# mixer -f /dev/mixer1
Mixer vol      is currently set to  85:85
Mixer pcm      is currently set to 100:100
Mixer ogain    is currently set to 100:100


# mixer -f /dev/mixer2
Mixer vol      is currently set to 100:100
Mixer pcm      is currently set to 100:100

????🎤 I need to know what to do if I wish to use the inbuilt microphone!
 
The only recording device available is on the default mixer, so the problem is elsewhere.

If you connect an external microphone, does it work?

What's the output of sysctl dev.hdaa?
 
Thanks to everyone involved for your time. Really appreciate it.

The laptop has a single headphone jack (no separate inlet fora mic). I hooked an external microphone (although it's not reliable) into that headphone port and tried rec and did receive some disturbance recorded. I am not sure if that's a win.

sysctl's output can be temporarily found here :

Do let me know your analysis.
 
The automatic configuration seems to be wrong.

Your internal microphone is not listed as such, and I'm wondering which one of all the dev.hdaa.0.nid** it can be.

The fact there is a mixer for a microphone input jack together with a beep speaker looks like nonsense to me:
Code:
dev.hdaa.0.nid35: audio mixer
     Widget cap: 0x0020010b STEREO
    Association: 2 (0x0001)
            OSS: speaker, mic
      Input amp: 0x80000000 mute=1 step=0 size=0 offset=0 (0/0dB)
    Connections: 6
          + [DISABLED] <- nid=24 [pin: Speaker (None)] [DISABLED]
          + <- nid=25 [pin: Mic (Black Jack)]
          + [DISABLED] <- nid=26 [pin: Speaker (None)] [DISABLED]
          + [DISABLED] <- nid=27 [pin: Speaker (None)] [DISABLED]
          + <- nid=29 [beep widget]
          + [DISABLED] <- nid=18 [pin: Speaker (None)] [DISABLED]
Maybe the internal microphone is nid29, mislabeled as a beep speaker?
Do you get speaker listed as a rec device with mixer -h?
If yes then you can enable it with mixer =rec speaker.
 
Yes" mixer -f" shows the following

devices: vol, pcm, speaker, mic, rec, ogain
rec devices: speaker, mic

I issued, as advised: "mixer =rec speaker"
Then tried rec -d test.wav
No sound recorded.

Reverted back to
"mixer =rec mic"
again tested recording. No luck :(


What can we try next?

P.S.
Would it help testing rec and if we find success then maybe 'dmesg' or a relevant command from any Linux OS or Net/OpenBSD ?
 
I have a hard time buying the idea that a headphone jack can also be used as a microphone jack... those are supposed to be two separate things. You can probably plug in a USB mic and use that. Then the FreeBSD utilities should work fine to configure that. Just plug it in, do # dmesg | tail -f, and start there.

Edit: Previous version of command (# dmesg | grep tail -f) would have resulted in an error, and not the output of the last few lines.
 
Last edited:
I do not wish to use an external (USB) mic. I am trying to solve the issue of using the internal mic since it's working fine as tested on other OSes.
 
Have you managed to set up the internal microphone?

No. I tried everything. Even recompiled the kernel. I tried all nid combinations and failed and wasted my time, learnt nothing new. I am back to using virtual_oss which works fine but if I open too many tabs or have some process intensive work going on in the background the audio drops after few minutes. For every call I have to reboot my system. It is bad but living with it. I blame MS Teams partially. Zoom works fine using the same setup on Chrome but YouTube in FFX drops the audio. I have to go rewind the progress bar and then it resumes playing the audio. In short if your hardware is not compatible you are going to have problems. 'Power to Forbid' should be the slogan for FreeBSD. Too intense?
 
No. I tried everything. Even recompiled the kernel. I tried all nid combinations and failed and wasted my time, learnt nothing new. I am back to using virtual_oss which works fine but if I open too many tabs or have some process intensive work going on in the background the audio drops after few minutes. For every call I have to reboot my system. It is bad but living with it. I blame MS Teams partially. Zoom works fine using the same setup on Chrome but YouTube in FFX drops the audio. I have to go rewind the proress bar and then it resumes playing the audio. In short if your hardware is not compatible you are going to have problems. 'Power to Forbid' should be the slogan for FreeBSD. Too intense?
try OpenBSD, it was allergic, to, of all things, a USB->ethernet adapter on a laptop that has USB outlets, but no ethernet outlets.
 
Okay, you had it worse, but IMHO why would you even use a laptop with no RJ45 slot? I think even phones should come with one. No I don't want an OTG cable.. before someone suggests that. Instead of cribbing and mandating sideloading on iOS and other bs, governments should make manufacturers give us all ethernet ports and FreeBSD support for all smartphones. They only make noise about missing 3.5mm jacks. Give us direct HDMI support and as well. 🤘🦾
 
I think even phones should come with one.
That would make the phone quite bulky! Not something I'd like to have in my pocket. But I certainly expect one on a laptop. I don't understand the commercial success of extra-thin laptops, unlike phones they aren't something you can fit in a pocket, if you have the space (width and height) to fit a laptop somewhere, a bit more or less thickness doesn't really matter.
 
I always chuckle when I see this thread title. There is nothing simple about capturing the microphone on a recent laptop.
 
Back
Top