Skip to content

Commit 36c7b83

Browse files
Viral Mehtatiwai
authored andcommitted
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>
1 parent 041b623 commit 36c7b83

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

‎sound/core/oss/mixer_oss.c‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -692,6 +692,9 @@ static int snd_mixer_oss_put_volume1(struct snd_mixer_oss_file *fmixer,
692692
snd_mixer_oss_put_volume1_vol(fmixer, pslot, slot->numid[SNDRV_MIXER_OSS_ITEM_PVOLUME], left, right);
693693
if (slot->present & SNDRV_MIXER_OSS_PRESENT_CVOLUME)
694694
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);
695698
} else if (slot->present & SNDRV_MIXER_OSS_PRESENT_GVOLUME) {
696699
snd_mixer_oss_put_volume1_vol(fmixer, pslot, slot->numid[SNDRV_MIXER_OSS_ITEM_GVOLUME], left, right);
697700
} else if (slot->present & SNDRV_MIXER_OSS_PRESENT_GLOBAL) {

0 commit comments

Comments
 (0)