Audio mixer settings for recording with a microphone

0 views
Skip to first unread message

Polytropon

unread,
Nov 24, 2019, 12:42:06 PM11/24/19
to FreeBSD Questions
Currently I have the following problem: I'd like to record
something to a file using a microphone. I have the following
sound hardware in my el-cheapo home PC:

% dmesg | grep pcm
pcm0: <HDA VIA VT1708_8 PCM #0 Analog> at cad 0 nid 1 on hdac0
pcm1: <HDA VIA VT1708_8 PCM #1 Analog> at cad 0 nid 1 on hdac0
pcm2: <HDA VIA VT1708_8 PCM #2 Digital> at cad 0 nid 1 on hdac0

That is a built-in sound system (located on the mainboard).

% cat /dev/sndstat
FreeBSD Audio Driver (newpcm: 32bit 2009061500/i386)
Installed devices:
pcm0: <HDA VIA VT1708_8 PCM #0 Analog> (play/rec) default
pcm1: <HDA VIA VT1708_8 PCM #1 Analog> (rec)
pcm2: <HDA VIA VT1708_8 PCM #2 Digital> (play)

I have one 3.5mm mic input on the rear and one on the front
of the system. The rear one doesn't seem to work at all. The
front one seems to work, but there is more "background noise"
(ca. 1 kHz sawtooth shape + 1 octave higher "beeeeeeeeeeeeep"
kind of sound, which I can hear on the headphones). If I do
record something (I use audacity), the signal level is very
low, and there is more "interference" beep than "used signal".
I can control the noise with the last 5% of the levels using
the "mic", "igain" and "monitor" control, but the anticipated
signal level doesn't really change.

My suspicion: I'm doing something wrong with the mixer, but
I cannot see what it is...

On my old system, I never had such problems - I would simply
attach the microphone, increase "mic" as needed, and I could
use sox's "rec" command to obtain the audio needed. I put a
CMI soundcard (PCI-based) into that system, which FreeBSD did
perfectly support.

For testing, I set the mixer as follows (important settings
marked with an arrow):

% mixer -f /dev/mixer0
Mixer vol is currently set to 100:100
Mixer pcm is currently set to 100:100
Mixer line is currently set to 0:0
Mixer mic is currently set to 100:100 <---
Mixer cd is currently set to 0:0
Mixer rec is currently set to 0:0
Mixer igain is currently set to 100:100 <---
Mixer monitor is currently set to 100:100 <---
Recording source: mic <---

% mixer -f /dev/mixer1
Mixer rec is currently set to 100:100
Mixer monitor is currently set to 100:100
Recording source: monitor

% mixer -f /dev/mixer2
Mixer vol is currently set to 0:0
Mixer pcm is currently set to 0:0

It does not work, as described above.

I tried several microphones. Electret microphones don't work
at all. Dynamic microphones do work, but far too low level.
I've checked them with a semi-pro mixer system - the mikes
work just fine, sufficient level. I chose the one with the
"best" signal, RFT DM-2413M.

Do "modern" PCs (this one is older than 10 years!) require
a pre-amplifier for a microphone?

I assume, if I try to connect the mike to the mixer, and the
mixer to the line-in of the PC, it won't work as well... but
that's the next thing I will try, as I can select "line" as
recording inout as well.

Never touch a running system. ;-)




--
Polytropon
Magdeburg, Germany
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...
_______________________________________________
freebsd-...@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questi...@freebsd.org"

Tomasz CEDRO

unread,
Nov 24, 2019, 12:45:40 PM11/24/19
to Polytropon, FreeBSD Questions Mailing List
Hey Poly :-)

Something has changed in audio system and I have to set mixer1 values in
order for my mic to work, have you tried that? :-)


--
CeDeROM, SQ7MHZ, http://www.tomek.cedro.info

Polytropon

unread,
Nov 24, 2019, 1:01:38 PM11/24/19
to Tomasz CEDRO, FreeBSD Questions Mailing List
On Sun, 24 Nov 2019 18:45:18 +0100, Tomasz CEDRO wrote:
> Something has changed in audio system and I have to set mixer1 values in
> order for my mic to work, have you tried that? :-)

I don't have a "mic" in mixer1, but "rec", and I set that
to 100 as well; I cannot change the recording source for
mixer1, so it keeps being "monitor" (as it's the only
device listed as a recording device).

This is the current setting for all mixers present on the
system (relevant ones marked with an arrow).

% mixer -f /dev/mixer0
Mixer vol is currently set to 100:100
Mixer pcm is currently set to 100:100
Mixer line is currently set to 0:0
Mixer mic is currently set to 100:100 <---
Mixer cd is currently set to 0:0
Mixer rec is currently set to 0:0
Mixer igain is currently set to 100:100 <---
Mixer monitor is currently set to 100:100 <---
Recording source: mic <---

% mixer -f /dev/mixer1
Mixer rec is currently set to 100:100
Mixer monitor is currently set to 100:100
Recording source: monitor

% mixer -f /dev/mixer2
Mixer vol is currently set to 0:0
Mixer pcm is currently set to 0:0

It's sad to see that several things stop working during the
course of advancement of FreeBSD, things that worked reliably
for decades... :-/




--
Polytropon
Magdeburg, Germany
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...

Tomasz CEDRO

unread,
Nov 24, 2019, 3:01:06 PM11/24/19
to Polytropon, Steve O'Hara-Smith, FreeBSD Questions Mailing List
On Sun, Nov 24, 2019 at 7:01 PM Polytropon wrote:
> It's sad to see that several things stop working during the
> course of advancement of FreeBSD, things that worked reliably
> for decades... :-/

Indeed, we also got into the point where Kernel API changes from
release to release and the graphics driver crashes your machine in an
endless loop :-(

In Hangouts (web video chat client) I had to change input device to
"Monitor of /dev/dsp1" in order to get the built-in microphone
working. I have following devices:
/dev/dsp1
/dev/dsp2
Monitor of /dev/dsp0
Monitor of /dev/dsp1
Monitor of /dev/dsp2

My WindowManager Enlightenment uses PulseAudio for sound routing..

Hope that helps..

--
CeDeROM, SQ7MHZ, http://www.tomek.cedro.info

Polytropon

unread,
Nov 25, 2019, 6:13:19 AM11/25/19
to Tomasz CEDRO, Steve O'Hara-Smith, FreeBSD Questions Mailing List
On Sun, 24 Nov 2019 21:00:41 +0100, Tomasz CEDRO wrote:
> On Sun, Nov 24, 2019 at 7:01 PM Polytropon wrote:
> > It's sad to see that several things stop working during the
> > course of advancement of FreeBSD, things that worked reliably
> > for decades... :-/
>
> Indeed, we also got into the point where Kernel API changes from
> release to release and the graphics driver crashes your machine in an
> endless loop :-(

And I won't start ranting about how vt is far inferior to sc
(which worked for decades), that vt lets you choose from a few
unreadable ant-tiny fonts and blurry colors, and can't even
properly display umlauts... :-/



> In Hangouts (web video chat client) I had to change input device to
> "Monitor of /dev/dsp1" in order to get the built-in microphone
> working. I have following devices:
> /dev/dsp1
> /dev/dsp2
> Monitor of /dev/dsp0
> Monitor of /dev/dsp1
> Monitor of /dev/dsp2
>
> My WindowManager Enlightenment uses PulseAudio for sound routing..

I only have WindowMaker (no desktop environment). For mixer
control, I occassionally use simple "xmixer", but for now, the
CLI "mixer" provided by FreeBSD is my choice. For recording,
I use Audacity.

What I found out: There has to be a specific setting of non-zero
values for more than one mixer channel in order to get things
working: the input device (mic, line), a recording device, and
the input gain, and in addition, the monitor channel, if desired.
Should one involved be zero, recording probably won't work.



> Hope that helps..

I discovered the following wisdon: A sufficient amount of obstacles
eventually leads to "do not want". ;-)

Now I have the following "solution", which is far from perfect, but
allows me to use the microphone - a thing that worked decades ago:
Microphone -> mixer -> line-in. I won't mention the additionally
needed adapters and connectors for this mess. :-)

So now I have both permanent independent (!) input monitoring _and_
the ability to adjust the input level of the microphone. The mixer
also creates "poor man's stereo" (mic channel both on L and R).

The mixer settings are as follows (relevant things marked, I need
to see which values lead to best results):

% mixer -f /dev/mixer0
Mixer vol is currently set to 50:50
Mixer pcm is currently set to 100:100
Mixer line is currently set to 100:100 <---
Mixer mic is currently set to 0:0
Mixer cd is currently set to 0:0
Mixer rec is currently set to 100:100 <---
Mixer igain is currently set to 100:100 <---
Mixer monitor is currently set to 0:0
Recording source: line <---

The "monitor" channel has to stay zero so I don't have that
annoying high-pitch tone interference. It also doesn't affect the
actual monitoring (line audio can be heared on headphones) or
recording (line audio is recorded and "visible" in Audacity).

Those two seem to be totally irelevant:

% mixer -f /dev/mixer1
Mixer rec is currently set to 0:0
Mixer monitor is currently set to 0:0
Recording source: monitor

% mixer -f /dev/mixer2
Mixer vol is currently set to 0:0
Mixer pcm is currently set to 0:0

NB: I don't seem to have any /dev/dsp* devices, no idea why. But
everything else "works".

In case I need to record with a mike more often, I'll probably
build a little pre-amplifier, with a battery, power switch and LED,
connectors 3.5mm (so no more adapters needed), level adjustment,
and maybe a little VU meter for input control. For now, the
"solution" mentioned above should be fine.

That must be the "smart modern AI big data computing experience"
everyone keeps talking about! ;-)



--
Polytropon
Magdeburg, Germany
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...
Reply all
Reply to author
Forward
0 new messages