ALSA: hda/realtek - Fix the possible conflicts of Bass Speaker name
authorTakashi Iwai <tiwai@suse.de>
Tue, 21 Feb 2012 11:35:27 +0000 (12:35 +0100)
committerTakashi Iwai <tiwai@suse.de>
Tue, 21 Feb 2012 11:36:37 +0000 (12:36 +0100)
When the multi-io is added to the two speaker output configuration,
the parser would try to add yet another "Bass Speaker" control since
it checks only cfg->line_outs.  Add a workaround for it by simply
passing the channel name in the case of multi-io outputs.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/pci/hda/patch_realtek.c

index 3cedb26f9cf5d494e9d4d9b2f0334d0384c5b471..e5c04593d360f78be44ff8295d342054a43320e0 100644 (file)
@@ -3613,14 +3613,17 @@ static int alc_auto_create_multi_out_ctls(struct hda_codec *codec,
                dac = spec->multiout.dac_nids[i];
                if (!dac)
                        continue;
-               if (i >= cfg->line_outs)
+               if (i >= cfg->line_outs) {
                        pin = spec->multi_io[i - 1].pin;
-               else
+                       index = 0;
+                       name = channel_name[i];
+               } else {
                        pin = cfg->line_out_pins[i];
+                       name = alc_get_line_out_pfx(spec, i, true, &index);
+               }
 
                sw = alc_look_for_out_mute_nid(codec, pin, dac);
                vol = alc_look_for_out_vol_nid(codec, pin, dac);
-               name = alc_get_line_out_pfx(spec, i, true, &index);
                if (!name || !strcmp(name, "CLFE")) {
                        /* Center/LFE */
                        err = alc_auto_add_vol_ctl(codec, "Center", 0, vol, 1);