[LAD] Audio mixer recording gain control

From: Viral Mehta <viral.mehta@email-addr-hidden>
Date: Mon Mar 09 2009 - 12:55:55 EET

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.
__________________________________________________________________________
 
_______________________________________________
Linux-audio-dev mailing list
Linux-audio-dev@email-addr-hidden
http://lists.linuxaudio.org/mailman/listinfo/linux-audio-dev
Received on Mon Mar 9 20:15:03 2009

This archive was generated by hypermail 2.1.8 : Mon Mar 09 2009 - 20:15:03 EET