aboutsummaryrefslogtreecommitdiffstats
path: root/sound/core
diff options
context:
space:
mode:
authorViral Mehta <viral.mehta@einfochips.com>2009-03-10 10:43:18 -0400
committerTakashi Iwai <tiwai@suse.de>2009-03-18 02:52:28 -0400
commit36c7b833e5d2501142a371e4e75281d3a29fbd6b (patch)
tree750835589dd140c8e78e62b77da2124d46262448 /sound/core
parent041b62374c7fedc11a8a1eeda2868612d3d1436c (diff)
ALSA: oss-mixer - Fixes recording gain control
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. Have tested two usb audio mic devices. Signed-off-by: Viral Mehta <viral.mehta@einfochips.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/core')
-rw-r--r--sound/core/oss/mixer_oss.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/sound/core/oss/mixer_oss.c b/sound/core/oss/mixer_oss.c
index 4690b8b5681f..e570649184e2 100644
--- a/sound/core/oss/mixer_oss.c
+++ b/sound/core/oss/mixer_oss.c
@@ -692,6 +692,9 @@ static int snd_mixer_oss_put_volume1(struct snd_mixer_oss_file *fmixer,
692 snd_mixer_oss_put_volume1_vol(fmixer, pslot, slot->numid[SNDRV_MIXER_OSS_ITEM_PVOLUME], left, right); 692 snd_mixer_oss_put_volume1_vol(fmixer, pslot, slot->numid[SNDRV_MIXER_OSS_ITEM_PVOLUME], left, right);
693 if (slot->present & SNDRV_MIXER_OSS_PRESENT_CVOLUME) 693 if (slot->present & SNDRV_MIXER_OSS_PRESENT_CVOLUME)
694 snd_mixer_oss_put_volume1_vol(fmixer, pslot, slot->numid[SNDRV_MIXER_OSS_ITEM_CVOLUME], left, right); 694 snd_mixer_oss_put_volume1_vol(fmixer, pslot, slot->numid[SNDRV_MIXER_OSS_ITEM_CVOLUME], left, right);
695 } else if (slot->present & SNDRV_MIXER_OSS_PRESENT_CVOLUME) {
696 snd_mixer_oss_put_volume1_vol(fmixer, pslot,
697 slot->numid[SNDRV_MIXER_OSS_ITEM_CVOLUME], left, right);
695 } else if (slot->present & SNDRV_MIXER_OSS_PRESENT_GVOLUME) { 698 } else if (slot->present & SNDRV_MIXER_OSS_PRESENT_GVOLUME) {
696 snd_mixer_oss_put_volume1_vol(fmixer, pslot, slot->numid[SNDRV_MIXER_OSS_ITEM_GVOLUME], left, right); 699 snd_mixer_oss_put_volume1_vol(fmixer, pslot, slot->numid[SNDRV_MIXER_OSS_ITEM_GVOLUME], left, right);
697 } else if (slot->present & SNDRV_MIXER_OSS_PRESENT_GLOBAL) { 700 } else if (slot->present & SNDRV_MIXER_OSS_PRESENT_GLOBAL) {