[alsa-devel] [PATCH] [SOUND] Fixes recording gain control
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) {
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
participants (2)
-
Takashi Iwai
-
Viral Mehta