mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Takashi Iwai <tiwai@suse.de>
To: Clemens Ladisch <clemens@ladisch.de>
Cc: Viral Mehta <viral.mehta@einfochips.com>,
	alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org
Subject: Re: [alsa-devel] [PATCH] [SOUND] recording gain control
Date: Tue, 10 Mar 2009 13:16:50 +0100	[thread overview]
Message-ID: <s5h1vt5k1xp.wl%tiwai@suse.de> (raw)
In-Reply-To: <49B62C1D.4080509@ladisch.de>

At Tue, 10 Mar 2009 10:00:13 +0100,
Clemens Ladisch wrote:
> 
> (CC alsa-devel)
> 
> Viral Mehta wrote:
> > Hi,
> > 
> > I am trying to do gain control while RECORDING for my Audio Mic device.
> > 
> > My application opens /dev/mixer device and calls ioctl(fdmixer, 
> > MIXER_WRITE(SOUND_MIXER_MIC), ...)
> > 
> > But, the call fails. It traces to sound/core/oss/mixer_oss.c file and 
> > snd_mixer_oss_put_volume1() function.
> > It never falls in "if (slot->present & SNDRV_MIXER_OSS_PRESENT_CVOLUME)" 
> > as condition "if (slot->present & SNDRV_MIXER_OSS_PRESENT_PVOLUME) " 
> > comes as false.
> > 
> > I think there is a bug in kernel and I think it should be like as below,
> > 
> > --- sound/core/oss/mixer_oss.c  2008-12-03 13:24:02.000000000 +0530
> > +++ sound/core/oss/mixer_oss.c   2009-03-09 16:22:06.548766896 +0530
> > @@ -688,7 +688,7 @@ static int snd_mixer_oss_put_volume1(str
> > 
> >      if (slot->present & SNDRV_MIXER_OSS_PRESENT_PVOLUME) {
> >              snd_mixer_oss_put_volume1_vol(fmixer, pslot, 
> > slot->numid[SNDRV_MIXER_OSS_ITEM_PVOLUME], left, right);
> > -               if (slot->present & SNDRV_MIXER_OSS_PRESENT_CVOLUME)
> > +       } else if (slot->present & SNDRV_MIXER_OSS_PRESENT_CVOLUME) {
> >                      snd_mixer_oss_put_volume1_vol(fmixer, pslot, 
> > slot->numid[SNDRV_MIXER_OSS_ITEM_CVOLUME], left, right);
> >      } else if (slot->present & SNDRV_MIXER_OSS_PRESENT_GVOLUME) {
> >              snd_mixer_oss_put_volume1_vol(fmixer, pslot, 
> > slot->numid[SNDRV_MIXER_OSS_ITEM_GVOLUME], left, right);
> 
> Your mailer mangled the patch; see linux/Documentation/email-clients.txt.

Also, the current code behaves intentionally so (as it's designed for
mic-loopback volume).

A more feasible fix would be to add another if check for *_CVOLUME
instead of moving it.


Takashi

  reply	other threads:[~2009-03-10 12:17 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-10  5:21 Viral Mehta
2009-03-10  9:00 ` [alsa-devel] " Clemens Ladisch
2009-03-10 12:16   ` Takashi Iwai [this message]
2009-03-10 12:22     ` Viral Mehta
2009-03-10 12:59       ` Takashi Iwai

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=s5h1vt5k1xp.wl%tiwai@suse.de \
    --to=tiwai@suse.de \
    --cc=alsa-devel@alsa-project.org \
    --cc=clemens@ladisch.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=viral.mehta@einfochips.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®