All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] [SOUND] recording gain control
@ 2009-03-10  5:21 Viral Mehta
  2009-03-10  9:00   ` Clemens Ladisch
  0 siblings, 1 reply; 9+ messages in thread
From: Viral Mehta @ 2009-03-10  5:21 UTC (permalink / raw)
  To: linux-kernel

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);


Thanks,
Viral






-- 
_____________________________________________________________________
Disclaimer: This e-mail message and all attachments transmitted with it
are intended solely for the use of the addressee and may contain legally
privileged and confidential information. If the reader of this message
is not the intended recipient, or an employee or agent responsible for
delivering this message to the intended recipient, you are hereby
notified that any dissemination, distribution, copying, or other use of
this message or its attachments is strictly prohibited. If you have
received this message in error, please notify the sender immediately by
replying to this message and please delete it from your computer. Any
views expressed in this message are those of the individual sender
unless otherwise stated.Company has taken enough precautions to prevent
the spread of viruses. However the company accepts no liability for any
damage caused by any virus transmitted by this email.
__________________________________________________________________________
 

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [alsa-devel] [PATCH] [SOUND] recording gain control
  2009-03-10  5:21 [PATCH] [SOUND] recording gain control Viral Mehta
@ 2009-03-10  9:00   ` Clemens Ladisch
  0 siblings, 0 replies; 9+ messages in thread
From: Clemens Ladisch @ 2009-03-10  9:00 UTC (permalink / raw)
  To: Viral Mehta; +Cc: linux-kernel, alsa-devel

(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.


Best regards,
Clemens

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] [SOUND] recording gain control
@ 2009-03-10  9:00   ` Clemens Ladisch
  0 siblings, 0 replies; 9+ messages in thread
From: Clemens Ladisch @ 2009-03-10  9:00 UTC (permalink / raw)
  To: Viral Mehta; +Cc: alsa-devel, linux-kernel

(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.


Best regards,
Clemens

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [alsa-devel] [PATCH] [SOUND] recording gain control
  2009-03-10  9:00   ` Clemens Ladisch
@ 2009-03-10 12:16     ` Takashi Iwai
  -1 siblings, 0 replies; 9+ messages in thread
From: Takashi Iwai @ 2009-03-10 12:16 UTC (permalink / raw)
  To: Clemens Ladisch; +Cc: Viral Mehta, alsa-devel, linux-kernel

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

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] [SOUND] recording gain control
@ 2009-03-10 12:16     ` Takashi Iwai
  0 siblings, 0 replies; 9+ messages in thread
From: Takashi Iwai @ 2009-03-10 12:16 UTC (permalink / raw)
  To: Clemens Ladisch; +Cc: alsa-devel, linux-kernel, Viral Mehta

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

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [alsa-devel] [PATCH] [SOUND] recording gain control
@ 2009-03-10 12:22       ` Viral Mehta
  0 siblings, 0 replies; 9+ messages in thread
From: Viral Mehta @ 2009-03-10 12:22 UTC (permalink / raw)
  To: Takashi Iwai, perex, Linux audio dev
  Cc: Clemens Ladisch, alsa-devel, linux-kernel

Takashi Iwai wrote:
> 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.
>
>
>   
Oh okie. It makes sense.
I just sent out a patch on LAD. Should I resubmit with what you proposed ?

> Takashi
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/
>
>
> Email Scanned for Virus & Dangerous Content by : www.CleanMailGateway.com
>
>
>   
-- 
_____________________________________________________________________
Disclaimer: This e-mail message and all attachments transmitted with it
are intended solely for the use of the addressee and may contain legally
privileged and confidential information. If the reader of this message
is not the intended recipient, or an employee or agent responsible for
delivering this message to the intended recipient, you are hereby
notified that any dissemination, distribution, copying, or other use of
this message or its attachments is strictly prohibited. If you have
received this message in error, please notify the sender immediately by
replying to this message and please delete it from your computer. Any
views expressed in this message are those of the individual sender
unless otherwise stated.Company has taken enough precautions to prevent
the spread of viruses. However the company accepts no liability for any
damage caused by any virus transmitted by this email.
__________________________________________________________________________
 

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [LAD] [alsa-devel] [PATCH] [SOUND] recording gain control
@ 2009-03-10 12:22       ` Viral Mehta
  0 siblings, 0 replies; 9+ messages in thread
From: Viral Mehta @ 2009-03-10 12:22 UTC (permalink / raw)
  To: Takashi Iwai, perex-/Fr2/VpizcU, Linux audio dev
  Cc: alsa-devel-K7yf7f+aM1XWsZ/bQMPhNw, Clemens Ladisch,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA

Takashi Iwai wrote:
> 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.
>
>
>   
Oh okie. It makes sense.
I just sent out a patch on LAD. Should I resubmit with what you proposed ?

> Takashi
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/
>
>
> Email Scanned for Virus & Dangerous Content by : www.CleanMailGateway.com
>
>
>   
-- 
_____________________________________________________________________
Disclaimer: This e-mail message and all attachments transmitted with it
are intended solely for the use of the addressee and may contain legally
privileged and confidential information. If the reader of this message
is not the intended recipient, or an employee or agent responsible for
delivering this message to the intended recipient, you are hereby
notified that any dissemination, distribution, copying, or other use of
this message or its attachments is strictly prohibited. If you have
received this message in error, please notify the sender immediately by
replying to this message and please delete it from your computer. Any
views expressed in this message are those of the individual sender
unless otherwise stated.Company has taken enough precautions to prevent
the spread of viruses. However the company accepts no liability for any
damage caused by any virus transmitted by this email.
__________________________________________________________________________

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [alsa-devel] [PATCH] [SOUND] recording gain control
  2009-03-10 12:22       ` [LAD] " Viral Mehta
@ 2009-03-10 12:59         ` Takashi Iwai
  -1 siblings, 0 replies; 9+ messages in thread
From: Takashi Iwai @ 2009-03-10 12:59 UTC (permalink / raw)
  To: Viral Mehta
  Cc: perex, Linux audio dev, Clemens Ladisch, alsa-devel, linux-kernel

At Tue, 10 Mar 2009 17:52:46 +0530,
Viral Mehta wrote:
> 
> Takashi Iwai wrote:
> > 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.
> >
> >
> >   
> Oh okie. It makes sense.
> I just sent out a patch on LAD. Should I resubmit with what you proposed ?

LAD is no good place for sending a patch of sound driver.
Please post to alsa-devel ML (and add Cc to me).


thanks,

Takashi

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] [SOUND] recording gain control
@ 2009-03-10 12:59         ` Takashi Iwai
  0 siblings, 0 replies; 9+ messages in thread
From: Takashi Iwai @ 2009-03-10 12:59 UTC (permalink / raw)
  To: Viral Mehta; +Cc: Clemens Ladisch, alsa-devel, Linux audio dev, linux-kernel

At Tue, 10 Mar 2009 17:52:46 +0530,
Viral Mehta wrote:
> 
> Takashi Iwai wrote:
> > 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.
> >
> >
> >   
> Oh okie. It makes sense.
> I just sent out a patch on LAD. Should I resubmit with what you proposed ?

LAD is no good place for sending a patch of sound driver.
Please post to alsa-devel ML (and add Cc to me).


thanks,

Takashi

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2009-03-10 12:59 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-03-10  5:21 [PATCH] [SOUND] recording gain control Viral Mehta
2009-03-10  9:00 ` [alsa-devel] " Clemens Ladisch
2009-03-10  9:00   ` Clemens Ladisch
2009-03-10 12:16   ` [alsa-devel] " Takashi Iwai
2009-03-10 12:16     ` Takashi Iwai
2009-03-10 12:22     ` [alsa-devel] " Viral Mehta
2009-03-10 12:22       ` [LAD] " Viral Mehta
2009-03-10 12:59       ` Takashi Iwai
2009-03-10 12:59         ` Takashi Iwai

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.