[patch] stereo input is mixed to monaural via SoundBlaster16
skywizard at MyBSD.org.my
Wed Nov 9 16:10:37 GMT 2005
On Wed, 09 Nov 2005 22:48:27 +0900
Watanabe Kazuhiro <CQG00620 at nifty.ne.jp> wrote:
> At Tue, 08 Nov 2005 16:59:55 +0100,
> Alexander Leidinger wrote:
> > Watanabe Kazuhiro <CQG00620 at nifty.ne.jp> wrote:
> > > if (src & SOUND_MASK_MIC)
> > > - recdev |= 0x01; /* mono mic */
> > > + recdev_l |= 0x01; /* mono mic */
> > > + recdev_r |= 0x01;
> > If I understand this correctly, this feeds the monaural signal to
> > the left and the right channel. When we have a mono input, do we
> > really want to have the same input doubled? I don't do any
> > recording, so I don't know how most programs handle this, but IMHO
> > it's a waste of resources and if the source is only able to
> > deliver a mono-signal, the recording should only be possible in
> > mono.
> The function sb16mix_setrecsrc() only manipulates the analog
> recording mixer. So if we assign a mono input to the left and right
> channel, it doesn't force for us to record a two-channel digitized
> To decide a sampling format(stereo/mono, sample rate, bit length,
> and so on) is not the mixer's role but DSP.
If this is about sample processing (mix, filter, rate, bit,
mono->stereo, stereo->mono, etc), yes, you're correct. But mixer has
its own purpose to route the pre(input) / post(output) processing
(specifically stereo / mono), whether to discard or to allow any of
left / right.
> At Wed, 9 Nov 2005 00:20:13 +0800,
> Ariff Abdullah wrote:
> > Watanabe-san, I would suggest you to put braces along with the
> > conditional statement so the code become much easier tu
> > understand. Without it, it seems that recdev_r will always be set
> > even if the condition is false.
> Oops... your indication is right and I'm wrong. The correct patch is
> However, this patch is not perfect. After applied the patch, if I
> try to record an monaural output (e.g. "wavrec -M mono.wav"), only
> record the left channel sound.
[ see below ]
> From the "Hardware Programming Reference" pp74:
> "When recording in mono, note that samples will only be taken
> from the left input mixer.
> So, if a mono recording of a stereo source is desired, the
> switchs controlled by registers 0x3D and 0x3E must be
> manipulated to enable both channels of a stereo source to be
> mixed together first into the left input mixer before being
> I'm just going to consider the problem. Perhaps it's difficult for
> me to solve the problem...
Unfortunately, we're leaving in a *real* world. In a *perfect*
world, we can assume that mono should be something like
(left+right)/2, that is, mix all available channels and normalize it.
But it has been decided (by most standards) that all channels (except
left) will be discarded in order to achive mono input/output.
So.. are there any differences (wavrec -M/S yada.wav) between patched
and unpatched version?
More information about the freebsd-multimedia