Skip to contentSkip to conversation

ALSA: HDA: Pinfix quirk for HP Z200 Workstation

PATCH Applied David Henningsson 2 participants 5 messages Jun 22, 2011 – Jun 24, 2011 Sound

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ALSA: HDA: Pinfix quirk for HP Z200 Workstation

BIOS lists the internal speaker as an internal line-out. Change to internal speaker + model=auto for better auto-mute capabilities.

Relevant alsa-info is here: https://bugs.launchpad.net/ubuntu/+source/alsa-driver/+bug/754964/+attachment/2002204/+files/alsa-info.txt

Signature · 2 lines
David Henningsson, Canonical Ltd.
http://launchpad.net/~diwic
Quoted 1 line

From 86033a5031f8dffdb72bbdfac2286063ad5cd72d Mon Sep 17 00:00:00 2001

From: David Henningsson <[email protected]>
Date: Wed, 22 Jun 2011 09:58:37 +0200
Subject: [PATCH] ALSA: HDA: Pinfix quirk for HP Z200 Workstation

BIOS lists the internal speaker as an internal line-out. Change to internal speaker + model=auto for better auto-mute capabilities.

---
 sound/pci/hda/patch_realtek.c |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)
sound/pci/hda/patch_realtek.c +11 -0
index 4adf9e2..fe56b2b 100644
@@ -12600,6 +12600,7 @@ static const struct hda_verb alc262_toshiba_rx1_unsol_verbs[] = {
  */
 enum {
 	PINFIX_FSC_H270,
+	PINFIX_HP_Z200,
 };
 
 static const struct alc_fixup alc262_fixups[] = {
@@ -12612,9 +12613,17 @@ static const struct alc_fixup alc262_fixups[] = {
 			{ }
 		}
 	},
+	[PINFIX_HP_Z200] = {
+		.type = ALC_FIXUP_PINS,
+		.v.pins = (const struct alc_pincfg[]) {
+			{ 0x16, 0x99130120 }, /* internal speaker */
+			{ }
+		}
+	},
 };
 
 static const struct snd_pci_quirk alc262_fixup_tbl[] = {
+	SND_PCI_QUIRK(0x103c, 0x170b, "HP Z200", PINFIX_HP_Z200),
 	SND_PCI_QUIRK(0x1734, 0x1147, "FSC Celsius H270", PINFIX_FSC_H270),
 	{}
 };
@@ -12731,6 +12740,8 @@ static const struct snd_pci_quirk alc262_cfg_tbl[] = {
 			   ALC262_HP_BPC),
 	SND_PCI_QUIRK_MASK(0x103c, 0xff00, 0x1500, "HP z series",
 			   ALC262_HP_BPC),
+	SND_PCI_QUIRK(0x103c, 0x170b, "HP Z200",
+			   ALC262_AUTO),
 	SND_PCI_QUIRK_MASK(0x103c, 0xff00, 0x1700, "HP xw series",
 			   ALC262_HP_BPC),
 	SND_PCI_QUIRK(0x103c, 0x2800, "HP D7000", ALC262_HP_BPC_D7000_WL),
Signature · 1 line
1.7.4.1
Applied
#1 lore raw

At Wed, 22 Jun 2011 22:31:07 +0200,

Quoted 6 lines · David Henningsson

BIOS lists the internal speaker as an internal line-out. Change to internal speaker + model=auto for better auto-mute capabilities.

Relevant alsa-info is here:
https://bugs.launchpad.net/ubuntu/+source/alsa-driver/+bug/754964/+attachment/2002204/+files/alsa-info.txt

Thanks, applied now.

3.0 should work even without this patch since line-out can be auto-muted now, but it's still more correct to show the speaker as speaker (e.g. the right mixer name). So, it's still good to have this kind of fix.

Takashi

Quoted 62 lines
Signature · 4 lines
-- 
David Henningsson, Canonical Ltd.
http://launchpad.net/~diwic
[2 0001-ALSA-HDA-Pinfix-quirk-for-HP-Z200-Workstation.patch <text/x-patch (7bit)>]
Quoted 1 line

From 86033a5031f8dffdb72bbdfac2286063ad5cd72d Mon Sep 17 00:00:00 2001

From: David Henningsson <[email protected]>
Date: Wed, 22 Jun 2011 09:58:37 +0200
Subject: [PATCH] ALSA: HDA: Pinfix quirk for HP Z200 Workstation

BIOS lists the internal speaker as an internal line-out. Change to internal speaker + model=auto for better auto-mute capabilities.

---
 sound/pci/hda/patch_realtek.c |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)
sound/pci/hda/patch_realtek.c +11 -0
index 4adf9e2..fe56b2b 100644
@@ -12600,6 +12600,7 @@ static const struct hda_verb alc262_toshiba_rx1_unsol_verbs[] = {
  */
 enum {
 	PINFIX_FSC_H270,
+	PINFIX_HP_Z200,
 };
 
 static const struct alc_fixup alc262_fixups[] = {
@@ -12612,9 +12613,17 @@ static const struct alc_fixup alc262_fixups[] = {
 			{ }
 		}
 	},
+	[PINFIX_HP_Z200] = {
+		.type = ALC_FIXUP_PINS,
+		.v.pins = (const struct alc_pincfg[]) {
+			{ 0x16, 0x99130120 }, /* internal speaker */
+			{ }
+		}
+	},
 };
 
 static const struct snd_pci_quirk alc262_fixup_tbl[] = {
+	SND_PCI_QUIRK(0x103c, 0x170b, "HP Z200", PINFIX_HP_Z200),
 	SND_PCI_QUIRK(0x1734, 0x1147, "FSC Celsius H270", PINFIX_FSC_H270),
 	{}
 };
@@ -12731,6 +12740,8 @@ static const struct snd_pci_quirk alc262_cfg_tbl[] = {
 			   ALC262_HP_BPC),
 	SND_PCI_QUIRK_MASK(0x103c, 0xff00, 0x1500, "HP z series",
 			   ALC262_HP_BPC),
+	SND_PCI_QUIRK(0x103c, 0x170b, "HP Z200",
+			   ALC262_AUTO),
 	SND_PCI_QUIRK_MASK(0x103c, 0xff00, 0x1700, "HP xw series",
 			   ALC262_HP_BPC),
 	SND_PCI_QUIRK(0x103c, 0x2800, "HP D7000", ALC262_HP_BPC_D7000_WL),
Signature · 1 line
1.7.4.1
#2 lore raw
Quoted 9 lines · Takashi Iwai

At Wed, 22 Jun 2011 22:31:07 +0200,

Quoted 6 lines · David Henningsson

BIOS lists the internal speaker as an internal line-out. Change to internal speaker + model=auto for better auto-mute capabilities.

Relevant alsa-info is here:
https://bugs.launchpad.net/ubuntu/+source/alsa-driver/+bug/754964/+attachment/2002204/+files/alsa-info.txt

Quoted 6 lines

Thanks, applied now.

3.0 should work even without this patch since line-out can be auto-muted now, but it's still more correct to show the speaker as speaker (e.g. the right mixer name). So, it's still good to have this kind of fix.

I think it was not muted at all, because it is a mono pin, so it does not show up in the autocfg->line_out_pins array. (Perhaps this should change in the auto-mute behaviour?)

Also, the user wanted the real line out to mute the speaker.

Signature · 2 lines
David Henningsson, Canonical Ltd.
http://launchpad.net/~diwic
#3 lore raw

At Thu, 23 Jun 2011 10:28:25 +0200,

Quoted 13 lines · David Henningsson
Quoted 11 lines · Takashi Iwai

At Wed, 22 Jun 2011 22:31:07 +0200,

Quoted 6 lines · David Henningsson

BIOS lists the internal speaker as an internal line-out. Change to internal speaker + model=auto for better auto-mute capabilities.

Relevant alsa-info is here:
https://bugs.launchpad.net/ubuntu/+source/alsa-driver/+bug/754964/+attachment/2002204/+files/alsa-info.txt

Thanks, applied now.

Quoted 8 lines
Quoted 4 lines

3.0 should work even without this patch since line-out can be auto-muted now, but it's still more correct to show the speaker as speaker (e.g. the right mixer name). So, it's still good to have this kind of fix.

I think it was not muted at all, because it is a mono pin, so it does not show up in the autocfg->line_out_pins array. (Perhaps this should change in the auto-mute behaviour?)

Ah, right, these have the real line-out, too.
(The auto-mute can handle mono as well, but before that, the mono pin
has to be parsed properly :)

Quoted 1 line

Also, the user wanted the real line out to mute the speaker.

Yes, so the patch does the right thing.

thanks,

Takashi

#4 lore raw

At Thu, 23 Jun 2011 14:15:11 +0200,

Quoted 21 lines · Takashi Iwai

At Thu, 23 Jun 2011 10:28:25 +0200,

Quoted 18 lines · David Henningsson
Quoted 15 lines · Takashi Iwai

At Wed, 22 Jun 2011 22:31:07 +0200,

Quoted 6 lines · David Henningsson

BIOS lists the internal speaker as an internal line-out. Change to internal speaker + model=auto for better auto-mute capabilities.

Relevant alsa-info is here:
https://bugs.launchpad.net/ubuntu/+source/alsa-driver/+bug/754964/+attachment/2002204/+files/alsa-info.txt

Thanks, applied now.

3.0 should work even without this patch since line-out can be auto-muted now, but it's still more correct to show the speaker as speaker (e.g. the right mixer name). So, it's still good to have this kind of fix.

Quoted 7 lines
Quoted 3 lines

I think it was not muted at all, because it is a mono pin, so it does not show up in the autocfg->line_out_pins array. (Perhaps this should change in the auto-mute behaviour?)

Ah, right, these have the real line-out, too.
(The auto-mute can handle mono as well, but before that, the mono pin
has to be parsed properly :)

Looking further, another fix is to change the core-parser code like below. Since this doesn't conflict with the pinfix you made, I'll keep your fix for 3.0 but queue up for 3.1 kernel (in topic/hda branch).

Takashi

---
Subject: [PATCH] ALSA: hda - Add a workaround for invalid line-out setups

Some BIOS set up the pin config wrongly as line-out although it's supposed to be a speaker out. In most cases, though, we can judge the validity by checking the connection type -- when it's FIXED, mostly it's an invalid line-out but a speaker.

---
 sound/pci/hda/hda_codec.c |   15 ++++++++++++---
 1 files changed, 12 insertions(+), 3 deletions(-)
sound/pci/hda/hda_codec.c +12 -3
index a2388fc..654dc89 100644
@@ -4590,7 +4590,7 @@ int snd_hda_parse_pin_def_config(struct hda_codec *codec,
 		unsigned int wid_caps = get_wcaps(codec, nid);
 		unsigned int wid_type = get_wcaps_type(wid_caps);
 		unsigned int def_conf;
-		short assoc, loc;
+		short assoc, loc, conn, dev;
 
 		/* read all default configuration for pin complex */
 		if (wid_type != AC_WID_PIN)
@@ -4600,10 +4600,19 @@ int snd_hda_parse_pin_def_config(struct hda_codec *codec,
 			continue;
 
 		def_conf = snd_hda_codec_get_pincfg(codec, nid);
-		if (get_defcfg_connect(def_conf) == AC_JACK_PORT_NONE)
+		conn = get_defcfg_connect(def_conf);
+		if (conn == AC_JACK_PORT_NONE)
 			continue;
 		loc = get_defcfg_location(def_conf);
-		switch (get_defcfg_device(def_conf)) {
+		dev = get_defcfg_device(def_conf);
+
+		/* workaround for buggy BIOS setups */
+		if (dev == AC_JACK_LINE_OUT) {
+			if (conn == AC_JACK_PORT_FIXED)
+				dev = AC_JACK_SPEAKER;
+		}
+
+		switch (dev) {
 		case AC_JACK_LINE_OUT:
 			seq = get_defcfg_sequence(def_conf);
 			assoc = get_defcfg_association(def_conf);
Signature · 1 line
1.7.5.4