[alsa-devel] ALC882 on Abit AW9D-MAX

Takashi Iwai tiwai at suse.de
Fri Apr 20 16:28:09 CEST 2007


At Fri, 20 Apr 2007 14:13:18 +0300,
Dan Aloni wrote:
> 
> On Fri, Apr 20, 2007 at 01:00:03PM +0200, Takashi Iwai wrote:
> > At Fri, 20 Apr 2007 13:49:47 +0300,
> > Dan Aloni wrote:
> [...]
> > > case 4 originally does {1<=3,3<=2,2<=1}, my working fix effectively 
> > > adds {1<=2,2<=1}, which means we need to do {1<=1,3<=2,2<=3}, or just
> > > {3<=2,2<=3}.
> > > 
> > > Right?
> > 
> > Sounds so.  Could you attach the content of /proc/asound/card0/codec#*
> > file to re-check?
> 
> Okay. I got the following output *with* my fix applied:

Thanks.  Apparently the default pin config values are wrong, so it's a
BIOS bug.

I reread the pin-configuration spec and my last patch is correct.  The
configuration of 7.1 outputs is Front/CLFE/Rear/Side.  So, I committed
a patch to HG tree.

Now about your fix.  I think the best way is to override the pin
default configuration.  The patch below is the fix on the top of the
latest ALSA HG tree.  Use hg.alsa-project.org since
hg-mirror.alsa-project.org seems (again) out of sync right now.

I have a plan (even high position of my TODO list :) to move the
HD-audio configuration parser to user-space so that this kind of hack
/ fix would be more easily done.


Takashi

diff -r 67cb6a84c18a pci/hda/patch_realtek.c
--- a/pci/hda/patch_realtek.c	Fri Apr 20 16:11:43 2007 +0200
+++ b/pci/hda/patch_realtek.c	Fri Apr 20 16:16:25 2007 +0200
@@ -679,6 +679,38 @@ static void alc_subsystem_id(struct hda_
 		snd_hda_codec_write(codec, 0x1a, 0, AC_VERB_SET_PROC_COEF,
 				    (tmp == 5 ? 0x3040 : 0x3050));
 		break;
+	}
+}
+
+/*
+ * Fix-up pin default configurations
+ */
+
+struct alc_pincfg {
+	hda_nid_t nid;
+	u32 val;
+};
+
+static void alc_fix_pincfg(struct hda_codec *codec,
+			   const struct snd_pci_quirk *quirk,
+			   const struct alc_pincfg **pinfix)
+{
+	const struct alc_pincfg *cfg;
+
+	quirk = snd_pci_quirk_lookup(codec->bus->pci, quirk);
+	if (!quirk)
+		return;
+
+	cfg = pinfix[quirk->value];
+	for (; cfg->nid; cfg++) {
+		int i;
+		u32 val = cfg->val;
+		for (i = 0; i < 4; i++) {
+			snd_hda_codec_write(codec, cfg->nid, 0,
+				    AC_VERB_SET_CONFIG_DEFAULT_BYTES_0 + i,
+				    val & 0xff);
+			val >>= 8;
+		}
 	}
 }
 
@@ -5133,6 +5165,29 @@ static struct alc_config_preset alc882_p
 
 
 /*
+ * Pin config fixes
+ */
+enum { 
+	PINFIX_ABIT_AW9D_MAX
+};
+
+static struct alc_pincfg alc882_abit_aw9d_pinfix[] = {
+	{ 0x15, 0x01080104 }, /* side */
+	{ 0x16, 0x01011012 }, /* rear */
+	{ 0x17, 0x01016011 }, /* clfe */
+	{ }
+};
+
+static const struct alc_pincfg *alc882_pin_fixes[] = {
+	[PINFIX_ABIT_AW9D_MAX] = alc882_abit_aw9d_pinfix,
+};
+
+static struct snd_pci_quirk alc882_pinfix_tbl[] = {
+	SND_PCI_QUIRK(0x147b, 0x107a, "Abit AW9D-MAX", PINFIX_ABIT_AW9D_MAX),
+	{}
+};
+
+/*
  * BIOS auto configuration
  */
 static void alc882_auto_set_output_and_unmute(struct hda_codec *codec,
@@ -5253,6 +5308,8 @@ static int patch_alc882(struct hda_codec
 			board_config = ALC882_AUTO;
 		}
 	}
+
+	alc_fix_pincfg(codec, alc882_pinfix_tbl, alc882_pin_fixes);
 
 	if (board_config == ALC882_AUTO) {
 		/* automatic parse from the BIOS config */


More information about the Alsa-devel mailing list