Skip to contentSkip to conversation

ALSA: VIA HDA: Fix A-A path mute can't refresh when smart5.1 is enabled.

PATCH In review lydiawang 2 participants 2 messages Apr 28, 2011 Sound

lore
Share & tools
lore

lydiawang

author
#0 lore raw

PATCH 1/1 ALSA: VIA HDA: Fix A-A path mute can't refresh when smart5.1 is enabled.

From: Lydia Wang <[email protected]>
Subject: ALSA: VIA HDA: Fix A-A path mute can't refresh when smart5.1 is enabled.

When Smart5.1 is enabled, A-A path volume should be muted and should be refreshed in mixer application.

sound/pci/hda/patch_via.c +7 -3
Index: sound-2.6/sound/pci/hda/patch_via.c
===================================================================
@@ -844,14 +844,18 @@
 {
 	int i;
 	struct snd_ctl_elem_id id;
-	const char *labels[] = {"Mic", "Front Mic", "Line"};
+	const char *labels[] = {"Mic", "Front Mic", "Line", "Rear Mic"};
+	struct snd_kcontrol *ctl;
 
 	memset(&id, 0, sizeof(id));
 	id.iface = SNDRV_CTL_ELEM_IFACE_MIXER;
 	for (i = 0; i < ARRAY_SIZE(labels); i++) {
 		sprintf(id.name, "%s Playback Volume", labels[i]);
-		snd_ctl_notify(codec->bus->card, SNDRV_CTL_EVENT_MASK_VALUE,
-			       &id);
+		ctl = snd_hda_find_mixer_ctl(codec, id.name);
+		if (ctl)
+			snd_ctl_notify(codec->bus->card,
+					SNDRV_CTL_EVENT_MASK_VALUE,
+					&ctl->id);
 	}
 }
 
#1 lore raw

At Thu, 28 Apr 2011 14:54:30 +0800,

Quoted 8 lines · lydiawang

From: Lydia Wang <[email protected]>
Subject: ALSA: VIA HDA: Fix A-A path mute can't refresh when smart5.1 is enabled.

When Smart5.1 is enabled, A-A path volume should be muted and should be refreshed in mixer application.

The code change looks good, but it doesn't match with the patch description. Please correct the changelog properly.

Quoted 1 line

From what I see in the patch, actually you fix two things here, the

call of snd_ctl_notify() to be processed properly, and add the missing "Rear Mic" mixer volume.

thanks,

Takashi

Quoted 27 lines

Index: sound-2.6/sound/pci/hda/patch_via.c
===================================================================

sound/pci/hda/patch_via.c +7 -3
@@ -844,14 +844,18 @@
 {
 	int i;
 	struct snd_ctl_elem_id id;
-	const char *labels[] = {"Mic", "Front Mic", "Line"};
+	const char *labels[] = {"Mic", "Front Mic", "Line", "Rear Mic"};
+	struct snd_kcontrol *ctl;
 
 	memset(&id, 0, sizeof(id));
 	id.iface = SNDRV_CTL_ELEM_IFACE_MIXER;
 	for (i = 0; i < ARRAY_SIZE(labels); i++) {
 		sprintf(id.name, "%s Playback Volume", labels[i]);
-		snd_ctl_notify(codec->bus->card, SNDRV_CTL_EVENT_MASK_VALUE,
-			       &id);
+		ctl = snd_hda_find_mixer_ctl(codec, id.name);
+		if (ctl)
+			snd_ctl_notify(codec->bus->card,
+					SNDRV_CTL_EVENT_MASK_VALUE,
+					&ctl->id);
 	}
 }