All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] [SOUND] Fixes recording gain control
@ 2009-03-10 13:01 Viral Mehta
  0 siblings, 0 replies; 3+ messages in thread
From: Viral Mehta @ 2009-03-10 13:01 UTC (permalink / raw)
  To: Takashi Iwai, alsa-devel

Have tested two usb audio mic devices.
At the time of initialization, SNDRV_MIXER_OSS_PRESENT_PVOLUME bit is not
set for MIC (slot 7).
So, the same should not be checked when an application tries to do gain 
control
for audio recording devices. Just check
slot->present for SNDRV_MIXER_OSS_PRESENT_CVOLUME independently.
Verified with a simple application which opens /dev/dsp for recording and
/dev/mixer for volume control.

Signed-off-by: Viral Mehta <viral.mehta@einfochips.com>
---
 sound/core/oss/mixer_oss.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/sound/core/oss/mixer_oss.c b/sound/core/oss/mixer_oss.c
index 4690b8b..919c7eb 100644
--- a/sound/core/oss/mixer_oss.c
+++ b/sound/core/oss/mixer_oss.c
@@ -690,7 +690,7 @@ static int snd_mixer_oss_put_volume1(struct 
snd_mixer_oss_file *fmixer,

        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);
--
1.6.0.2.GIT

-- 
_____________________________________________________________________
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 related	[flat|nested] 3+ messages in thread

* [PATCH] [SOUND] Fixes recording gain control
@ 2009-03-10 13:10 Viral Mehta
  2009-03-10 14:47 ` Takashi Iwai
  0 siblings, 1 reply; 3+ messages in thread
From: Viral Mehta @ 2009-03-10 13:10 UTC (permalink / raw)
  To: Takashi Iwai, alsa-devel, perex

Sorry for resending it again and again. This is since submitting a patch 
first time. Please never mind.
Consider the below thing.

Have tested two usb audio mic devices.
At the time of initialization, SNDRV_MIXER_OSS_PRESENT_PVOLUME bit is not
set for MIC (slot 7).
So, the same should not be checked when an application tries to do gain 
control
for audio recording devices. Just check
slot->present for SNDRV_MIXER_OSS_PRESENT_CVOLUME independently.
Verified with a simple application which opens /dev/dsp for recording and
/dev/mixer for volume control.

Signed-off-by: Viral Mehta <viral.mehta@einfochips.com>
---
sound/core/oss/mixer_oss.c |    2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

--- sound/core/oss/mixer_oss.org.c      2009-03-10 18:37:49.000000000 +0530
+++ sound/core/oss/mixer_oss.c  2009-03-10 18:37:07.000000000 +0530
@@ -692,6 +692,8 @@ static int snd_mixer_oss_put_volume1(str
                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)
                        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_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);
        } else if (slot->present & SNDRV_MIXER_OSS_PRESENT_GLOBAL) {

-- 
_____________________________________________________________________
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] 3+ messages in thread

* Re: [PATCH] [SOUND] Fixes recording gain control
  2009-03-10 13:10 Viral Mehta
@ 2009-03-10 14:47 ` Takashi Iwai
  0 siblings, 0 replies; 3+ messages in thread
From: Takashi Iwai @ 2009-03-10 14:47 UTC (permalink / raw)
  To: Viral Mehta; +Cc: alsa-devel

At Tue, 10 Mar 2009 18:40:49 +0530,
Viral Mehta wrote:
> 
> Sorry for resending it again and again. This is since submitting a patch 
> first time. Please never mind.
> Consider the below thing.

Thanks.  Applied with a slight modification about coding style now.

BTW, the patch embedded in your post was still broken due to your
MUA.  Please fix it (or use attachment if difficult) at the next time.

Also, it'd be helpful if you run once checkpatch.pl before submission.


Takashi

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

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

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-03-10 13:01 [PATCH] [SOUND] Fixes recording gain control Viral Mehta
  -- strict thread matches above, loose matches on Subject: below --
2009-03-10 13:10 Viral Mehta
2009-03-10 14:47 ` 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.