[alsa-devel] Intel HD SigmaTel STAC9221 - Wrong input after output change

Takashi Iwai tiwai at suse.de
Tue May 29 17:30:28 CEST 2007


At Tue, 29 May 2007 17:06:05 +0200,
I wrote:
> 
> At Sun, 27 May 2007 23:33:27 +0100,
> Ivan N. Zlatev wrote:
> > 
> > Hello,
> > 
> > I am on an iMac ("*imac-20" model/pinconfig) with a Intel HD card with
> > the SigmaTel STAC9221 codec. I have attached the inital codec info
> > after modprobe. When I plug in and then unplug my speakers the
> > microphone stops working. Reproduction steps with codec dump diffs as
> > follows
> 
> I guess you can restore the status via toggling "Line In as Output
> Switch" and "Mic as Output Switch" mixer elements.  The problem looks
> like the unsolicited event handling.  It doesn't cope with the shared
> input jacks well.

In case my guess is correct, the patch below should fix the problem.
Give it a try.


Takashi

diff -r ff3ed7049f84 pci/hda/patch_sigmatel.c
--- a/pci/hda/patch_sigmatel.c	Tue May 29 16:03:00 2007 +0200
+++ b/pci/hda/patch_sigmatel.c	Tue May 29 17:25:52 2007 +0200
@@ -1797,6 +1797,21 @@ static void stac92xx_set_pinctl(struct h
 	unsigned int pin_ctl = snd_hda_codec_read(codec, nid,
 			0, AC_VERB_GET_PIN_WIDGET_CONTROL, 0x00);
 
+	if (pin_ctl & AC_PINCTL_IN_EN) {
+		/*
+		 * we need to check the current set-up direction of
+		 * shared input pins since they can be switched via
+		 * "xxx as Output" mixer switch
+		 */
+		struct sigmatel_spec *spec = codec->spec;
+		struct auto_pin_cfg *cfg = &spec->autocfg;
+		if ((nid == cfg->input_pins[AUTO_PIN_LINE] &&
+		     spec->line_switch) ||
+		    (nid == cfg->input_pins[AUTO_PIN_MIC] &&
+		     spec->mic_switch))
+			return;
+	}
+
 	/* if setting pin direction bits, clear the current
 	   direction bits first */
 	if (flag & (AC_PINCTL_IN_EN | AC_PINCTL_OUT_EN))


More information about the Alsa-devel mailing list