All of lore.kernel.org
 help / color / mirror / Atom feed
* Possible fix for snd-hda-intel model=no-jd failing since ~linux-3.9-rc1
@ 2014-09-11  7:47 Adam Richter
  2014-09-11  8:42 ` Takashi Iwai
  2014-09-11  9:07 ` David Henningsson
  0 siblings, 2 replies; 21+ messages in thread
From: Adam Richter @ 2014-09-11  7:47 UTC (permalink / raw)
  To: alsa-devel

[-- Attachment #1: Type: text/plain, Size: 3419 bytes --]

Hi.

This is a bug and suggested temporary fix that I originally posted to the linux-sound mailing list about a month and a half ago.  I am grateful to Takashi Awai for informing me after my follow-up inquiry about it today that I should submit it to the alsa-devel mailing list instead.  Please feel free to redirect me further if appropriate.  I did not notice any contact information for sound/pci/hda in
linux-3.16-rc4/MAINATINERS.

Anyhow, here is the bug report and a one line proposed temporary fix.


The "model=no-jd" argument has not initialized the analog audio output jack correctly for me since linux-3.9-rc1 (if I recall correctly) through linux-3.17-rc4, although I have not tried every release candidate in between.

The symptom is that, on a computer with an analog audio output jack
that has incorrect jack sense (a hardware bug), audio output is completely muted until I physically replug the cable, even though I specified "model=no-jd" as an argument to the snd-hda-intel kernel module, which is supposed to cause the kernel to ignore the jack sense reported by hardware and just drive the audio output even if the hardware jack sense indicates nothing is plugged in.  This problem did not occur until approximate Linux 3.9-rc1.

I have found a few single line workarounds that work, of which my
favorite is the following (also attached to this email, in case any
mailer subjects this message to reformatting), because it does not add
code to anything that gets called frequently.

--- linux-3.17.0-rc4-64bit/sound/pci/hda/hda_jack.c.orig    2014-09-07 16:09:43.000000000 -0700
+++ linux-3.17.0-rc4-64bit/sound/pci/hda/hda_jack.c    2014-09-10 18:41:53.422900040 -0700
@@ -106,6 +106,7 @@ snd_hda_jack_tbl_new(struct hda_codec *c
     jack->nid = nid;
     jack->jack_dirty = 1;
     jack->tag = codec->jacktbl.used;
+    jack->phantom_jack = codec->no_jack_detect;
     return jack;
 }
 EXPORT_SYMBOL_GPL(snd_hda_jack_tbl_new);


Signed-off-by: Adam J. Richter <adam_richter2004@yahoo.com>


I consider this a workaround rather than than a perfect fix, because I
think the underlying problem seems to be some kind of initialization
order issue that I don't fully understand.  Basically, by the time
jack->phantom_jack was being set, some caller had already called
jack_detect_update(), which loaded the incorrect jack sense result
from hardware and cleared jack->jack_dirty, so the jack sense would
not be set again.  At least that is what I think the underlying
problem probably is.

Also, if a change like this is to be integrated, I'd like to know if
it might be better for the line that I added to be:

          jack->phantom_jack = !is_jack_detectable(codec, nid);

...which is what add_jack_kctl does (not sure why add_jack_kctls does
not, by the way, at the risk of making a spectacle of my ignorance).
My doubt about this approach is that perhaps is_jack_detectable()
relies on some initialization that has not occurred at that point.

Anyhow, I'd like to get the process started of either pushing this
change upstream or quickly developing a more correct fix.  If a more
correct fix does not become apparent in the next few days, I would
recommend pushing the workaround upstream now until some future code
cleanup, so people will no longer be effected by the bug.

Any technical input or advice on how to proceed is welcome.  Thanks
for taking the time to consider this.


Adam Richter

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: jack.diff --]
[-- Type: text/x-patch; name="jack.diff", Size: 426 bytes --]

--- linux-3.17.0-rc4-64bit/sound/pci/hda/hda_jack.c.orig	2014-09-07 16:09:43.000000000 -0700
+++ linux-3.17.0-rc4-64bit/sound/pci/hda/hda_jack.c	2014-09-10 18:41:53.422900040 -0700
@@ -106,6 +106,7 @@ snd_hda_jack_tbl_new(struct hda_codec *c
 	jack->nid = nid;
 	jack->jack_dirty = 1;
 	jack->tag = codec->jacktbl.used;
+	jack->phantom_jack = codec->no_jack_detect;
 	return jack;
 }
 EXPORT_SYMBOL_GPL(snd_hda_jack_tbl_new);

[-- Attachment #3: Type: text/plain, Size: 0 bytes --]



^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: Possible fix for snd-hda-intel model=no-jd failing since ~linux-3.9-rc1
  2014-09-11  7:47 Possible fix for snd-hda-intel model=no-jd failing since ~linux-3.9-rc1 Adam Richter
@ 2014-09-11  8:42 ` Takashi Iwai
  2014-09-11  9:07 ` David Henningsson
  1 sibling, 0 replies; 21+ messages in thread
From: Takashi Iwai @ 2014-09-11  8:42 UTC (permalink / raw)
  To: Adam Richter; +Cc: alsa-devel

At Thu, 11 Sep 2014 00:47:19 -0700,
Adam Richter wrote:
> 
> Hi.
> 
> This is a bug and suggested temporary fix that I originally posted to the linux-sound mailing list about a month and a half ago.  I am grateful to Takashi Awai for informing me after my follow-up inquiry about it today that I should submit it to the alsa-devel mailing list instead.  Please feel free to redirect me further if appropriate.  I did not notice any contact information for sound/pci/hda in
> linux-3.16-rc4/MAINATINERS.
> 
> Anyhow, here is the bug report and a one line proposed temporary fix.
> 
> 
> The "model=no-jd" argument has not initialized the analog audio output jack correctly for me since linux-3.9-rc1 (if I recall correctly) through linux-3.17-rc4, although I have not tried every release candidate in between.
> 
> The symptom is that, on a computer with an analog audio output jack
> that has incorrect jack sense (a hardware bug), audio output is completely muted until I physically replug the cable, even though I specified "model=no-jd" as an argument to the snd-hda-intel kernel module, which is supposed to cause the kernel to ignore the jack sense reported by hardware and just drive the audio output even if the hardware jack sense indicates nothing is plugged in.  This problem did not occur until approximate Linux 3.9-rc1.
> 
> I have found a few single line workarounds that work, of which my
> favorite is the following (also attached to this email, in case any
> mailer subjects this message to reformatting), because it does not add
> code to anything that gets called frequently.
> 
> --- linux-3.17.0-rc4-64bit/sound/pci/hda/hda_jack.c.orig    2014-09-07 16:09:43.000000000 -0700
> +++ linux-3.17.0-rc4-64bit/sound/pci/hda/hda_jack.c    2014-09-10 18:41:53.422900040 -0700
> @@ -106,6 +106,7 @@ snd_hda_jack_tbl_new(struct hda_codec *c
>      jack->nid = nid;
>      jack->jack_dirty = 1;
>      jack->tag = codec->jacktbl.used;
> +    jack->phantom_jack = codec->no_jack_detect;
>      return jack;
>  }
>  EXPORT_SYMBOL_GPL(snd_hda_jack_tbl_new);
> 
> 
> Signed-off-by: Adam J. Richter <adam_richter2004@yahoo.com>
> 
> 
> I consider this a workaround rather than than a perfect fix, because I
> think the underlying problem seems to be some kind of initialization
> order issue that I don't fully understand.  Basically, by the time
> jack->phantom_jack was being set, some caller had already called
> jack_detect_update(), which loaded the incorrect jack sense result
> from hardware and cleared jack->jack_dirty, so the jack sense would
> not be set again.  At least that is what I think the underlying
> problem probably is.
> 
> Also, if a change like this is to be integrated, I'd like to know if
> it might be better for the line that I added to be:
> 
>           jack->phantom_jack = !is_jack_detectable(codec, nid);
> 
> ...which is what add_jack_kctl does (not sure why add_jack_kctls does
> not, by the way, at the risk of making a spectacle of my ignorance).
> My doubt about this approach is that perhaps is_jack_detectable()
> relies on some initialization that has not occurred at that point.
> 
> Anyhow, I'd like to get the process started of either pushing this
> change upstream or quickly developing a more correct fix.  If a more
> correct fix does not become apparent in the next few days, I would
> recommend pushing the workaround upstream now until some future code
> cleanup, so people will no longer be effected by the bug.
> 
> Any technical input or advice on how to proceed is welcome.  Thanks
> for taking the time to consider this.

Could you give alsa-info.sh output on your machine?  Otherwise it's
difficult to analyze.

Speaking of your patch: add_jack_kctl() itself has a check of
is_jack_detectable() for phantom jacks, so basically this shouldn't
make any difference.  So we need to check more deeply why this change
is really needed.


thanks,

Takashi


> 
> 
> Adam Richter
> --- linux-3.17.0-rc4-64bit/sound/pci/hda/hda_jack.c.orig	2014-09-07 16:09:43.000000000 -0700
> +++ linux-3.17.0-rc4-64bit/sound/pci/hda/hda_jack.c	2014-09-10 18:41:53.422900040 -0700
> @@ -106,6 +106,7 @@ snd_hda_jack_tbl_new(struct hda_codec *c
>  	jack->nid = nid;
>  	jack->jack_dirty = 1;
>  	jack->tag = codec->jacktbl.used;
> +	jack->phantom_jack = codec->no_jack_detect;
>  	return jack;
>  }
>  EXPORT_SYMBOL_GPL(snd_hda_jack_tbl_new);
> _______________________________________________
> Alsa-devel mailing list
> Alsa-devel@alsa-project.org
> http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: Possible fix for snd-hda-intel model=no-jd failing since ~linux-3.9-rc1
  2014-09-11  7:47 Possible fix for snd-hda-intel model=no-jd failing since ~linux-3.9-rc1 Adam Richter
  2014-09-11  8:42 ` Takashi Iwai
@ 2014-09-11  9:07 ` David Henningsson
  2014-09-11  9:09   ` Takashi Iwai
  2014-09-11  9:23   ` Takashi Iwai
  1 sibling, 2 replies; 21+ messages in thread
From: David Henningsson @ 2014-09-11  9:07 UTC (permalink / raw)
  To: Adam Richter, alsa-devel, Takashi Iwai

[-- Attachment #1: Type: text/plain, Size: 4460 bytes --]



On 2014-09-11 09:47, Adam Richter wrote:
> Hi.

Hi Adam,

Interesting problem. Could you submit alsa-info ( 
http://www.alsa-project.org/alsa-info.sh ) and point us to it? It makes 
it possible to run the code in an emulator.

> This is a bug and suggested temporary fix that I originally posted to the linux-sound mailing list about a month and a half ago.  I am grateful to Takashi Awai for informing me after my follow-up inquiry about it today that I should submit it to the alsa-devel mailing list instead.  Please feel free to redirect me further if appropriate.  I did not notice any contact information for sound/pci/hda in
> linux-3.16-rc4/MAINATINERS.
>
> Anyhow, here is the bug report and a one line proposed temporary fix.
>
>
> The "model=no-jd" argument has not initialized the analog audio output jack correctly for me since linux-3.9-rc1 (if I recall correctly) through linux-3.17-rc4, although I have not tried every release candidate in between.

A lot of things changed with 3.9, so that makes sense. Btw, 
"model=no-jd" works only for specific machines. You can use the hint 
"jack-detect=0" instead.

> The symptom is that, on a computer with an analog audio output jack
> that has incorrect jack sense (a hardware bug), audio output is completely muted until I physically replug the cable, even though I specified "model=no-jd" as an argument to the snd-hda-intel kernel module, which is supposed to cause the kernel to ignore the jack sense reported by hardware and just drive the audio output even if the hardware jack sense indicates nothing is plugged in.  This problem did not occur until approximate Linux 3.9-rc1.
>
> I have found a few single line workarounds that work, of which my
> favorite is the following (also attached to this email, in case any
> mailer subjects this message to reformatting), because it does not add
> code to anything that gets called frequently.
>
> --- linux-3.17.0-rc4-64bit/sound/pci/hda/hda_jack.c.orig    2014-09-07 16:09:43.000000000 -0700
> +++ linux-3.17.0-rc4-64bit/sound/pci/hda/hda_jack.c    2014-09-10 18:41:53.422900040 -0700
> @@ -106,6 +106,7 @@ snd_hda_jack_tbl_new(struct hda_codec *c
>       jack->nid = nid;
>       jack->jack_dirty = 1;
>       jack->tag = codec->jacktbl.used;
> +    jack->phantom_jack = codec->no_jack_detect;
>       return jack;
>   }
>   EXPORT_SYMBOL_GPL(snd_hda_jack_tbl_new);
>
>
> Signed-off-by: Adam J. Richter <adam_richter2004@yahoo.com>
>
>
> I consider this a workaround rather than than a perfect fix, because I
> think the underlying problem seems to be some kind of initialization
> order issue that I don't fully understand.  Basically, by the time
> jack->phantom_jack was being set, some caller had already called
> jack_detect_update(), which loaded the incorrect jack sense result
> from hardware and cleared jack->jack_dirty, so the jack sense would
> not be set again.  At least that is what I think the underlying
> problem probably is.
>
> Also, if a change like this is to be integrated, I'd like to know if
> it might be better for the line that I added to be:
>
>            jack->phantom_jack = !is_jack_detectable(codec, nid);

Yes, this would probably be better.

I guess that somehow snd_hda_jack_enable_callback gets called for the 
phantom jack, but I'm not sure exactly how (alsa-info would help).

Nevertheless I'm attaching a patch. I assume it also resolves your problem?

Takashi, what do you think of the attached patch?

>
> ...which is what add_jack_kctl does (not sure why add_jack_kctls does
> not, by the way, at the risk of making a spectacle of my ignorance).
> My doubt about this approach is that perhaps is_jack_detectable()
> relies on some initialization that has not occurred at that point.
>
> Anyhow, I'd like to get the process started of either pushing this
> change upstream or quickly developing a more correct fix.  If a more
> correct fix does not become apparent in the next few days, I would
> recommend pushing the workaround upstream now until some future code
> cleanup, so people will no longer be effected by the bug.
>
> Any technical input or advice on how to proceed is welcome.  Thanks
> for taking the time to consider this.
>
>
> Adam Richter
>
>
>
> _______________________________________________
> Alsa-devel mailing list
> Alsa-devel@alsa-project.org
> http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
>

-- 
David Henningsson, Canonical Ltd.
https://launchpad.net/~diwic

[-- Attachment #2: 0001-ALSA-hda-Do-not-enable-unsol-events-on-phantom-jacks.patch --]
[-- Type: text/x-patch, Size: 4223 bytes --]

>From e5ce94c6156d1c588f29745ade06d1d76c87a0a1 Mon Sep 17 00:00:00 2001
From: David Henningsson <david.henningsson@canonical.com>
Date: Thu, 11 Sep 2014 11:04:42 +0200
Subject: [PATCH] ALSA: hda - Do not enable unsol events on phantom jacks

To make sure we don't enable unsol events on phantom jacks,
we move the logic for determining what a phantom jack is to
snd_hda_jack_tbl_new.

Reported-by: Adam Richter <adam_richter2004@yahoo.com>
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
---
 sound/pci/hda/hda_jack.c | 35 +++++++++++++++++++----------------
 1 file changed, 19 insertions(+), 16 deletions(-)

diff --git a/sound/pci/hda/hda_jack.c b/sound/pci/hda/hda_jack.c
index 9746d73..376ce8f 100644
--- a/sound/pci/hda/hda_jack.c
+++ b/sound/pci/hda/hda_jack.c
@@ -105,6 +105,12 @@ snd_hda_jack_tbl_new(struct hda_codec *codec, hda_nid_t nid)
 		return NULL;
 	jack->nid = nid;
 	jack->jack_dirty = 1;
+	if (get_wcaps_type(get_wcaps(codec, nid)) == AC_WID_PIN) {
+		unsigned int def_conf = snd_hda_codec_get_pincfg(codec, nid);
+		unsigned int conn = get_defcfg_connect(def_conf);
+		if ((conn != AC_JACK_PORT_COMPLEX) || !is_jack_detectable(codec, nid))
+			jack->phantom_jack = 1;
+	}
 	jack->tag = codec->jacktbl.used;
 	return jack;
 }
@@ -230,6 +236,8 @@ int snd_hda_jack_detect_enable_callback(struct hda_codec *codec, hda_nid_t nid,
 		jack->action = action;
 	if (cb)
 		jack->callback = cb;
+	if (jack->phantom_jack)
+		return 0;
 	if (codec->jackpoll_interval > 0)
 		return 0; /* No unsol if we're polling instead */
 	return snd_hda_codec_write_cache(codec, nid, 0,
@@ -334,8 +342,8 @@ static void hda_free_jack_priv(struct snd_jack *jack)
  * This assigns a jack-detection kctl to the given pin.  The kcontrol
  * will have the given name and index.
  */
-static int __snd_hda_jack_add_kctl(struct hda_codec *codec, hda_nid_t nid,
-			  const char *name, int idx, bool phantom_jack)
+int snd_hda_jack_add_kctl(struct hda_codec *codec, hda_nid_t nid,
+			  const char *name, int idx)
 {
 	struct hda_jack_tbl *jack;
 	struct snd_kcontrol *kctl;
@@ -353,12 +361,11 @@ static int __snd_hda_jack_add_kctl(struct hda_codec *codec, hda_nid_t nid,
 	if (err < 0)
 		return err;
 	jack->kctl = kctl;
-	jack->phantom_jack = !!phantom_jack;
 
 	state = snd_hda_jack_detect(codec, nid);
 	snd_kctl_jack_report(codec->bus->card, kctl, state);
 #ifdef CONFIG_SND_HDA_INPUT_JACK
-	if (!phantom_jack) {
+	if (!jack->phantom_jack) {
 		jack->type = get_input_jack_type(codec, nid);
 		err = snd_jack_new(codec->bus->card, name, jack->type,
 				   &jack->jack);
@@ -371,12 +378,6 @@ static int __snd_hda_jack_add_kctl(struct hda_codec *codec, hda_nid_t nid,
 #endif
 	return 0;
 }
-
-int snd_hda_jack_add_kctl(struct hda_codec *codec, hda_nid_t nid,
-			  const char *name, int idx)
-{
-	return __snd_hda_jack_add_kctl(codec, nid, name, idx, false);
-}
 EXPORT_SYMBOL_GPL(snd_hda_jack_add_kctl);
 
 /* get the unique index number for the given kctl name */
@@ -406,7 +407,7 @@ static int add_jack_kctl(struct hda_codec *codec, hda_nid_t nid,
 	unsigned int def_conf, conn;
 	char name[SNDRV_CTL_ELEM_ID_NAME_MAXLEN];
 	int idx, err;
-	bool phantom_jack;
+	struct hda_jack_tbl *jack;
 
 	if (!nid)
 		return 0;
@@ -414,23 +415,25 @@ static int add_jack_kctl(struct hda_codec *codec, hda_nid_t nid,
 	conn = get_defcfg_connect(def_conf);
 	if (conn == AC_JACK_PORT_NONE)
 		return 0;
-	phantom_jack = (conn != AC_JACK_PORT_COMPLEX) ||
-		       !is_jack_detectable(codec, nid);
 
 	if (base_name) {
 		strlcpy(name, base_name, sizeof(name));
 		idx = 0;
 	} else
 		snd_hda_get_pin_label(codec, nid, cfg, name, sizeof(name), &idx);
-	if (phantom_jack)
+
+	jack = snd_hda_jack_tbl_new(codec, nid);
+	if (!jack)
+		return -ENOMEM;
+	if (jack->phantom_jack)
 		/* Example final name: "Internal Mic Phantom Jack" */
 		strncat(name, " Phantom", sizeof(name) - strlen(name) - 1);
 	idx = get_unique_index(codec, name, idx);
-	err = __snd_hda_jack_add_kctl(codec, nid, name, idx, phantom_jack);
+	err = snd_hda_jack_add_kctl(codec, nid, name, idx);
 	if (err < 0)
 		return err;
 
-	if (!phantom_jack)
+	if (!jack->phantom_jack)
 		return snd_hda_jack_detect_enable(codec, nid, 0);
 	return 0;
 }
-- 
1.9.1


[-- Attachment #3: Type: text/plain, Size: 0 bytes --]



^ permalink raw reply related	[flat|nested] 21+ messages in thread

* Re: Possible fix for snd-hda-intel model=no-jd failing since ~linux-3.9-rc1
  2014-09-11  9:07 ` David Henningsson
@ 2014-09-11  9:09   ` Takashi Iwai
  2014-09-11  9:23   ` Takashi Iwai
  1 sibling, 0 replies; 21+ messages in thread
From: Takashi Iwai @ 2014-09-11  9:09 UTC (permalink / raw)
  To: David Henningsson; +Cc: Adam Richter, alsa-devel

At Thu, 11 Sep 2014 11:07:10 +0200,
David Henningsson wrote:
> 
> 
> 
> On 2014-09-11 09:47, Adam Richter wrote:
> > Hi.
> 
> Hi Adam,
> 
> Interesting problem. Could you submit alsa-info ( 
> http://www.alsa-project.org/alsa-info.sh ) and point us to it? It makes 
> it possible to run the code in an emulator.
> 
> > This is a bug and suggested temporary fix that I originally posted to the linux-sound mailing list about a month and a half ago.  I am grateful to Takashi Awai for informing me after my follow-up inquiry about it today that I should submit it to the alsa-devel mailing list instead.  Please feel free to redirect me further if appropriate.  I did not notice any contact information for sound/pci/hda in
> > linux-3.16-rc4/MAINATINERS.
> >
> > Anyhow, here is the bug report and a one line proposed temporary fix.
> >
> >
> > The "model=no-jd" argument has not initialized the analog audio output jack correctly for me since linux-3.9-rc1 (if I recall correctly) through linux-3.17-rc4, although I have not tried every release candidate in between.
> 
> A lot of things changed with 3.9, so that makes sense. Btw, 
> "model=no-jd" works only for specific machines. You can use the hint 
> "jack-detect=0" instead.
> 
> > The symptom is that, on a computer with an analog audio output jack
> > that has incorrect jack sense (a hardware bug), audio output is completely muted until I physically replug the cable, even though I specified "model=no-jd" as an argument to the snd-hda-intel kernel module, which is supposed to cause the kernel to ignore the jack sense reported by hardware and just drive the audio output even if the hardware jack sense indicates nothing is plugged in.  This problem did not occur until approximate Linux 3.9-rc1.
> >
> > I have found a few single line workarounds that work, of which my
> > favorite is the following (also attached to this email, in case any
> > mailer subjects this message to reformatting), because it does not add
> > code to anything that gets called frequently.
> >
> > --- linux-3.17.0-rc4-64bit/sound/pci/hda/hda_jack.c.orig    2014-09-07 16:09:43.000000000 -0700
> > +++ linux-3.17.0-rc4-64bit/sound/pci/hda/hda_jack.c    2014-09-10 18:41:53.422900040 -0700
> > @@ -106,6 +106,7 @@ snd_hda_jack_tbl_new(struct hda_codec *c
> >       jack->nid = nid;
> >       jack->jack_dirty = 1;
> >       jack->tag = codec->jacktbl.used;
> > +    jack->phantom_jack = codec->no_jack_detect;
> >       return jack;
> >   }
> >   EXPORT_SYMBOL_GPL(snd_hda_jack_tbl_new);
> >
> >
> > Signed-off-by: Adam J. Richter <adam_richter2004@yahoo.com>
> >
> >
> > I consider this a workaround rather than than a perfect fix, because I
> > think the underlying problem seems to be some kind of initialization
> > order issue that I don't fully understand.  Basically, by the time
> > jack->phantom_jack was being set, some caller had already called
> > jack_detect_update(), which loaded the incorrect jack sense result
> > from hardware and cleared jack->jack_dirty, so the jack sense would
> > not be set again.  At least that is what I think the underlying
> > problem probably is.
> >
> > Also, if a change like this is to be integrated, I'd like to know if
> > it might be better for the line that I added to be:
> >
> >            jack->phantom_jack = !is_jack_detectable(codec, nid);
> 
> Yes, this would probably be better.
> 
> I guess that somehow snd_hda_jack_enable_callback gets called for the 
> phantom jack, but I'm not sure exactly how (alsa-info would help).
> 
> Nevertheless I'm attaching a patch. I assume it also resolves your problem?
> 
> Takashi, what do you think of the attached patch?

I'd comment only after I see alsa-info.sh output.  The patch above
just makes it phantom without changing the name suffix, which looks
bogus.  So, I prefer fixing in a better way.

Of course, more important to know why it happens and how.


Takashi

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: Possible fix for snd-hda-intel model=no-jd failing since ~linux-3.9-rc1
  2014-09-11  9:07 ` David Henningsson
  2014-09-11  9:09   ` Takashi Iwai
@ 2014-09-11  9:23   ` Takashi Iwai
  2014-09-11  9:42     ` David Henningsson
  1 sibling, 1 reply; 21+ messages in thread
From: Takashi Iwai @ 2014-09-11  9:23 UTC (permalink / raw)
  To: David Henningsson; +Cc: Adam Richter, alsa-devel

At Thu, 11 Sep 2014 11:07:10 +0200,
David Henningsson wrote:
> 
> 
> 
> On 2014-09-11 09:47, Adam Richter wrote:
> > Hi.
> 
> Hi Adam,
> 
> Interesting problem. Could you submit alsa-info ( 
> http://www.alsa-project.org/alsa-info.sh ) and point us to it? It makes 
> it possible to run the code in an emulator.
> 
> > This is a bug and suggested temporary fix that I originally posted to the linux-sound mailing list about a month and a half ago.  I am grateful to Takashi Awai for informing me after my follow-up inquiry about it today that I should submit it to the alsa-devel mailing list instead.  Please feel free to redirect me further if appropriate.  I did not notice any contact information for sound/pci/hda in
> > linux-3.16-rc4/MAINATINERS.
> >
> > Anyhow, here is the bug report and a one line proposed temporary fix.
> >
> >
> > The "model=no-jd" argument has not initialized the analog audio output jack correctly for me since linux-3.9-rc1 (if I recall correctly) through linux-3.17-rc4, although I have not tried every release candidate in between.
> 
> A lot of things changed with 3.9, so that makes sense. Btw, 
> "model=no-jd" works only for specific machines. You can use the hint 
> "jack-detect=0" instead.
> 
> > The symptom is that, on a computer with an analog audio output jack
> > that has incorrect jack sense (a hardware bug), audio output is completely muted until I physically replug the cable, even though I specified "model=no-jd" as an argument to the snd-hda-intel kernel module, which is supposed to cause the kernel to ignore the jack sense reported by hardware and just drive the audio output even if the hardware jack sense indicates nothing is plugged in.  This problem did not occur until approximate Linux 3.9-rc1.
> >
> > I have found a few single line workarounds that work, of which my
> > favorite is the following (also attached to this email, in case any
> > mailer subjects this message to reformatting), because it does not add
> > code to anything that gets called frequently.
> >
> > --- linux-3.17.0-rc4-64bit/sound/pci/hda/hda_jack.c.orig    2014-09-07 16:09:43.000000000 -0700
> > +++ linux-3.17.0-rc4-64bit/sound/pci/hda/hda_jack.c    2014-09-10 18:41:53.422900040 -0700
> > @@ -106,6 +106,7 @@ snd_hda_jack_tbl_new(struct hda_codec *c
> >       jack->nid = nid;
> >       jack->jack_dirty = 1;
> >       jack->tag = codec->jacktbl.used;
> > +    jack->phantom_jack = codec->no_jack_detect;
> >       return jack;
> >   }
> >   EXPORT_SYMBOL_GPL(snd_hda_jack_tbl_new);
> >
> >
> > Signed-off-by: Adam J. Richter <adam_richter2004@yahoo.com>
> >
> >
> > I consider this a workaround rather than than a perfect fix, because I
> > think the underlying problem seems to be some kind of initialization
> > order issue that I don't fully understand.  Basically, by the time
> > jack->phantom_jack was being set, some caller had already called
> > jack_detect_update(), which loaded the incorrect jack sense result
> > from hardware and cleared jack->jack_dirty, so the jack sense would
> > not be set again.  At least that is what I think the underlying
> > problem probably is.
> >
> > Also, if a change like this is to be integrated, I'd like to know if
> > it might be better for the line that I added to be:
> >
> >            jack->phantom_jack = !is_jack_detectable(codec, nid);
> 
> Yes, this would probably be better.
> 
> I guess that somehow snd_hda_jack_enable_callback gets called for the 
> phantom jack, but I'm not sure exactly how (alsa-info would help).
> 
> Nevertheless I'm attaching a patch. I assume it also resolves your problem?
> 
> Takashi, what do you think of the attached patch?

Ah, "attached" was meant *your* attached patch.  Let me see...

> From e5ce94c6156d1c588f29745ade06d1d76c87a0a1 Mon Sep 17 00:00:00 2001
> From: David Henningsson <david.henningsson@canonical.com>
> Date: Thu, 11 Sep 2014 11:04:42 +0200
> Subject: [PATCH] ALSA: hda - Do not enable unsol events on phantom jacks
> 
> To make sure we don't enable unsol events on phantom jacks,
> we move the logic for determining what a phantom jack is to
> snd_hda_jack_tbl_new.
> 
> Reported-by: Adam Richter <adam_richter2004@yahoo.com>
> Signed-off-by: David Henningsson <david.henningsson@canonical.com>
> ---
>  sound/pci/hda/hda_jack.c | 35 +++++++++++++++++++----------------
>  1 file changed, 19 insertions(+), 16 deletions(-)
> 
> diff --git a/sound/pci/hda/hda_jack.c b/sound/pci/hda/hda_jack.c
> index 9746d73..376ce8f 100644
> --- a/sound/pci/hda/hda_jack.c
> +++ b/sound/pci/hda/hda_jack.c
> @@ -105,6 +105,12 @@ snd_hda_jack_tbl_new(struct hda_codec *codec, hda_nid_t nid)
>  		return NULL;
>  	jack->nid = nid;
>  	jack->jack_dirty = 1;
> +	if (get_wcaps_type(get_wcaps(codec, nid)) == AC_WID_PIN) {
> +		unsigned int def_conf = snd_hda_codec_get_pincfg(codec, nid);
> +		unsigned int conn = get_defcfg_connect(def_conf);
> +		if ((conn != AC_JACK_PORT_COMPLEX) || !is_jack_detectable(codec, nid))
> +			jack->phantom_jack = 1;
> +	}

This doesn't look good.  The pincfg isn't always reliable at this
point.  The pin connection check is used in add_jack_kctl() in the
current code just because its only caller is snd_hda_jack_add_kctls(),
which takes the pincfg explicitly.  But snd_hda_jakc_tbl_new() itself
is neutral about the pincfg.

And, another problem is that it'll result in a phantom jack secretly
without adding a proper name suffix.

In anyway, for catching such a bug, maybe we should put a WARN_ON() at
snd_hda_jack_detect_enable_callback() like the patch below.


Takashi

--
diff --git a/sound/pci/hda/hda_jack.c b/sound/pci/hda/hda_jack.c
index 9746d73cec52..0645735e196d 100644
--- a/sound/pci/hda/hda_jack.c
+++ b/sound/pci/hda/hda_jack.c
@@ -225,6 +225,8 @@ int snd_hda_jack_detect_enable_callback(struct hda_codec *codec, hda_nid_t nid,
 		return -ENOMEM;
 	if (jack->jack_detect)
 		return 0; /* already registered */
+	if (WARN_ON(!is_jack_detectable(codec, nid)))
+		return 0;
 	jack->jack_detect = 1;
 	if (action)
 		jack->action = action;

^ permalink raw reply related	[flat|nested] 21+ messages in thread

* Re: Possible fix for snd-hda-intel model=no-jd failing since ~linux-3.9-rc1
  2014-09-11  9:23   ` Takashi Iwai
@ 2014-09-11  9:42     ` David Henningsson
  2014-09-11 10:07       ` Takashi Iwai
  0 siblings, 1 reply; 21+ messages in thread
From: David Henningsson @ 2014-09-11  9:42 UTC (permalink / raw)
  To: Takashi Iwai; +Cc: Adam Richter, alsa-devel



On 2014-09-11 11:23, Takashi Iwai wrote:
> At Thu, 11 Sep 2014 11:07:10 +0200,
> David Henningsson wrote:
>>
>>
>>
>> On 2014-09-11 09:47, Adam Richter wrote:
>>> Hi.
>>
>> Hi Adam,
>>
>> Interesting problem. Could you submit alsa-info (
>> http://www.alsa-project.org/alsa-info.sh ) and point us to it? It makes
>> it possible to run the code in an emulator.
>>
>>> This is a bug and suggested temporary fix that I originally posted to the linux-sound mailing list about a month and a half ago.  I am grateful to Takashi Awai for informing me after my follow-up inquiry about it today that I should submit it to the alsa-devel mailing list instead.  Please feel free to redirect me further if appropriate.  I did not notice any contact information for sound/pci/hda in
>>> linux-3.16-rc4/MAINATINERS.
>>>
>>> Anyhow, here is the bug report and a one line proposed temporary fix.
>>>
>>>
>>> The "model=no-jd" argument has not initialized the analog audio output jack correctly for me since linux-3.9-rc1 (if I recall correctly) through linux-3.17-rc4, although I have not tried every release candidate in between.
>>
>> A lot of things changed with 3.9, so that makes sense. Btw,
>> "model=no-jd" works only for specific machines. You can use the hint
>> "jack-detect=0" instead.
>>
>>> The symptom is that, on a computer with an analog audio output jack
>>> that has incorrect jack sense (a hardware bug), audio output is completely muted until I physically replug the cable, even though I specified "model=no-jd" as an argument to the snd-hda-intel kernel module, which is supposed to cause the kernel to ignore the jack sense reported by hardware and just drive the audio output even if the hardware jack sense indicates nothing is plugged in.  This problem did not occur until approximate Linux 3.9-rc1.
>>>
>>> I have found a few single line workarounds that work, of which my
>>> favorite is the following (also attached to this email, in case any
>>> mailer subjects this message to reformatting), because it does not add
>>> code to anything that gets called frequently.
>>>
>>> --- linux-3.17.0-rc4-64bit/sound/pci/hda/hda_jack.c.orig    2014-09-07 16:09:43.000000000 -0700
>>> +++ linux-3.17.0-rc4-64bit/sound/pci/hda/hda_jack.c    2014-09-10 18:41:53.422900040 -0700
>>> @@ -106,6 +106,7 @@ snd_hda_jack_tbl_new(struct hda_codec *c
>>>        jack->nid = nid;
>>>        jack->jack_dirty = 1;
>>>        jack->tag = codec->jacktbl.used;
>>> +    jack->phantom_jack = codec->no_jack_detect;
>>>        return jack;
>>>    }
>>>    EXPORT_SYMBOL_GPL(snd_hda_jack_tbl_new);
>>>
>>>
>>> Signed-off-by: Adam J. Richter <adam_richter2004@yahoo.com>
>>>
>>>
>>> I consider this a workaround rather than than a perfect fix, because I
>>> think the underlying problem seems to be some kind of initialization
>>> order issue that I don't fully understand.  Basically, by the time
>>> jack->phantom_jack was being set, some caller had already called
>>> jack_detect_update(), which loaded the incorrect jack sense result
>>> from hardware and cleared jack->jack_dirty, so the jack sense would
>>> not be set again.  At least that is what I think the underlying
>>> problem probably is.
>>>
>>> Also, if a change like this is to be integrated, I'd like to know if
>>> it might be better for the line that I added to be:
>>>
>>>             jack->phantom_jack = !is_jack_detectable(codec, nid);
>>
>> Yes, this would probably be better.
>>
>> I guess that somehow snd_hda_jack_enable_callback gets called for the
>> phantom jack, but I'm not sure exactly how (alsa-info would help).
>>
>> Nevertheless I'm attaching a patch. I assume it also resolves your problem?
>>
>> Takashi, what do you think of the attached patch?
>
> Ah, "attached" was meant *your* attached patch.  Let me see...
>
>>  From e5ce94c6156d1c588f29745ade06d1d76c87a0a1 Mon Sep 17 00:00:00 2001
>> From: David Henningsson <david.henningsson@canonical.com>
>> Date: Thu, 11 Sep 2014 11:04:42 +0200
>> Subject: [PATCH] ALSA: hda - Do not enable unsol events on phantom jacks
>>
>> To make sure we don't enable unsol events on phantom jacks,
>> we move the logic for determining what a phantom jack is to
>> snd_hda_jack_tbl_new.
>>
>> Reported-by: Adam Richter <adam_richter2004@yahoo.com>
>> Signed-off-by: David Henningsson <david.henningsson@canonical.com>
>> ---
>>   sound/pci/hda/hda_jack.c | 35 +++++++++++++++++++----------------
>>   1 file changed, 19 insertions(+), 16 deletions(-)
>>
>> diff --git a/sound/pci/hda/hda_jack.c b/sound/pci/hda/hda_jack.c
>> index 9746d73..376ce8f 100644
>> --- a/sound/pci/hda/hda_jack.c
>> +++ b/sound/pci/hda/hda_jack.c
>> @@ -105,6 +105,12 @@ snd_hda_jack_tbl_new(struct hda_codec *codec, hda_nid_t nid)
>>   		return NULL;
>>   	jack->nid = nid;
>>   	jack->jack_dirty = 1;
>> +	if (get_wcaps_type(get_wcaps(codec, nid)) == AC_WID_PIN) {
>> +		unsigned int def_conf = snd_hda_codec_get_pincfg(codec, nid);
>> +		unsigned int conn = get_defcfg_connect(def_conf);
>> +		if ((conn != AC_JACK_PORT_COMPLEX) || !is_jack_detectable(codec, nid))
>> +			jack->phantom_jack = 1;
>> +	}
>
> This doesn't look good.  The pincfg isn't always reliable at this
> point.  The pin connection check is used in add_jack_kctl() in the
> current code just because its only caller is snd_hda_jack_add_kctls(),
> which takes the pincfg explicitly.  But snd_hda_jakc_tbl_new() itself
> is neutral about the pincfg.

Are you saying that codec->user_pins/driver_pins/init_pins might not be 
properly initialized at this point? If so, maybe we should instead warn 
on somebody calling snd_hda_jack_tbl_new too early?

> And, another problem is that it'll result in a phantom jack secretly
> without adding a proper name suffix.

Are you sure?

snd_hda_jack_add_kctl is called from add_jack_kctl and the hdmi driver.
Add_jack_kctl now uses the phantom_jack flag (as initialized by 
jack_new) to create a proper name, i e, no difference.
generic_hdmi_build_jack should probably replace its "is_jack_detectable" 
call to check the phantom_jack flag for consistency, but for all common 
cases it's no change there either.

> In anyway, for catching such a bug, maybe we should put a WARN_ON() at
> snd_hda_jack_detect_enable_callback() like the patch below.
>
>
> Takashi
>
> --
> diff --git a/sound/pci/hda/hda_jack.c b/sound/pci/hda/hda_jack.c
> index 9746d73cec52..0645735e196d 100644
> --- a/sound/pci/hda/hda_jack.c
> +++ b/sound/pci/hda/hda_jack.c
> @@ -225,6 +225,8 @@ int snd_hda_jack_detect_enable_callback(struct hda_codec *codec, hda_nid_t nid,
>   		return -ENOMEM;
>   	if (jack->jack_detect)
>   		return 0; /* already registered */
> +	if (WARN_ON(!is_jack_detectable(codec, nid)))
> +		return 0;

Remember that enable_callback is sometimes called for non-pin nodes, 
such as the afg node in the sigmatel driver. Calling is_jack_detectable 
on non-pin nodes seems wrong to me.

>   	jack->jack_detect = 1;
>   	if (action)
>   		jack->action = action;
>

-- 
David Henningsson, Canonical Ltd.
https://launchpad.net/~diwic

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: Possible fix for snd-hda-intel model=no-jd failing since ~linux-3.9-rc1
  2014-09-11  9:42     ` David Henningsson
@ 2014-09-11 10:07       ` Takashi Iwai
  2014-09-11 10:29         ` David Henningsson
  2014-09-11 10:55         ` Takashi Iwai
  0 siblings, 2 replies; 21+ messages in thread
From: Takashi Iwai @ 2014-09-11 10:07 UTC (permalink / raw)
  To: David Henningsson; +Cc: Adam Richter, alsa-devel

At Thu, 11 Sep 2014 11:42:41 +0200,
David Henningsson wrote:
> 
> 
> 
> On 2014-09-11 11:23, Takashi Iwai wrote:
> > At Thu, 11 Sep 2014 11:07:10 +0200,
> > David Henningsson wrote:
> >>
> >>
> >>
> >> On 2014-09-11 09:47, Adam Richter wrote:
> >>> Hi.
> >>
> >> Hi Adam,
> >>
> >> Interesting problem. Could you submit alsa-info (
> >> http://www.alsa-project.org/alsa-info.sh ) and point us to it? It makes
> >> it possible to run the code in an emulator.
> >>
> >>> This is a bug and suggested temporary fix that I originally posted to the linux-sound mailing list about a month and a half ago.  I am grateful to Takashi Awai for informing me after my follow-up inquiry about it today that I should submit it to the alsa-devel mailing list instead.  Please feel free to redirect me further if appropriate.  I did not notice any contact information for sound/pci/hda in
> >>> linux-3.16-rc4/MAINATINERS.
> >>>
> >>> Anyhow, here is the bug report and a one line proposed temporary fix.
> >>>
> >>>
> >>> The "model=no-jd" argument has not initialized the analog audio output jack correctly for me since linux-3.9-rc1 (if I recall correctly) through linux-3.17-rc4, although I have not tried every release candidate in between.
> >>
> >> A lot of things changed with 3.9, so that makes sense. Btw,
> >> "model=no-jd" works only for specific machines. You can use the hint
> >> "jack-detect=0" instead.
> >>
> >>> The symptom is that, on a computer with an analog audio output jack
> >>> that has incorrect jack sense (a hardware bug), audio output is completely muted until I physically replug the cable, even though I specified "model=no-jd" as an argument to the snd-hda-intel kernel module, which is supposed to cause the kernel to ignore the jack sense reported by hardware and just drive the audio output even if the hardware jack sense indicates nothing is plugged in.  This problem did not occur until approximate Linux 3.9-rc1.
> >>>
> >>> I have found a few single line workarounds that work, of which my
> >>> favorite is the following (also attached to this email, in case any
> >>> mailer subjects this message to reformatting), because it does not add
> >>> code to anything that gets called frequently.
> >>>
> >>> --- linux-3.17.0-rc4-64bit/sound/pci/hda/hda_jack.c.orig    2014-09-07 16:09:43.000000000 -0700
> >>> +++ linux-3.17.0-rc4-64bit/sound/pci/hda/hda_jack.c    2014-09-10 18:41:53.422900040 -0700
> >>> @@ -106,6 +106,7 @@ snd_hda_jack_tbl_new(struct hda_codec *c
> >>>        jack->nid = nid;
> >>>        jack->jack_dirty = 1;
> >>>        jack->tag = codec->jacktbl.used;
> >>> +    jack->phantom_jack = codec->no_jack_detect;
> >>>        return jack;
> >>>    }
> >>>    EXPORT_SYMBOL_GPL(snd_hda_jack_tbl_new);
> >>>
> >>>
> >>> Signed-off-by: Adam J. Richter <adam_richter2004@yahoo.com>
> >>>
> >>>
> >>> I consider this a workaround rather than than a perfect fix, because I
> >>> think the underlying problem seems to be some kind of initialization
> >>> order issue that I don't fully understand.  Basically, by the time
> >>> jack->phantom_jack was being set, some caller had already called
> >>> jack_detect_update(), which loaded the incorrect jack sense result
> >>> from hardware and cleared jack->jack_dirty, so the jack sense would
> >>> not be set again.  At least that is what I think the underlying
> >>> problem probably is.
> >>>
> >>> Also, if a change like this is to be integrated, I'd like to know if
> >>> it might be better for the line that I added to be:
> >>>
> >>>             jack->phantom_jack = !is_jack_detectable(codec, nid);
> >>
> >> Yes, this would probably be better.
> >>
> >> I guess that somehow snd_hda_jack_enable_callback gets called for the
> >> phantom jack, but I'm not sure exactly how (alsa-info would help).
> >>
> >> Nevertheless I'm attaching a patch. I assume it also resolves your problem?
> >>
> >> Takashi, what do you think of the attached patch?
> >
> > Ah, "attached" was meant *your* attached patch.  Let me see...
> >
> >>  From e5ce94c6156d1c588f29745ade06d1d76c87a0a1 Mon Sep 17 00:00:00 2001
> >> From: David Henningsson <david.henningsson@canonical.com>
> >> Date: Thu, 11 Sep 2014 11:04:42 +0200
> >> Subject: [PATCH] ALSA: hda - Do not enable unsol events on phantom jacks
> >>
> >> To make sure we don't enable unsol events on phantom jacks,
> >> we move the logic for determining what a phantom jack is to
> >> snd_hda_jack_tbl_new.
> >>
> >> Reported-by: Adam Richter <adam_richter2004@yahoo.com>
> >> Signed-off-by: David Henningsson <david.henningsson@canonical.com>
> >> ---
> >>   sound/pci/hda/hda_jack.c | 35 +++++++++++++++++++----------------
> >>   1 file changed, 19 insertions(+), 16 deletions(-)
> >>
> >> diff --git a/sound/pci/hda/hda_jack.c b/sound/pci/hda/hda_jack.c
> >> index 9746d73..376ce8f 100644
> >> --- a/sound/pci/hda/hda_jack.c
> >> +++ b/sound/pci/hda/hda_jack.c
> >> @@ -105,6 +105,12 @@ snd_hda_jack_tbl_new(struct hda_codec *codec, hda_nid_t nid)
> >>   		return NULL;
> >>   	jack->nid = nid;
> >>   	jack->jack_dirty = 1;
> >> +	if (get_wcaps_type(get_wcaps(codec, nid)) == AC_WID_PIN) {
> >> +		unsigned int def_conf = snd_hda_codec_get_pincfg(codec, nid);
> >> +		unsigned int conn = get_defcfg_connect(def_conf);
> >> +		if ((conn != AC_JACK_PORT_COMPLEX) || !is_jack_detectable(codec, nid))
> >> +			jack->phantom_jack = 1;
> >> +	}
> >
> > This doesn't look good.  The pincfg isn't always reliable at this
> > point.  The pin connection check is used in add_jack_kctl() in the
> > current code just because its only caller is snd_hda_jack_add_kctls(),
> > which takes the pincfg explicitly.  But snd_hda_jakc_tbl_new() itself
> > is neutral about the pincfg.
> 
> Are you saying that codec->user_pins/driver_pins/init_pins might not be 
> properly initialized at this point? If so, maybe we should instead warn 
> on somebody calling snd_hda_jack_tbl_new too early?

No, the hda_jack stuff itself isn't necessarily depending on the
pincfg deeply.  For example, is_jack_detectable() doesn't check the
pin location (although it checks MISC_NO_PRESENCE bit as an
exception).

> > And, another problem is that it'll result in a phantom jack secretly
> > without adding a proper name suffix.
> 
> Are you sure?
> 
> snd_hda_jack_add_kctl is called from add_jack_kctl and the hdmi driver.
> Add_jack_kctl now uses the phantom_jack flag (as initialized by 
> jack_new) to create a proper name, i e, no difference.
> generic_hdmi_build_jack should probably replace its "is_jack_detectable" 
> call to check the phantom_jack flag for consistency, but for all common 
> cases it's no change there either.

Hm, OK, that won't happen.  But my point is that it's wrong to check
the phantom flag there.

> > In anyway, for catching such a bug, maybe we should put a WARN_ON() at
> > snd_hda_jack_detect_enable_callback() like the patch below.
> >
> >
> > Takashi
> >
> > --
> > diff --git a/sound/pci/hda/hda_jack.c b/sound/pci/hda/hda_jack.c
> > index 9746d73cec52..0645735e196d 100644
> > --- a/sound/pci/hda/hda_jack.c
> > +++ b/sound/pci/hda/hda_jack.c
> > @@ -225,6 +225,8 @@ int snd_hda_jack_detect_enable_callback(struct hda_codec *codec, hda_nid_t nid,
> >   		return -ENOMEM;
> >   	if (jack->jack_detect)
> >   		return 0; /* already registered */
> > +	if (WARN_ON(!is_jack_detectable(codec, nid)))
> > +		return 0;
> 
> Remember that enable_callback is sometimes called for non-pin nodes, 
> such as the afg node in the sigmatel driver. Calling is_jack_detectable 
> on non-pin nodes seems wrong to me.

OK, then it's an overkill.

Looking at the alsa-info.sh output, the problem is that IDT codec
parser creates jack detection for the power-control before the generic
parser.  There is also a wrong logic in stac_init_power_map()...

An untested fix is below.


Takashi

--
diff --git a/sound/pci/hda/patch_sigmatel.c b/sound/pci/hda/patch_sigmatel.c
index f26ec04a29b5..526b5d39a2cb 100644
--- a/sound/pci/hda/patch_sigmatel.c
+++ b/sound/pci/hda/patch_sigmatel.c
@@ -565,8 +565,8 @@ static void stac_init_power_map(struct hda_codec *codec)
 		if (snd_hda_jack_tbl_get(codec, nid))
 			continue;
 		if (def_conf == AC_JACK_PORT_COMPLEX &&
-		    !(spec->vref_mute_led_nid == nid ||
-		      is_jack_detectable(codec, nid))) {
+		    spec->vref_mute_led_nid != nid &&
+		    is_jack_detectable(codec, nid)) {
 			snd_hda_jack_detect_enable_callback(codec, nid,
 							    STAC_PWR_EVENT,
 							    jack_update_power);
@@ -4272,11 +4272,17 @@ static int stac_parse_auto_config(struct hda_codec *codec)
 			return err;
 	}
 
-	stac_init_power_map(codec);
-
 	return 0;
 }
 
+static int stac_build_controls(struct hda_codec *codec)
+{
+	int err = snd_hda_gen_build_controls(codec);
+	if (err < 0)
+		return err;
+	stac_init_power_map(codec);
+	return 0;
+}
 
 static int stac_init(struct hda_codec *codec)
 {
@@ -4388,7 +4394,7 @@ static int stac_suspend(struct hda_codec *codec)
 #endif /* CONFIG_PM */
 
 static const struct hda_codec_ops stac_patch_ops = {
-	.build_controls = snd_hda_gen_build_controls,
+	.build_controls = stac_build_controls,
 	.build_pcms = snd_hda_gen_build_pcms,
 	.init = stac_init,
 	.free = stac_free,

^ permalink raw reply related	[flat|nested] 21+ messages in thread

* Re: Possible fix for snd-hda-intel model=no-jd failing since ~linux-3.9-rc1
  2014-09-11 10:07       ` Takashi Iwai
@ 2014-09-11 10:29         ` David Henningsson
  2014-09-11 10:51           ` Takashi Iwai
  2014-09-11 10:55         ` Takashi Iwai
  1 sibling, 1 reply; 21+ messages in thread
From: David Henningsson @ 2014-09-11 10:29 UTC (permalink / raw)
  To: Takashi Iwai; +Cc: Adam Richter, alsa-devel



On 2014-09-11 12:07, Takashi Iwai wrote:
> At Thu, 11 Sep 2014 11:42:41 +0200,
> David Henningsson wrote:
>>
>>
>>
>> On 2014-09-11 11:23, Takashi Iwai wrote:
>>> At Thu, 11 Sep 2014 11:07:10 +0200,
>>> David Henningsson wrote:
>>>>
>>>>
>>>>
>>>> On 2014-09-11 09:47, Adam Richter wrote:
>>>>> Hi.
>>>>
>>>> Hi Adam,
>>>>
>>>> Interesting problem. Could you submit alsa-info (
>>>> http://www.alsa-project.org/alsa-info.sh ) and point us to it? It makes
>>>> it possible to run the code in an emulator.
>>>>
>>>>> This is a bug and suggested temporary fix that I originally posted to the linux-sound mailing list about a month and a half ago.  I am grateful to Takashi Awai for informing me after my follow-up inquiry about it today that I should submit it to the alsa-devel mailing list instead.  Please feel free to redirect me further if appropriate.  I did not notice any contact information for sound/pci/hda in
>>>>> linux-3.16-rc4/MAINATINERS.
>>>>>
>>>>> Anyhow, here is the bug report and a one line proposed temporary fix.
>>>>>
>>>>>
>>>>> The "model=no-jd" argument has not initialized the analog audio output jack correctly for me since linux-3.9-rc1 (if I recall correctly) through linux-3.17-rc4, although I have not tried every release candidate in between.
>>>>
>>>> A lot of things changed with 3.9, so that makes sense. Btw,
>>>> "model=no-jd" works only for specific machines. You can use the hint
>>>> "jack-detect=0" instead.
>>>>
>>>>> The symptom is that, on a computer with an analog audio output jack
>>>>> that has incorrect jack sense (a hardware bug), audio output is completely muted until I physically replug the cable, even though I specified "model=no-jd" as an argument to the snd-hda-intel kernel module, which is supposed to cause the kernel to ignore the jack sense reported by hardware and just drive the audio output even if the hardware jack sense indicates nothing is plugged in.  This problem did not occur until approximate Linux 3.9-rc1.
>>>>>
>>>>> I have found a few single line workarounds that work, of which my
>>>>> favorite is the following (also attached to this email, in case any
>>>>> mailer subjects this message to reformatting), because it does not add
>>>>> code to anything that gets called frequently.
>>>>>
>>>>> --- linux-3.17.0-rc4-64bit/sound/pci/hda/hda_jack.c.orig    2014-09-07 16:09:43.000000000 -0700
>>>>> +++ linux-3.17.0-rc4-64bit/sound/pci/hda/hda_jack.c    2014-09-10 18:41:53.422900040 -0700
>>>>> @@ -106,6 +106,7 @@ snd_hda_jack_tbl_new(struct hda_codec *c
>>>>>         jack->nid = nid;
>>>>>         jack->jack_dirty = 1;
>>>>>         jack->tag = codec->jacktbl.used;
>>>>> +    jack->phantom_jack = codec->no_jack_detect;
>>>>>         return jack;
>>>>>     }
>>>>>     EXPORT_SYMBOL_GPL(snd_hda_jack_tbl_new);
>>>>>
>>>>>
>>>>> Signed-off-by: Adam J. Richter <adam_richter2004@yahoo.com>
>>>>>
>>>>>
>>>>> I consider this a workaround rather than than a perfect fix, because I
>>>>> think the underlying problem seems to be some kind of initialization
>>>>> order issue that I don't fully understand.  Basically, by the time
>>>>> jack->phantom_jack was being set, some caller had already called
>>>>> jack_detect_update(), which loaded the incorrect jack sense result
>>>>> from hardware and cleared jack->jack_dirty, so the jack sense would
>>>>> not be set again.  At least that is what I think the underlying
>>>>> problem probably is.
>>>>>
>>>>> Also, if a change like this is to be integrated, I'd like to know if
>>>>> it might be better for the line that I added to be:
>>>>>
>>>>>              jack->phantom_jack = !is_jack_detectable(codec, nid);
>>>>
>>>> Yes, this would probably be better.
>>>>
>>>> I guess that somehow snd_hda_jack_enable_callback gets called for the
>>>> phantom jack, but I'm not sure exactly how (alsa-info would help).
>>>>
>>>> Nevertheless I'm attaching a patch. I assume it also resolves your problem?
>>>>
>>>> Takashi, what do you think of the attached patch?
>>>
>>> Ah, "attached" was meant *your* attached patch.  Let me see...
>>>
>>>>   From e5ce94c6156d1c588f29745ade06d1d76c87a0a1 Mon Sep 17 00:00:00 2001
>>>> From: David Henningsson <david.henningsson@canonical.com>
>>>> Date: Thu, 11 Sep 2014 11:04:42 +0200
>>>> Subject: [PATCH] ALSA: hda - Do not enable unsol events on phantom jacks
>>>>
>>>> To make sure we don't enable unsol events on phantom jacks,
>>>> we move the logic for determining what a phantom jack is to
>>>> snd_hda_jack_tbl_new.
>>>>
>>>> Reported-by: Adam Richter <adam_richter2004@yahoo.com>
>>>> Signed-off-by: David Henningsson <david.henningsson@canonical.com>
>>>> ---
>>>>    sound/pci/hda/hda_jack.c | 35 +++++++++++++++++++----------------
>>>>    1 file changed, 19 insertions(+), 16 deletions(-)
>>>>
>>>> diff --git a/sound/pci/hda/hda_jack.c b/sound/pci/hda/hda_jack.c
>>>> index 9746d73..376ce8f 100644
>>>> --- a/sound/pci/hda/hda_jack.c
>>>> +++ b/sound/pci/hda/hda_jack.c
>>>> @@ -105,6 +105,12 @@ snd_hda_jack_tbl_new(struct hda_codec *codec, hda_nid_t nid)
>>>>    		return NULL;
>>>>    	jack->nid = nid;
>>>>    	jack->jack_dirty = 1;
>>>> +	if (get_wcaps_type(get_wcaps(codec, nid)) == AC_WID_PIN) {
>>>> +		unsigned int def_conf = snd_hda_codec_get_pincfg(codec, nid);
>>>> +		unsigned int conn = get_defcfg_connect(def_conf);
>>>> +		if ((conn != AC_JACK_PORT_COMPLEX) || !is_jack_detectable(codec, nid))
>>>> +			jack->phantom_jack = 1;
>>>> +	}
>>>
>>> This doesn't look good.  The pincfg isn't always reliable at this
>>> point.  The pin connection check is used in add_jack_kctl() in the
>>> current code just because its only caller is snd_hda_jack_add_kctls(),
>>> which takes the pincfg explicitly.  But snd_hda_jakc_tbl_new() itself
>>> is neutral about the pincfg.
>>
>> Are you saying that codec->user_pins/driver_pins/init_pins might not be
>> properly initialized at this point? If so, maybe we should instead warn
>> on somebody calling snd_hda_jack_tbl_new too early?
>
> No, the hda_jack stuff itself isn't necessarily depending on the
> pincfg deeply.  For example, is_jack_detectable() doesn't check the
> pin location (although it checks MISC_NO_PRESENCE bit as an
> exception).

Is there a good reason why the hda_jack stuff should not depend on pincfg?

Also, if we keep the detection in snd_hda_jack_tbl_new, we could change 
all other calls to is_jack_detectable to !jack->phantom_jack instead.

>>> And, another problem is that it'll result in a phantom jack secretly
>>> without adding a proper name suffix.
>>
>> Are you sure?
>>
>> snd_hda_jack_add_kctl is called from add_jack_kctl and the hdmi driver.
>> Add_jack_kctl now uses the phantom_jack flag (as initialized by
>> jack_new) to create a proper name, i e, no difference.
>> generic_hdmi_build_jack should probably replace its "is_jack_detectable"
>> call to check the phantom_jack flag for consistency, but for all common
>> cases it's no change there either.
>
> Hm, OK, that won't happen.  But my point is that it's wrong to check
> the phantom flag there.
>
>>> In anyway, for catching such a bug, maybe we should put a WARN_ON() at
>>> snd_hda_jack_detect_enable_callback() like the patch below.
>>>
>>>
>>> Takashi
>>>
>>> --
>>> diff --git a/sound/pci/hda/hda_jack.c b/sound/pci/hda/hda_jack.c
>>> index 9746d73cec52..0645735e196d 100644
>>> --- a/sound/pci/hda/hda_jack.c
>>> +++ b/sound/pci/hda/hda_jack.c
>>> @@ -225,6 +225,8 @@ int snd_hda_jack_detect_enable_callback(struct hda_codec *codec, hda_nid_t nid,
>>>    		return -ENOMEM;
>>>    	if (jack->jack_detect)
>>>    		return 0; /* already registered */
>>> +	if (WARN_ON(!is_jack_detectable(codec, nid)))
>>> +		return 0;
>>
>> Remember that enable_callback is sometimes called for non-pin nodes,
>> such as the afg node in the sigmatel driver. Calling is_jack_detectable
>> on non-pin nodes seems wrong to me.
>
> OK, then it's an overkill.
>
> Looking at the alsa-info.sh output, the problem is that IDT codec
> parser creates jack detection for the power-control before the generic
> parser.  There is also a wrong logic in stac_init_power_map()...
>
> An untested fix is below.

Did you get any alsa-info output from Adam? Maybe he sent it privately 
to you.

>
>
> Takashi
>
> --
> diff --git a/sound/pci/hda/patch_sigmatel.c b/sound/pci/hda/patch_sigmatel.c
> index f26ec04a29b5..526b5d39a2cb 100644
> --- a/sound/pci/hda/patch_sigmatel.c
> +++ b/sound/pci/hda/patch_sigmatel.c
> @@ -565,8 +565,8 @@ static void stac_init_power_map(struct hda_codec *codec)
>   		if (snd_hda_jack_tbl_get(codec, nid))
>   			continue;
>   		if (def_conf == AC_JACK_PORT_COMPLEX &&
> -		    !(spec->vref_mute_led_nid == nid ||
> -		      is_jack_detectable(codec, nid))) {
> +		    spec->vref_mute_led_nid != nid &&
> +		    is_jack_detectable(codec, nid)) {
>   			snd_hda_jack_detect_enable_callback(codec, nid,
>   							    STAC_PWR_EVENT,
>   							    jack_update_power);
> @@ -4272,11 +4272,17 @@ static int stac_parse_auto_config(struct hda_codec *codec)
>   			return err;
>   	}
>
> -	stac_init_power_map(codec);
> -
>   	return 0;
>   }
>
> +static int stac_build_controls(struct hda_codec *codec)
> +{
> +	int err = snd_hda_gen_build_controls(codec);
> +	if (err < 0)
> +		return err;
> +	stac_init_power_map(codec);
> +	return 0;
> +}
>
>   static int stac_init(struct hda_codec *codec)
>   {
> @@ -4388,7 +4394,7 @@ static int stac_suspend(struct hda_codec *codec)
>   #endif /* CONFIG_PM */
>
>   static const struct hda_codec_ops stac_patch_ops = {
> -	.build_controls = snd_hda_gen_build_controls,
> +	.build_controls = stac_build_controls,
>   	.build_pcms = snd_hda_gen_build_pcms,
>   	.init = stac_init,
>   	.free = stac_free,
> _______________________________________________
> Alsa-devel mailing list
> Alsa-devel@alsa-project.org
> http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
>

-- 
David Henningsson, Canonical Ltd.
https://launchpad.net/~diwic

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: Possible fix for snd-hda-intel model=no-jd failing since ~linux-3.9-rc1
  2014-09-11 10:29         ` David Henningsson
@ 2014-09-11 10:51           ` Takashi Iwai
  0 siblings, 0 replies; 21+ messages in thread
From: Takashi Iwai @ 2014-09-11 10:51 UTC (permalink / raw)
  To: David Henningsson; +Cc: Adam Richter, alsa-devel

At Thu, 11 Sep 2014 12:29:09 +0200,
David Henningsson wrote:
> 
> 
> 
> On 2014-09-11 12:07, Takashi Iwai wrote:
> > At Thu, 11 Sep 2014 11:42:41 +0200,
> > David Henningsson wrote:
> >>
> >>
> >>
> >> On 2014-09-11 11:23, Takashi Iwai wrote:
> >>> At Thu, 11 Sep 2014 11:07:10 +0200,
> >>> David Henningsson wrote:
> >>>>
> >>>>
> >>>>
> >>>> On 2014-09-11 09:47, Adam Richter wrote:
> >>>>> Hi.
> >>>>
> >>>> Hi Adam,
> >>>>
> >>>> Interesting problem. Could you submit alsa-info (
> >>>> http://www.alsa-project.org/alsa-info.sh ) and point us to it? It makes
> >>>> it possible to run the code in an emulator.
> >>>>
> >>>>> This is a bug and suggested temporary fix that I originally posted to the linux-sound mailing list about a month and a half ago.  I am grateful to Takashi Awai for informing me after my follow-up inquiry about it today that I should submit it to the alsa-devel mailing list instead.  Please feel free to redirect me further if appropriate.  I did not notice any contact information for sound/pci/hda in
> >>>>> linux-3.16-rc4/MAINATINERS.
> >>>>>
> >>>>> Anyhow, here is the bug report and a one line proposed temporary fix.
> >>>>>
> >>>>>
> >>>>> The "model=no-jd" argument has not initialized the analog audio output jack correctly for me since linux-3.9-rc1 (if I recall correctly) through linux-3.17-rc4, although I have not tried every release candidate in between.
> >>>>
> >>>> A lot of things changed with 3.9, so that makes sense. Btw,
> >>>> "model=no-jd" works only for specific machines. You can use the hint
> >>>> "jack-detect=0" instead.
> >>>>
> >>>>> The symptom is that, on a computer with an analog audio output jack
> >>>>> that has incorrect jack sense (a hardware bug), audio output is completely muted until I physically replug the cable, even though I specified "model=no-jd" as an argument to the snd-hda-intel kernel module, which is supposed to cause the kernel to ignore the jack sense reported by hardware and just drive the audio output even if the hardware jack sense indicates nothing is plugged in.  This problem did not occur until approximate Linux 3.9-rc1.
> >>>>>
> >>>>> I have found a few single line workarounds that work, of which my
> >>>>> favorite is the following (also attached to this email, in case any
> >>>>> mailer subjects this message to reformatting), because it does not add
> >>>>> code to anything that gets called frequently.
> >>>>>
> >>>>> --- linux-3.17.0-rc4-64bit/sound/pci/hda/hda_jack.c.orig    2014-09-07 16:09:43.000000000 -0700
> >>>>> +++ linux-3.17.0-rc4-64bit/sound/pci/hda/hda_jack.c    2014-09-10 18:41:53.422900040 -0700
> >>>>> @@ -106,6 +106,7 @@ snd_hda_jack_tbl_new(struct hda_codec *c
> >>>>>         jack->nid = nid;
> >>>>>         jack->jack_dirty = 1;
> >>>>>         jack->tag = codec->jacktbl.used;
> >>>>> +    jack->phantom_jack = codec->no_jack_detect;
> >>>>>         return jack;
> >>>>>     }
> >>>>>     EXPORT_SYMBOL_GPL(snd_hda_jack_tbl_new);
> >>>>>
> >>>>>
> >>>>> Signed-off-by: Adam J. Richter <adam_richter2004@yahoo.com>
> >>>>>
> >>>>>
> >>>>> I consider this a workaround rather than than a perfect fix, because I
> >>>>> think the underlying problem seems to be some kind of initialization
> >>>>> order issue that I don't fully understand.  Basically, by the time
> >>>>> jack->phantom_jack was being set, some caller had already called
> >>>>> jack_detect_update(), which loaded the incorrect jack sense result
> >>>>> from hardware and cleared jack->jack_dirty, so the jack sense would
> >>>>> not be set again.  At least that is what I think the underlying
> >>>>> problem probably is.
> >>>>>
> >>>>> Also, if a change like this is to be integrated, I'd like to know if
> >>>>> it might be better for the line that I added to be:
> >>>>>
> >>>>>              jack->phantom_jack = !is_jack_detectable(codec, nid);
> >>>>
> >>>> Yes, this would probably be better.
> >>>>
> >>>> I guess that somehow snd_hda_jack_enable_callback gets called for the
> >>>> phantom jack, but I'm not sure exactly how (alsa-info would help).
> >>>>
> >>>> Nevertheless I'm attaching a patch. I assume it also resolves your problem?
> >>>>
> >>>> Takashi, what do you think of the attached patch?
> >>>
> >>> Ah, "attached" was meant *your* attached patch.  Let me see...
> >>>
> >>>>   From e5ce94c6156d1c588f29745ade06d1d76c87a0a1 Mon Sep 17 00:00:00 2001
> >>>> From: David Henningsson <david.henningsson@canonical.com>
> >>>> Date: Thu, 11 Sep 2014 11:04:42 +0200
> >>>> Subject: [PATCH] ALSA: hda - Do not enable unsol events on phantom jacks
> >>>>
> >>>> To make sure we don't enable unsol events on phantom jacks,
> >>>> we move the logic for determining what a phantom jack is to
> >>>> snd_hda_jack_tbl_new.
> >>>>
> >>>> Reported-by: Adam Richter <adam_richter2004@yahoo.com>
> >>>> Signed-off-by: David Henningsson <david.henningsson@canonical.com>
> >>>> ---
> >>>>    sound/pci/hda/hda_jack.c | 35 +++++++++++++++++++----------------
> >>>>    1 file changed, 19 insertions(+), 16 deletions(-)
> >>>>
> >>>> diff --git a/sound/pci/hda/hda_jack.c b/sound/pci/hda/hda_jack.c
> >>>> index 9746d73..376ce8f 100644
> >>>> --- a/sound/pci/hda/hda_jack.c
> >>>> +++ b/sound/pci/hda/hda_jack.c
> >>>> @@ -105,6 +105,12 @@ snd_hda_jack_tbl_new(struct hda_codec *codec, hda_nid_t nid)
> >>>>    		return NULL;
> >>>>    	jack->nid = nid;
> >>>>    	jack->jack_dirty = 1;
> >>>> +	if (get_wcaps_type(get_wcaps(codec, nid)) == AC_WID_PIN) {
> >>>> +		unsigned int def_conf = snd_hda_codec_get_pincfg(codec, nid);
> >>>> +		unsigned int conn = get_defcfg_connect(def_conf);
> >>>> +		if ((conn != AC_JACK_PORT_COMPLEX) || !is_jack_detectable(codec, nid))
> >>>> +			jack->phantom_jack = 1;
> >>>> +	}
> >>>
> >>> This doesn't look good.  The pincfg isn't always reliable at this
> >>> point.  The pin connection check is used in add_jack_kctl() in the
> >>> current code just because its only caller is snd_hda_jack_add_kctls(),
> >>> which takes the pincfg explicitly.  But snd_hda_jakc_tbl_new() itself
> >>> is neutral about the pincfg.
> >>
> >> Are you saying that codec->user_pins/driver_pins/init_pins might not be
> >> properly initialized at this point? If so, maybe we should instead warn
> >> on somebody calling snd_hda_jack_tbl_new too early?
> >
> > No, the hda_jack stuff itself isn't necessarily depending on the
> > pincfg deeply.  For example, is_jack_detectable() doesn't check the
> > pin location (although it checks MISC_NO_PRESENCE bit as an
> > exception).
> 
> Is there a good reason why the hda_jack stuff should not depend on pincfg?

Because the pincfg isn't always reliable, as you know ;)

> Also, if we keep the detection in snd_hda_jack_tbl_new, we could change 
> all other calls to is_jack_detectable to !jack->phantom_jack instead.

Well, I think is_jack_detectable() is rather a helper to be moved to
hda_codec.c, i.e. its functionality is independent from what else in
hda_jack.c.  In other words, I don't think we want to tie it with
hda_jack stuff (at least in the current form of hda_jack.c
infrastructure).

> >>> And, another problem is that it'll result in a phantom jack secretly
> >>> without adding a proper name suffix.
> >>
> >> Are you sure?
> >>
> >> snd_hda_jack_add_kctl is called from add_jack_kctl and the hdmi driver.
> >> Add_jack_kctl now uses the phantom_jack flag (as initialized by
> >> jack_new) to create a proper name, i e, no difference.
> >> generic_hdmi_build_jack should probably replace its "is_jack_detectable"
> >> call to check the phantom_jack flag for consistency, but for all common
> >> cases it's no change there either.
> >
> > Hm, OK, that won't happen.  But my point is that it's wrong to check
> > the phantom flag there.
> >
> >>> In anyway, for catching such a bug, maybe we should put a WARN_ON() at
> >>> snd_hda_jack_detect_enable_callback() like the patch below.
> >>>
> >>>
> >>> Takashi
> >>>
> >>> --
> >>> diff --git a/sound/pci/hda/hda_jack.c b/sound/pci/hda/hda_jack.c
> >>> index 9746d73cec52..0645735e196d 100644
> >>> --- a/sound/pci/hda/hda_jack.c
> >>> +++ b/sound/pci/hda/hda_jack.c
> >>> @@ -225,6 +225,8 @@ int snd_hda_jack_detect_enable_callback(struct hda_codec *codec, hda_nid_t nid,
> >>>    		return -ENOMEM;
> >>>    	if (jack->jack_detect)
> >>>    		return 0; /* already registered */
> >>> +	if (WARN_ON(!is_jack_detectable(codec, nid)))
> >>> +		return 0;
> >>
> >> Remember that enable_callback is sometimes called for non-pin nodes,
> >> such as the afg node in the sigmatel driver. Calling is_jack_detectable
> >> on non-pin nodes seems wrong to me.
> >
> > OK, then it's an overkill.
> >
> > Looking at the alsa-info.sh output, the problem is that IDT codec
> > parser creates jack detection for the power-control before the generic
> > parser.  There is also a wrong logic in stac_init_power_map()...
> >
> > An untested fix is below.
> 
> Did you get any alsa-info output from Adam? Maybe he sent it privately 
> to you.

I guess this was blocked by the mail server due to a too big
attachment...


Takashi

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: Possible fix for snd-hda-intel model=no-jd failing since ~linux-3.9-rc1
  2014-09-11 10:07       ` Takashi Iwai
  2014-09-11 10:29         ` David Henningsson
@ 2014-09-11 10:55         ` Takashi Iwai
  2014-09-12  4:30           ` Adam Richter
  1 sibling, 1 reply; 21+ messages in thread
From: Takashi Iwai @ 2014-09-11 10:55 UTC (permalink / raw)
  To: David Henningsson; +Cc: Adam Richter, alsa-devel

At Thu, 11 Sep 2014 12:07:43 +0200,
Takashi Iwai wrote:
> 
> Looking at the alsa-info.sh output, the problem is that IDT codec
> parser creates jack detection for the power-control before the generic
> parser.  There is also a wrong logic in stac_init_power_map()...
> 
> An untested fix is below.

BTW, a part of the messes is the restriction of hda_jack stuff:
currently it supports only one callback per jack.  If we can add
multiple callbacks and actions to a jack, the code in patch_sigmatel.c
would be come much easier.  But this is a step after fixing the bug
quickly.


Takashi

> 
> 
> Takashi
> 
> --
> diff --git a/sound/pci/hda/patch_sigmatel.c b/sound/pci/hda/patch_sigmatel.c
> index f26ec04a29b5..526b5d39a2cb 100644
> --- a/sound/pci/hda/patch_sigmatel.c
> +++ b/sound/pci/hda/patch_sigmatel.c
> @@ -565,8 +565,8 @@ static void stac_init_power_map(struct hda_codec *codec)
>  		if (snd_hda_jack_tbl_get(codec, nid))
>  			continue;
>  		if (def_conf == AC_JACK_PORT_COMPLEX &&
> -		    !(spec->vref_mute_led_nid == nid ||
> -		      is_jack_detectable(codec, nid))) {
> +		    spec->vref_mute_led_nid != nid &&
> +		    is_jack_detectable(codec, nid)) {
>  			snd_hda_jack_detect_enable_callback(codec, nid,
>  							    STAC_PWR_EVENT,
>  							    jack_update_power);
> @@ -4272,11 +4272,17 @@ static int stac_parse_auto_config(struct hda_codec *codec)
>  			return err;
>  	}
>  
> -	stac_init_power_map(codec);
> -
>  	return 0;
>  }
>  
> +static int stac_build_controls(struct hda_codec *codec)
> +{
> +	int err = snd_hda_gen_build_controls(codec);
> +	if (err < 0)
> +		return err;
> +	stac_init_power_map(codec);
> +	return 0;
> +}
>  
>  static int stac_init(struct hda_codec *codec)
>  {
> @@ -4388,7 +4394,7 @@ static int stac_suspend(struct hda_codec *codec)
>  #endif /* CONFIG_PM */
>  
>  static const struct hda_codec_ops stac_patch_ops = {
> -	.build_controls = snd_hda_gen_build_controls,
> +	.build_controls = stac_build_controls,
>  	.build_pcms = snd_hda_gen_build_pcms,
>  	.init = stac_init,
>  	.free = stac_free,

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: Possible fix for snd-hda-intel model=no-jd failing since ~linux-3.9-rc1
  2014-09-11 10:55         ` Takashi Iwai
@ 2014-09-12  4:30           ` Adam Richter
  2014-09-12  4:40             ` Adam Richter
  2014-09-15  8:39             ` Takashi Iwai
  0 siblings, 2 replies; 21+ messages in thread
From: Adam Richter @ 2014-09-12  4:30 UTC (permalink / raw)
  To: Takashi Iwai; +Cc: alsa-devel, David Henningsson

Hi, Takashi.

I confirm that your patch, quoted below, eliminated the symptom.

Please feel free to ask me to test other patches related to this problem.

Also, by the way, it appears that linux-3.17-rc4's Intel "high defintiion audio" driver, regardless of whether this patch is applied, no longer shows Linux input subsystem devices for analog audio jack sense, although it does provide such a device for HDMI jack sense.  If that's a bug, it's completely separate, but I mention it here in case it's relevant to integrating a fix to this issue.

Thanks to you and David for your prompt and careful attention this bug once I brought it to this mailing list.

Adam Richter


 At Thu, 11 Sep 2014 12:07:43 +0200,
 Takashi Iwai wrote:
 
 > --
 > diff --git a/sound/pci/hda/patch_sigmatel.c b/sound/pci/hda/patch_sigmatel.c
 > index f26ec04a29b5..526b5d39a2cb 100644
 > --- a/sound/pci/hda/patch_sigmatel.c
 > +++ b/sound/pci/hda/patch_sigmatel.c
 > @@ -565,8 +565,8 @@ static void stac_init_power_map(struct hda_codec *codec)
 >          if (snd_hda_jack_tbl_get(codec, nid))
 >              continue;
 >          if (def_conf == AC_JACK_PORT_COMPLEX &&
 > -           !(spec->vref_mute_led_nid == nid ||
 > -             is_jack_detectable(codec, nid))) {
 > +          spec->vref_mute_led_nid != nid &&
 > +          is_jack_detectable(codec, nid)) {
 >          snd_hda_jack_detect_enable_callback(codec, nid,
 >          STAC_PWR_EVENT,
 >          jack_update_power);
 > @@ -4272,11 +4272,17 @@ static int
 stac_parse_auto_config(struct hda_codec *codec)
 >              return err;
 >      }
 >  
 > -    stac_init_power_map(codec);
 > -
 >      return 0;
 >  }
 >  
 > +static int stac_build_controls(struct hda_codec *codec)
 > +{
 > +    int err =
 snd_hda_gen_build_controls(codec);
 > +    if (err < 0)
 > +        return err;
 > +    stac_init_power_map(codec);
 > +    return 0;
 > +}
 >  
 >  static int stac_init(struct hda_codec *codec)
 >  {
 > @@ -4388,7 +4394,7 @@ static int stac_suspend(struct hda_codec *codec)
 >  #endif /* CONFIG_PM */
 >  
 >  static const struct hda_codec_ops stac_patch_ops = {
 > -    .build_controls = snd_hda_gen_build_controls,
 > +    .build_controls = stac_build_controls,
 >      .build_pcms = snd_hda_gen_build_pcms,
 >      .init = stac_init,
 >      .free = stac_free,
 

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: Possible fix for snd-hda-intel model=no-jd failing since ~linux-3.9-rc1
  2014-09-12  4:30           ` Adam Richter
@ 2014-09-12  4:40             ` Adam Richter
  2014-09-15  8:39             ` Takashi Iwai
  1 sibling, 0 replies; 21+ messages in thread
From: Adam Richter @ 2014-09-12  4:40 UTC (permalink / raw)
  To: Takashi Iwai; +Cc: alsa-devel, David Henningsson

Hi, again, Takashi.

A few minute ago, I wrote a side comment that you should ignore, which was the following:

>Also, by the way, it appears that linux-3.17-rc4's Intel "high defintiion audio"
> driver, regardless of whether this patch is applied, no
> longer shows Linux input subsystem devices for analog audio
> jack sense, although it does provide such a device for HDMI
> jack sense.  [...]

In Linux 3.17-rc4, reloading the snd-hda-intel module without "model=no-jd" results in those input devices being created.  So, it is not a bug.  In fact, I think is completely correct and an improvement that mode=no-jd now causes the jack sense Linux input layer devices not to be created, which should make it easier for userspace to detect and adapt to this situation.

Sorry for the distraction.

Adam Richter

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: Possible fix for snd-hda-intel model=no-jd failing since ~linux-3.9-rc1
  2014-09-12  4:30           ` Adam Richter
  2014-09-12  4:40             ` Adam Richter
@ 2014-09-15  8:39             ` Takashi Iwai
  1 sibling, 0 replies; 21+ messages in thread
From: Takashi Iwai @ 2014-09-15  8:39 UTC (permalink / raw)
  To: Adam Richter; +Cc: alsa-devel, David Henningsson

At Thu, 11 Sep 2014 21:30:25 -0700,
Adam Richter wrote:
> 
> Hi, Takashi.
> 
> I confirm that your patch, quoted below, eliminated the symptom.
> 
> Please feel free to ask me to test other patches related to this problem.
> 
> Also, by the way, it appears that linux-3.17-rc4's Intel "high defintiion audio" driver, regardless of whether this patch is applied, no longer shows Linux input subsystem devices for analog audio jack sense, although it does provide such a device for HDMI jack sense.  If that's a bug, it's completely separate, but I mention it here in case it's relevant to integrating a fix to this issue.
> 
> Thanks to you and David for your prompt and careful attention this bug once I brought it to this mailing list.

Good to hear.  I merged the patch now for-linus branch.


Takashi

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: Possible fix for snd-hda-intel model=no-jd failing since ~linux-3.9-rc1
  2014-09-11 19:14   ` Adam Richter
@ 2014-09-12  7:17     ` Raymond Yau
  0 siblings, 0 replies; 21+ messages in thread
From: Raymond Yau @ 2014-09-12  7:17 UTC (permalink / raw)
  To: Adam Richter; +Cc: Takashi Iwai, alsa-devel

>
> >Is this enumerated codec inside vm since node 0x18 and node 0x19 does not
> >like the real idt coded ?
>
> It's real hardware.
>

It is strange that your hardware have the desktop pin layout plus two
internal mic and CD

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: Possible fix for snd-hda-intel model=no-jd failing since ~linux-3.9-rc1
  2014-09-11 11:48 ` Raymond Yau
@ 2014-09-11 19:14   ` Adam Richter
  2014-09-12  7:17     ` Raymond Yau
  0 siblings, 1 reply; 21+ messages in thread
From: Adam Richter @ 2014-09-11 19:14 UTC (permalink / raw)
  To: Raymond Yau; +Cc: Takashi Iwai, alsa-devel

On Thu, 9/11/14, Raymond Yau <superquad.vortex2@gmail.com> wrote:
 
>Is this enumerated codec inside vm since node 0x18 and node 0x19 does not
>like the real idt coded ?
 
It's real hardware.

Thanks for your attention to this problem.

Adam

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: Possible fix for snd-hda-intel model=no-jd failing since ~linux-3.9-rc1
  2014-09-11  9:32 Adam Richter
@ 2014-09-11 11:48 ` Raymond Yau
  2014-09-11 19:14   ` Adam Richter
  0 siblings, 1 reply; 21+ messages in thread
From: Raymond Yau @ 2014-09-11 11:48 UTC (permalink / raw)
  To: Adam Richter; +Cc: Takashi Iwai, alsa-devel

>
> > Could you give alsa-info.sh output on your machine?  Otherwise it's
difficult to analyze.
>
> OK.  I have attached it.  In a few places, I replaced text with
"[DELETED]" to avoid identifying the product.

Is this enumerated codec inside vm since node 0x18 and node 0x19 does not
like the real idt coded ?

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: Possible fix for snd-hda-intel model=no-jd failing since ~linux-3.9-rc1
@ 2014-09-11  9:32 Adam Richter
  2014-09-11 11:48 ` Raymond Yau
  0 siblings, 1 reply; 21+ messages in thread
From: Adam Richter @ 2014-09-11  9:32 UTC (permalink / raw)
  To: Takashi Iwai; +Cc: alsa-devel

[-- Attachment #1: Type: text/plain, Size: 1220 bytes --]

On Thu, 9/11/14, Takashi Iwai <tiwai@suse.de> wrote:

> Could you give alsa-info.sh output on your machine?  Otherwise it's difficult to analyze.

OK.  I have attached it.  In a few places, I replaced text with "[DELETED]" to avoid identifying the product.

> Speaking of your patch: add_jack_kctl() itself has a check of is_jack_detectable() for phantom jacks,
> so basically this shouldn'tmake any difference.  So we need to check more deeply why this
> change is really needed.


Right. This is some kind of initialization order problem where the following data flow fails: codec->no_jack_detect ==> jack->phantom_jack ==> jack->pin_sense.  The Intel driver has a lot of "codec" sub-drivers, and I wasn't sure if would would really be practical for me to understand and get the relevant codec maintainers to approve if necessary.  The fix I proposed is something I see as a temporary very low overhead workaround (only adds a few instructions, and only at initialization) until a correct fix is implemented.  However, if this can be fixed properly quicly enoughtso avoid the need for a temporary workaround, that would be great. 
 
>thanks,
>
>Takashi
 
Thank you for your analysis of this.

Adam

[-- Attachment #2: alsa-info.txt --]
[-- Type: text/plain, Size: 54947 bytes --]

upload=true&script=true&cardinfo=
!!################################
!!ALSA Information Script v 0.4.63
!!################################

!!Script ran on: Thu Sep 11 09:07:05 UTC 2014


!!Linux Distribution
!!------------------

Ubuntu 13.04 \n \l DISTRIB_ID=Ubuntu DISTRIB_DESCRIPTION="Ubuntu 13.04" NAME="Ubuntu" ID=ubuntu ID_LIKE=debian PRETTY_NAME="Ubuntu 13.04" HOME_URL="http://www.ubuntu.com/" SUPPORT_URL="http://help.ubuntu.com/" BUG_REPORT_URL="http://bugs.launchpad.net/ubuntu/"


!!DMI Information
!!---------------

Manufacturer:      [DELETED]
Product Name:      [DELETED]
Product Version:   [DELETED]
Firmware Version:  [DELETED]


!!Kernel Information
!!------------------

Kernel release:    3.17.0-rc4-64bit
Operating System:  GNU/Linux
Architecture:      x86_64
Processor:         x86_64
SMP Enabled:       Yes


!!ALSA Version
!!------------

Driver version:     k3.17.0-rc4-64bit
Library version:    1.0.25
Utilities version:  1.0.25


!!Loaded ALSA modules
!!-------------------

snd_hda_intel
snd_usb_audio


!!Sound Servers on this system
!!----------------------------

Pulseaudio:
      Installed - Yes (/usr/bin/pulseaudio)
      Running - Yes


!!Soundcards recognised by ALSA
!!-----------------------------

 0 [Intel          ]: HDA-Intel - HDA Intel
                      HDA Intel at 0xfeaf8000 irq 29
 1 [U0xd8c0x0c     ]: USB-Audio - USB Device 0xd8c:0x0c
                      USB Device 0xd8c:0x0c at usb-0000:00:1d.1-1, full speed


!!PCI Soundcards installed in the system
!!--------------------------------------

00:1b.0 Audio device: Intel Corporation 82801I (ICH9 Family) HD Audio Controller (rev 03)


!!Advanced information - PCI Vendor/Device/Subsystem ID's
!!-------------------------------------------------------

00:1b.0 0403: 8086:293e (rev 03)
	Subsystem: 8086:293e


!!Modprobe options (Sound related)
!!--------------------------------

snd_atiixp_modem: index=-2
snd_intel8x0m: index=-2
snd_via82xx_modem: index=-2
snd_usb_audio: index=-2
snd_usb_caiaq: index=-2
snd_usb_ua101: index=-2
snd_usb_us122l: index=-2
snd_usb_usx2y: index=-2
snd_cmipci: mpu_port=0x330 fm_port=0x388
snd_pcsp: index=-2
snd_usb_audio: index=-2
snd_hda_intel: model=no-jd


!!Loaded sound module options
!!---------------------------

!!Module: snd_hda_intel
	align_buffer_size : -1
	bdl_pos_adj : 1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1
	beep_mode : Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y
	enable : Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y
	enable_msi : -1
	id : (null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null)
	index : -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1
	jackpoll_ms : 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
	model : no-jd,(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null)
	position_fix : -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1
	power_save : 0
	power_save_controller : Y
	probe_mask : -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1
	probe_only : 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
	single_cmd : N
	snoop : Y

!!Module: snd_usb_audio
	autoclock : Y
	device_setup : 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
	enable : Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y
	id : (null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null)
	ignore_ctl_error : N
	index : -2,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1
	pid : -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1
	vid : -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1


!!HDA-Intel Codec information
!!---------------------------
--startcollapse--

Codec: IDT 92HD73C1X5
Address: 0
AFG Function Id: 0x1 (unsol 1)
Vendor Id: 0x111d7675
Subsystem Id: 0x00000100
Revision Id: 0x100202
No Modem Function Group found
Default PCM:
    rates [0x5e0]: 44100 48000 88200 96000 192000
    bits [0xe]: 16 20 24
    formats [0x1]: PCM
Default Amp-In caps: ofs=0x00, nsteps=0x03, stepsize=0x27, mute=0
Default Amp-Out caps: ofs=0x7f, nsteps=0x7f, stepsize=0x02, mute=1
State of AFG node 0x01:
  Power states:  D0 D1 D2 D3
  Power: setting=D0, actual=D0
GPIO: io=8, o=0, i=0, unsolicited=1, wake=1
  IO[0]: enable=1, dir=1, wake=0, sticky=0, data=1, unsol=0
  IO[1]: enable=0, dir=0, wake=0, sticky=0, data=0, unsol=0
  IO[2]: enable=0, dir=0, wake=0, sticky=0, data=0, unsol=0
  IO[3]: enable=0, dir=0, wake=0, sticky=0, data=0, unsol=0
  IO[4]: enable=0, dir=0, wake=0, sticky=0, data=0, unsol=0
  IO[5]: enable=0, dir=0, wake=0, sticky=0, data=0, unsol=0
  IO[6]: enable=0, dir=0, wake=0, sticky=0, data=0, unsol=0
  IO[7]: enable=0, dir=0, wake=0, sticky=0, data=0, unsol=0
Power-Map: 0x80
Analog Loopback: 0x00
Node 0x0a [Pin Complex] wcaps 0x400183: Stereo Amp-In
  Control: name="Front Headphone Phantom Jack", index=0, device=0
  Amp-In caps: N/A
  Amp-In vals:  [0x00 0x00]
  Pincap 0x0000173f: IN OUT HP Detect Trigger ImpSense
    Vref caps: HIZ 50 GRD 80
  Pin Default 0x0221401f: [Jack] HP Out at Ext Front
    Conn = 1/8, Color = Green
    DefAssociation = 0x1, Sequence = 0xf
  Pin-ctls: 0xc0: OUT HP VREF_HIZ
  Unsolicited: tag=01, enabled=1
  Connection: 4
     0x15* 0x16 0x17 0x1e
Node 0x0b [Pin Complex] wcaps 0x400183: Stereo Amp-In
  Control: name="Front Mic Boost Volume", index=0, device=0
    ControlAmp: chs=3, dir=In, idx=0, ofs=0
  Control: name="Front Mic Phantom Jack", index=0, device=0
  Amp-In caps: N/A
  Amp-In vals:  [0x00 0x00]
  Pincap 0x0000173f: IN OUT HP Detect Trigger ImpSense
    Vref caps: HIZ 50 GRD 80
  Pin Default 0x02a19040: [Jack] Mic at Ext Front
    Conn = 1/8, Color = Pink
    DefAssociation = 0x4, Sequence = 0x0
  Pin-ctls: 0x24: IN VREF_80
  Unsolicited: tag=02, enabled=1
  Connection: 4
     0x15* 0x16 0x17 0x1e
Node 0x0c [Pin Complex] wcaps 0x400183: Stereo Amp-In
  Control: name="Line Boost Volume", index=0, device=0
    ControlAmp: chs=3, dir=In, idx=0, ofs=0
  Control: name="Line Phantom Jack", index=0, device=0
  Amp-In caps: N/A
  Amp-In vals:  [0x00 0x00]
  Pincap 0x00001737: IN OUT Detect Trigger ImpSense
    Vref caps: HIZ 50 GRD 80
  Pin Default 0x01813021: [Jack] Line In at Ext Rear
    Conn = 1/8, Color = Blue
    DefAssociation = 0x2, Sequence = 0x1
  Pin-ctls: 0x20: IN VREF_HIZ
  Unsolicited: tag=03, enabled=1
  Connection: 4
     0x15* 0x16 0x17 0x1e
Node 0x0d [Pin Complex] wcaps 0x400183: Stereo Amp-In
  Control: name="Line Out Front Phantom Jack", index=0, device=0
  Amp-In caps: N/A
  Amp-In vals:  [0x00 0x00]
  Pincap 0x0000003f: IN OUT HP Detect Trigger ImpSense
  Pin Default 0x01014010: [Jack] Line Out at Ext Rear
    Conn = 1/8, Color = Green
    DefAssociation = 0x1, Sequence = 0x0
  Pin-ctls: 0x40: OUT
  Unsolicited: tag=04, enabled=1
  Connection: 4
     0x15* 0x16 0x17 0x1e
Node 0x0e [Pin Complex] wcaps 0x400183: Stereo Amp-In
  Control: name="Rear Mic Boost Volume", index=0, device=0
    ControlAmp: chs=3, dir=In, idx=0, ofs=0
  Control: name="Rear Mic Phantom Jack", index=0, device=0
  Amp-In caps: N/A
  Amp-In vals:  [0x00 0x00]
  Pincap 0x00001737: IN OUT Detect Trigger ImpSense
    Vref caps: HIZ 50 GRD 80
  Pin Default 0x01a19020: [Jack] Mic at Ext Rear
    Conn = 1/8, Color = Pink
    DefAssociation = 0x2, Sequence = 0x0
  Pin-ctls: 0x24: IN VREF_80
  Unsolicited: tag=05, enabled=1
  Connection: 4
     0x15* 0x16 0x17 0x1e
Node 0x0f [Pin Complex] wcaps 0x400183: Stereo Amp-In
  Control: name="Line Out Surround Phantom Jack", index=0, device=0
  Amp-In caps: N/A
  Amp-In vals:  [0x00 0x00]
  Pincap 0x00000037: IN OUT Detect Trigger ImpSense
  Pin Default 0x01011012: [Jack] Line Out at Ext Rear
    Conn = 1/8, Color = Black
    DefAssociation = 0x1, Sequence = 0x2
  Pin-ctls: 0x40: OUT
  Unsolicited: tag=06, enabled=1
  Connection: 4
     0x15 0x16* 0x17 0x1e
Node 0x10 [Pin Complex] wcaps 0x400183: Stereo Amp-In
  Control: name="Line Out CLFE Phantom Jack", index=0, device=0
  Amp-In caps: N/A
  Amp-In vals:  [0x00 0x00]
  Pincap 0x00000037: IN OUT Detect Trigger ImpSense
  Pin Default 0x01016011: [Jack] Line Out at Ext Rear
    Conn = 1/8, Color = Orange
    DefAssociation = 0x1, Sequence = 0x1
  Pin-ctls: 0x40: OUT
  Unsolicited: tag=07, enabled=1
  Connection: 4
     0x15 0x16 0x17* 0x1e
Node 0x11 [Pin Complex] wcaps 0x400183: Stereo Amp-In
  Amp-In caps: N/A
  Amp-In vals:  [0x00 0x00]
  Pincap 0x00000037: IN OUT Detect Trigger ImpSense
  Pin Default 0x41f120f0: [N/A] Other at Ext Rear
    Conn = 1/8, Color = Grey
    DefAssociation = 0xf, Sequence = 0x0
  Pin-ctls: 0x00:
  Unsolicited: tag=00, enabled=0
  Connection: 4
     0x15* 0x16 0x17 0x1e
Node 0x12 [Pin Complex] wcaps 0x400081: Stereo
  Control: name="CD Phantom Jack", index=0, device=0
  Pincap 0x00000024: IN Detect
  Pin Default 0x9933012e: [Fixed] CD at Int ATAPI
    Conn = ATAPI, Color = Unknown
    DefAssociation = 0x2, Sequence = 0xe
    Misc = NO_PRESENCE
  Pin-ctls: 0x20: IN
  Unsolicited: tag=00, enabled=0
Node 0x13 [Pin Complex] wcaps 0x400003: Stereo Amp-In
  Control: name="Internal Mic Boost Volume", index=1, device=0
    ControlAmp: chs=3, dir=In, idx=0, ofs=0
  Control: name="Internal Mic Phantom Jack", index=1, device=0
  Amp-In caps: N/A
  Amp-In vals:  [0x00 0x00]
  Pincap 0x00000020: IN
  Pin Default 0x90a30070: [Fixed] Mic at Int N/A
    Conn = ATAPI, Color = Unknown
    DefAssociation = 0x7, Sequence = 0x0
  Pin-ctls: 0x20: IN
Node 0x14 [Pin Complex] wcaps 0x400003: Stereo Amp-In
  Control: name="Internal Mic Boost Volume", index=0, device=0
    ControlAmp: chs=3, dir=In, idx=0, ofs=0
  Control: name="Internal Mic Phantom Jack", index=0, device=0
  Amp-In caps: N/A
  Amp-In vals:  [0x00 0x00]
  Pincap 0x00000020: IN
  Pin Default 0x90a3007e: [Fixed] Mic at Int N/A
    Conn = ATAPI, Color = Unknown
    DefAssociation = 0x7, Sequence = 0xe
  Pin-ctls: 0x20: IN
Node 0x15 [Audio Output] wcaps 0xd0c05: Stereo Amp-Out R/L
  Control: name="Front Playback Volume", index=0, device=0
    ControlAmp: chs=3, dir=Out, idx=0, ofs=0
  Control: name="Front Playback Switch", index=0, device=0
    ControlAmp: chs=3, dir=Out, idx=0, ofs=0
  Device: name="92HD73C1X5 Analog", type="Audio", device=0
  Amp-Out caps: N/A
  Amp-Out vals:  [0x66 0x66]
  Converter: stream=5, channel=0
  Power states: 
  Power: setting=D0, actual=D0
  Delay: 13 samples
Node 0x16 [Audio Output] wcaps 0xd0c05: Stereo Amp-Out R/L
  Control: name="Surround Playback Volume", index=0, device=0
    ControlAmp: chs=3, dir=Out, idx=0, ofs=0
  Control: name="Surround Playback Switch", index=0, device=0
    ControlAmp: chs=3, dir=Out, idx=0, ofs=0
  Amp-Out caps: N/A
  Amp-Out vals:  [0x66 0x66]
  Converter: stream=5, channel=0
  Power states: 
  Power: setting=D0, actual=D0
  Delay: 13 samples
Node 0x17 [Audio Output] wcaps 0xd0c05: Stereo Amp-Out R/L
  Control: name="Center Playback Volume", index=0, device=0
    ControlAmp: chs=1, dir=Out, idx=0, ofs=0
  Control: name="LFE Playback Volume", index=0, device=0
    ControlAmp: chs=2, dir=Out, idx=0, ofs=0
  Control: name="Center Playback Switch", index=0, device=0
    ControlAmp: chs=1, dir=Out, idx=0, ofs=0
  Control: name="LFE Playback Switch", index=0, device=0
    ControlAmp: chs=2, dir=Out, idx=0, ofs=0
  Amp-Out caps: N/A
  Amp-Out vals:  [0x66 0x66]
  Converter: stream=5, channel=0
  Power states: 
  Power: setting=D0, actual=D0
  Delay: 13 samples
Node 0x18 [Vendor Defined Widget] wcaps 0xfd0c05: Stereo Amp-Out R/L
  Amp-Out caps: N/A
  Amp-Out vals:  [0xff 0xff]
  Power states: 
  Power: setting=D0, actual=D3
  Delay: 13 samples
Node 0x19 [Vendor Defined Widget] wcaps 0xfd0c05: Stereo Amp-Out R/L
  Amp-Out caps: N/A
  Amp-Out vals:  [0xff 0xff]
  Power states: 
  Power: setting=D0, actual=D3
  Delay: 13 samples
Node 0x1a [Audio Input] wcaps 0x1d0541: Stereo
  Device: name="92HD73C1X5 Analog", type="Audio", device=0
  Converter: stream=1, channel=0
  SDI-Select: 0
  Power states: 
  Power: setting=D0, actual=D0
  Delay: 13 samples
  Connection: 1
     0x20
  Processing caps: benign=0, ncoeff=0
Node 0x1b [Audio Input] wcaps 0x1d0541: Stereo
  Device: name="92HD73C1X5 Alt Analog", type="Audio", device=2
  Converter: stream=0, channel=0
  SDI-Select: 0
  Power states: 
  Power: setting=D0, actual=D0
  Delay: 13 samples
  Connection: 1
     0x21
  Processing caps: benign=0, ncoeff=0
Node 0x1c [Beep Generator Widget] wcaps 0x70000c: Mono Amp-Out
  Control: name="Beep Playback Switch", index=0, device=0
    ControlAmp: chs=1, dir=Out, idx=0, ofs=0
  Control: name="Beep Playback Volume", index=0, device=0
    ControlAmp: chs=1, dir=Out, idx=0, ofs=0
  Amp-Out caps: ofs=0x03, nsteps=0x03, stepsize=0x17, mute=1
  Amp-Out vals:  [0x80]
Node 0x1d [Audio Mixer] wcaps 0x20010b: Stereo Amp-In
  Control: name="Rear Mic Playback Volume", index=0, device=0
    ControlAmp: chs=3, dir=In, idx=1, ofs=0
  Control: name="Rear Mic Playback Switch", index=0, device=0
    ControlAmp: chs=3, dir=In, idx=1, ofs=0
  Control: name="Front Mic Playback Volume", index=0, device=0
    ControlAmp: chs=3, dir=In, idx=0, ofs=0
  Control: name="Front Mic Playback Switch", index=0, device=0
    ControlAmp: chs=3, dir=In, idx=0, ofs=0
  Control: name="Line Playback Volume", index=0, device=0
    ControlAmp: chs=3, dir=In, idx=2, ofs=0
  Control: name="Line Playback Switch", index=0, device=0
    ControlAmp: chs=3, dir=In, idx=2, ofs=0
  Control: name="CD Playback Volume", index=0, device=0
    ControlAmp: chs=3, dir=In, idx=4, ofs=0
  Control: name="CD Playback Switch", index=0, device=0
    ControlAmp: chs=3, dir=In, idx=4, ofs=0
  Amp-In caps: ofs=0x17, nsteps=0x1f, stepsize=0x05, mute=1
  Amp-In vals:  [0x80 0x80] [0x80 0x80] [0x80 0x80] [0x80 0x80] [0x80 0x80]
  Connection: 5
     0x28 0x29 0x2a 0x2b 0x12
Node 0x1e [Audio Selector] wcaps 0x30010d: Stereo Amp-Out
  Amp-Out caps: ofs=0x1f, nsteps=0x1f, stepsize=0x05, mute=1
  Amp-Out vals:  [0x80 0x80]
  Connection: 1
     0x1d
Node 0x1f [Volume Knob Widget] wcaps 0x600000: Mono
  Volume-Knob: delta=1, steps=127, direct=1, val=127
  Connection: 3
     0x15 0x16 0x17
Node 0x20 [Audio Selector] wcaps 0x30090d: Stereo Amp-Out R/L
  Control: name="Capture Volume", index=0, device=0
    ControlAmp: chs=3, dir=Out, idx=0, ofs=0
  Control: name="Capture Switch", index=0, device=0
    ControlAmp: chs=3, dir=Out, idx=0, ofs=0
  Amp-Out caps: ofs=0x00, nsteps=0x0f, stepsize=0x05, mute=1
  Amp-Out vals:  [0x0f 0x0f]
  Connection: 12
     0x0a 0x0b* 0x0c 0x0d 0x0e 0x0f 0x10 0x11 0x12 0x13 0x14 0x1d
Node 0x21 [Audio Selector] wcaps 0x30090d: Stereo Amp-Out R/L
  Control: name="Capture Volume", index=1, device=0
    ControlAmp: chs=3, dir=Out, idx=0, ofs=0
  Control: name="Capture Switch", index=1, device=0
    ControlAmp: chs=3, dir=Out, idx=0, ofs=0
  Amp-Out caps: ofs=0x00, nsteps=0x0f, stepsize=0x05, mute=1
  Amp-Out vals:  [0x80 0x80]
  Connection: 12
     0x0a 0x0b* 0x0c 0x0d 0x0e 0x0f 0x10 0x11 0x12 0x13 0x14 0x1d
Node 0x22 [Pin Complex] wcaps 0x400301: Stereo Digital
  Control: name="SPDIF Phantom Jack", index=0, device=0
  Pincap 0x00000010: OUT
  Pin Default 0x01451050: [Jack] SPDIF Out at Ext Rear
    Conn = Optical, Color = Black
    DefAssociation = 0x5, Sequence = 0x0
  Pin-ctls: 0x40: OUT
  Connection: 3
     0x25* 0x20 0x21
Node 0x23 [Pin Complex] wcaps 0x400301: Stereo Digital
  Control: name="HDMI Phantom Jack", index=0, device=0
  Pincap 0x00000010: OUT
  Pin Default 0x98560060: [Fixed] Digital Out at Int HDMI
    Conn = Digital, Color = Unknown
    DefAssociation = 0x6, Sequence = 0x0
  Pin-ctls: 0x40: OUT
  Connection: 3
     0x26* 0x20 0x21
Node 0x24 [Pin Complex] wcaps 0x400681: Stereo Digital
  Control: name="SPDIF In Phantom Jack", index=0, device=0
  Pincap 0x00010024: IN EAPD Detect
  EAPD 0x0:
  Pin Default 0x01c52080: [Jack] SPDIF In at Ext Rear
    Conn = Optical, Color = Grey
    DefAssociation = 0x8, Sequence = 0x0
  Pin-ctls: 0x20: IN
  Unsolicited: tag=00, enabled=0
  Power states: 
  Power: setting=D0, actual=D0
Node 0x25 [Audio Output] wcaps 0x4021d: Stereo Digital Amp-Out
  Control: name="IEC958 Playback Con Mask", index=16, device=0
  Control: name="IEC958 Playback Pro Mask", index=16, device=0
  Control: name="IEC958 Playback Default", index=16, device=0
  Control: name="IEC958 Playback Switch", index=16, device=0
  Control: name="IEC958 Default PCM Playback Switch", index=0, device=0
  Device: name="92HD73C1X5 Digital", type="SPDIF", device=1
  Amp-Out caps: ofs=0x00, nsteps=0x00, stepsize=0x00, mute=1
  Amp-Out vals:  [0x00 0x00]
  Converter: stream=5, channel=0
  Digital:
  Digital category: 0x0
  IEC Coding Type: 0x0
  PCM:
    rates [0x5e0]: 44100 48000 88200 96000 192000
    bits [0xe]: 16 20 24
    formats [0x5]: PCM AC3
  Delay: 4 samples
Node 0x26 [Audio Output] wcaps 0x4021d: Stereo Digital Amp-Out
  Amp-Out caps: ofs=0x00, nsteps=0x00, stepsize=0x00, mute=1
  Amp-Out vals:  [0x00 0x00]
  Converter: stream=5, channel=0
  Digital:
  Digital category: 0x0
  IEC Coding Type: 0x0
  PCM:
    rates [0x5e0]: 44100 48000 88200 96000 192000
    bits [0xe]: 16 20 24
    formats [0x5]: PCM AC3
  Delay: 4 samples
Node 0x27 [Audio Input] wcaps 0x14031b: Stereo Digital Amp-In
  Control: name="IEC958 Capture Switch", index=0, device=0
  Control: name="IEC958 Capture Default", index=0, device=0
  Device: name="92HD73C1X5 Digital", type="SPDIF", device=1
  Amp-In caps: ofs=0x00, nsteps=0x00, stepsize=0x00, mute=1
  Amp-In vals:  [0x00 0x00]
  Converter: stream=0, channel=0
  SDI-Select: 0
  Digital:
  Digital category: 0x0
  IEC Coding Type: 0x0
  PCM:
    rates [0x160]: 44100 48000 96000
    bits [0xe]: 16 20 24
    formats [0x5]: PCM AC3
  Delay: 4 samples
  Connection: 1
     0x24
Node 0x28 [Audio Selector] wcaps 0x300101: Stereo
  Connection: 4
     0x0a 0x0b* 0x0d 0x0f
Node 0x29 [Audio Selector] wcaps 0x300101: Stereo
  Connection: 4
     0x0a 0x0e* 0x10 0x11
Node 0x2a [Audio Selector] wcaps 0x300101: Stereo
  Connection: 4
     0x0b 0x0c* 0x10 0x11
Node 0x2b [Audio Selector] wcaps 0x300101: Stereo
  Connection: 3
     0x15* 0x16 0x17
Codec: Intel Cantiga HDMI
Address: 3
AFG Function Id: 0x1 (unsol 0)
Vendor Id: 0x80862802
Subsystem Id: 0x80860101
Revision Id: 0x100000
No Modem Function Group found
Default PCM:
    rates [0x0]:
    bits [0x0]:
    formats [0x0]:
Default Amp-In caps: N/A
Default Amp-Out caps: N/A
State of AFG node 0x01:
  Power states:  D0 D3
  Power: setting=D0, actual=D0
GPIO: io=0, o=0, i=0, unsolicited=0, wake=0
Node 0x02 [Audio Output] wcaps 0x6211: 8-Channels Digital
  Converter: stream=6, channel=0
  Digital: Enabled
  Digital category: 0x0
  IEC Coding Type: 0x0
  PCM:
    rates [0x7f0]: 32000 44100 48000 88200 96000 176400 192000
    bits [0x1e]: 16 20 24 32
    formats [0x5]: PCM AC3
Node 0x03 [Pin Complex] wcaps 0x40739d: 8-Channels Digital Amp-Out CP
  Control: name="HDMI/DP,pcm=3 Jack", index=0, device=0
  Control: name="IEC958 Playback Con Mask", index=0, device=0
  Control: name="IEC958 Playback Pro Mask", index=0, device=0
  Control: name="IEC958 Playback Default", index=0, device=0
  Control: name="IEC958 Playback Switch", index=0, device=0
  Control: name="ELD", index=0, device=3
  Amp-Out caps: ofs=0x00, nsteps=0x00, stepsize=0x00, mute=1
  Amp-Out vals:  [0x00 0x00]
  Pincap 0x00000094: OUT Detect HDMI
  Pin Default 0x18560010: [Jack] Digital Out at Int HDMI
    Conn = Digital, Color = Unknown
    DefAssociation = 0x1, Sequence = 0x0
  Pin-ctls: 0x40: OUT
  Unsolicited: tag=01, enabled=1
  Connection: 1
     0x02
--endcollapse--


!!USB Mixer information
!!---------------------
--startcollapse--

USB Mixer: usb_id=0x0d8c000c, ctrlif=0, ctlerr=0
Card: USB Device 0xd8c:0x0c at usb-0000:00:1d.1-1, full speed
  Unit: 9
    Control: name="Speaker Playback Volume", index=0
    Info: id=9, control=2, cmask=0x3, channels=2, type="S16"
    Volume: min=-7264, max=-16, dBmin=-2837, dBmax=-6
  Unit: 9
    Control: name="Speaker Playback Switch", index=0
    Info: id=9, control=1, cmask=0x0, channels=1, type="INV_BOOLEAN"
    Volume: min=0, max=1, dBmin=0, dBmax=0
  Unit: 10
    Control: name="Auto Gain Control", index=0
    Info: id=10, control=7, cmask=0x0, channels=1, type="BOOLEAN"
    Volume: min=0, max=1, dBmin=0, dBmax=0
  Unit: 10
    Control: name="Mic Capture Volume", index=0
    Info: id=10, control=2, cmask=0x0, channels=1, type="S16"
    Volume: min=0, max=6096, dBmin=0, dBmax=2381
  Unit: 10
    Control: name="Mic Capture Switch", index=0
    Info: id=10, control=1, cmask=0x0, channels=1, type="INV_BOOLEAN"
    Volume: min=0, max=1, dBmin=0, dBmax=0
  Unit: 13
    Control: name="Mic Playback Volume", index=0
    Info: id=13, control=2, cmask=0x0, channels=1, type="S16"
    Volume: min=0, max=12240, dBmin=0, dBmax=4781
  Unit: 13
    Control: name="Mic Playback Switch", index=0
    Info: id=13, control=1, cmask=0x0, channels=1, type="INV_BOOLEAN"
    Volume: min=0, max=1, dBmin=0, dBmax=0
--endcollapse--


!!ALSA Device nodes
!!-----------------

crw-rw---T 1 root audio 116,  2 Sep 11 05:04 /dev/snd/controlC0
crw-rw---T 1 root audio 116, 11 Sep 11 05:04 /dev/snd/controlC1
crw-rw---T 1 root audio 116,  9 Sep 11 05:04 /dev/snd/hwC0D0
crw-rw---T 1 root audio 116, 10 Sep 11 05:04 /dev/snd/hwC0D3
crw-rw---T 1 root audio 116,  4 Sep 11 05:04 /dev/snd/pcmC0D0c
crw-rw---T 1 root audio 116,  3 Sep 11 05:04 /dev/snd/pcmC0D0p
crw-rw---T 1 root audio 116,  6 Sep 11 05:04 /dev/snd/pcmC0D1c
crw-rw---T 1 root audio 116,  5 Sep 11 05:04 /dev/snd/pcmC0D1p
crw-rw---T 1 root audio 116,  7 Sep 11 05:04 /dev/snd/pcmC0D2c
crw-rw---T 1 root audio 116,  8 Sep 11 05:04 /dev/snd/pcmC0D3p
crw-rw---T 1 root audio 116, 13 Sep 11 05:04 /dev/snd/pcmC1D0c
crw-rw---T 1 root audio 116, 12 Sep 11 05:04 /dev/snd/pcmC1D0p
crw-rw---T 1 root audio 116,  1 Sep 11 05:04 /dev/snd/seq
crw-rw---T 1 root audio 116, 33 Sep 11 05:04 /dev/snd/timer

/dev/snd/by-id:
total 0
drwxr-xr-x 2 root root  60 Sep 11 05:04 .
drwxr-xr-x 4 root root 360 Sep 11 05:04 ..
lrwxrwxrwx 1 root root  12 Sep 11 05:04 usb-0d8c_000c-00 -> ../controlC1

/dev/snd/by-path:
total 0
drwxr-xr-x 2 root root  80 Sep 11 05:04 .
drwxr-xr-x 4 root root 360 Sep 11 05:04 ..
lrwxrwxrwx 1 root root  12 Sep 11 05:04 pci-0000:00:1b.0 -> ../controlC0
lrwxrwxrwx 1 root root  12 Sep 11 05:04 pci-0000:00:1d.1-usb-0:1:1.0 -> ../controlC1


!!Aplay/Arecord output
!!--------------------

APLAY

**** List of PLAYBACK Hardware Devices ****
card 0: Intel [HDA Intel], device 0: 92HD73C1X5 Analog [92HD73C1X5 Analog]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: Intel [HDA Intel], device 1: 92HD73C1X5 Digital [92HD73C1X5 Digital]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: Intel [HDA Intel], device 3: HDMI 0 [HDMI 0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: U0xd8c0x0c [USB Device 0xd8c:0x0c], device 0: USB Audio [USB Audio]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

ARECORD

**** List of CAPTURE Hardware Devices ****
card 0: Intel [HDA Intel], device 0: 92HD73C1X5 Analog [92HD73C1X5 Analog]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: Intel [HDA Intel], device 1: 92HD73C1X5 Digital [92HD73C1X5 Digital]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: Intel [HDA Intel], device 2: 92HD73C1X5 Alt Analog [92HD73C1X5 Alt Analog]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: U0xd8c0x0c [USB Device 0xd8c:0x0c], device 0: USB Audio [USB Audio]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

!!Amixer output
!!-------------

!!-------Mixer controls for card 0 [Intel]

Card hw:0 'Intel'/'HDA Intel at 0xfeaf8000 irq 29'
  Mixer name	: 'Intel Cantiga HDMI'
  Components	: 'HDA:111d7675,00000100,00100202 HDA:80862802,80860101,00100000'
  Controls      : 67
  Simple ctrls  : 26
Simple mixer control 'Master',0
  Capabilities: pvolume pvolume-joined pswitch pswitch-joined penum
  Playback channels: Mono
  Limits: Playback 0 - 127
  Mono: Playback 102 [80%] [-18.75dB] [on]
Simple mixer control 'PCM',0
  Capabilities: pvolume penum
  Playback channels: Front Left - Front Right
  Limits: Playback 0 - 255
  Mono:
  Front Left: Playback 255 [100%] [0.00dB]
  Front Right: Playback 255 [100%] [0.00dB]
Simple mixer control 'Front',0
  Capabilities: pvolume pswitch penum
  Playback channels: Front Left - Front Right
  Limits: Playback 0 - 127
  Mono:
  Front Left: Playback 127 [100%] [0.00dB] [on]
  Front Right: Playback 127 [100%] [0.00dB] [on]
Simple mixer control 'Front Mic',0
  Capabilities: pvolume pswitch penum
  Playback channels: Front Left - Front Right
  Limits: Playback 0 - 31
  Mono:
  Front Left: Playback 0 [0%] [-34.50dB] [off]
  Front Right: Playback 0 [0%] [-34.50dB] [off]
Simple mixer control 'Front Mic Boost',0
  Capabilities: volume penum
  Playback channels: Front Left - Front Right
  Capture channels: Front Left - Front Right
  Limits: 0 - 3
  Front Left: 0 [0%] [0.00dB]
  Front Right: 0 [0%] [0.00dB]
Simple mixer control 'Surround',0
  Capabilities: pvolume pswitch penum
  Playback channels: Front Left - Front Right
  Limits: Playback 0 - 127
  Mono:
  Front Left: Playback 127 [100%] [0.00dB] [on]
  Front Right: Playback 127 [100%] [0.00dB] [on]
Simple mixer control 'Center',0
  Capabilities: pvolume pvolume-joined pswitch pswitch-joined penum
  Playback channels: Mono
  Limits: Playback 0 - 127
  Mono: Playback 127 [100%] [0.00dB] [on]
Simple mixer control 'LFE',0
  Capabilities: pvolume pvolume-joined pswitch pswitch-joined penum
  Playback channels: Mono
  Limits: Playback 0 - 127
  Mono: Playback 127 [100%] [0.00dB] [on]
Simple mixer control 'Line',0
  Capabilities: pvolume pswitch penum
  Playback channels: Front Left - Front Right
  Limits: Playback 0 - 31
  Mono:
  Front Left: Playback 0 [0%] [-34.50dB] [off]
  Front Right: Playback 0 [0%] [-34.50dB] [off]
Simple mixer control 'Line Boost',0
  Capabilities: volume penum
  Playback channels: Front Left - Front Right
  Capture channels: Front Left - Front Right
  Limits: 0 - 3
  Front Left: 0 [0%] [0.00dB]
  Front Right: 0 [0%] [0.00dB]
Simple mixer control 'CD',0
  Capabilities: pvolume pswitch penum
  Playback channels: Front Left - Front Right
  Limits: Playback 0 - 31
  Mono:
  Front Left: Playback 0 [0%] [-34.50dB] [off]
  Front Right: Playback 0 [0%] [-34.50dB] [off]
Simple mixer control 'IEC958',0
  Capabilities: pswitch pswitch-joined cswitch cswitch-joined penum
  Playback channels: Mono
  Capture channels: Mono
  Mono: Playback [on] Capture [off]
Simple mixer control 'IEC958 Default PCM',0
  Capabilities: pswitch pswitch-joined penum
  Playback channels: Mono
  Mono: Playback [on]
Simple mixer control 'IEC958 Playback Source',0
  Capabilities: enum
  Items: 'Digital Playback' 'Analog Mux 1' 'Analog Mux 2'
  Item0: 'Digital Playback'
Simple mixer control 'IEC958 Playback Source',1
  Capabilities: enum
  Items: 'Digital Playback' 'Analog Mux 1' 'Analog Mux 2'
  Item0: 'Digital Playback'
Simple mixer control 'IEC958',16
  Capabilities: pswitch pswitch-joined penum
  Playback channels: Mono
  Mono: Playback [off]
Simple mixer control 'Beep',0
  Capabilities: pvolume pvolume-joined pswitch pswitch-joined penum
  Playback channels: Mono
  Limits: Playback 0 - 3
  Mono: Playback 0 [0%] [-18.00dB] [off]
Simple mixer control 'Capture',0
  Capabilities: cvolume cswitch penum
  Capture channels: Front Left - Front Right
  Limits: Capture 0 - 15
  Front Left: Capture 15 [100%] [22.50dB] [on]
  Front Right: Capture 15 [100%] [22.50dB] [on]
Simple mixer control 'Capture',1
  Capabilities: cvolume cswitch penum
  Capture channels: Front Left - Front Right
  Limits: Capture 0 - 15
  Front Left: Capture 0 [0%] [0.00dB] [off]
  Front Right: Capture 0 [0%] [0.00dB] [off]
Simple mixer control 'Input Source',0
  Capabilities: cenum
  Items: 'Internal Mic' 'Rear Mic' 'Front Mic' 'Internal Mic 1' 'Line' 'CD'
  Item0: 'Front Mic'
Simple mixer control 'Input Source',1
  Capabilities: cenum
  Items: 'Internal Mic' 'Rear Mic' 'Front Mic' 'Internal Mic 1' 'Line' 'CD'
  Item0: 'Front Mic'
Simple mixer control 'Internal Mic Boost',0
  Capabilities: volume penum
  Playback channels: Front Left - Front Right
  Capture channels: Front Left - Front Right
  Limits: 0 - 3
  Front Left: 0 [0%] [0.00dB]
  Front Right: 0 [0%] [0.00dB]
Simple mixer control 'Internal Mic Boost',1
  Capabilities: volume penum
  Playback channels: Front Left - Front Right
  Capture channels: Front Left - Front Right
  Limits: 0 - 3
  Front Left: 0 [0%] [0.00dB]
  Front Right: 0 [0%] [0.00dB]
Simple mixer control 'Loopback Mixing',0
  Capabilities: enum
  Items: 'Disabled' 'Enabled'
  Item0: 'Disabled'
Simple mixer control 'Rear Mic',0
  Capabilities: pvolume pswitch penum
  Playback channels: Front Left - Front Right
  Limits: Playback 0 - 31
  Mono:
  Front Left: Playback 0 [0%] [-34.50dB] [off]
  Front Right: Playback 0 [0%] [-34.50dB] [off]
Simple mixer control 'Rear Mic Boost',0
  Capabilities: volume penum
  Playback channels: Front Left - Front Right
  Capture channels: Front Left - Front Right
  Limits: 0 - 3
  Front Left: 0 [0%] [0.00dB]
  Front Right: 0 [0%] [0.00dB]

!!-------Mixer controls for card 1 [U0xd8c0x0c]

Card hw:1 'U0xd8c0x0c'/'USB Device 0xd8c:0x0c at usb-0000:00:1d.1-1, full speed'
  Mixer name	: 'USB Mixer'
  Components	: 'USB0d8c:000c'
  Controls      : 9
  Simple ctrls  : 3
Simple mixer control 'Speaker',0
  Capabilities: pvolume pswitch pswitch-joined penum
  Playback channels: Front Left - Front Right
  Limits: Playback 0 - 151
  Mono:
  Front Left: Playback 88 [58%] [-11.88dB] [on]
  Front Right: Playback 88 [58%] [-11.88dB] [on]
Simple mixer control 'Mic',0
  Capabilities: pvolume pvolume-joined cvolume cvolume-joined pswitch pswitch-joined cswitch cswitch-joined penum
  Playback channels: Mono
  Capture channels: Mono
  Limits: Playback 0 - 32 Capture 0 - 16
  Mono: Playback 0 [0%] [0.00dB] [off] Capture 7 [44%] [10.41dB] [on]
Simple mixer control 'Auto Gain Control',0
  Capabilities: pswitch pswitch-joined penum
  Playback channels: Mono
  Mono: Playback [on]


!!Alsactl output
!!--------------

--startcollapse--
state.Intel {
	control.1 {
		iface MIXER
		name 'Front Playback Volume'
		value.0 127
		value.1 127
		comment {
			access 'read write'
			type INTEGER
			count 2
			range '0 - 127'
			dbmin -9525
			dbmax 0
			dbvalue.0 0
			dbvalue.1 0
		}
	}
	control.2 {
		iface MIXER
		name 'Front Playback Switch'
		value.0 true
		value.1 true
		comment {
			access 'read write'
			type BOOLEAN
			count 2
		}
	}
	control.3 {
		iface MIXER
		name 'Surround Playback Volume'
		value.0 127
		value.1 127
		comment {
			access 'read write'
			type INTEGER
			count 2
			range '0 - 127'
			dbmin -9525
			dbmax 0
			dbvalue.0 0
			dbvalue.1 0
		}
	}
	control.4 {
		iface MIXER
		name 'Surround Playback Switch'
		value.0 true
		value.1 true
		comment {
			access 'read write'
			type BOOLEAN
			count 2
		}
	}
	control.5 {
		iface MIXER
		name 'Center Playback Volume'
		value 127
		comment {
			access 'read write'
			type INTEGER
			count 1
			range '0 - 127'
			dbmin -9525
			dbmax 0
			dbvalue.0 0
		}
	}
	control.6 {
		iface MIXER
		name 'LFE Playback Volume'
		value 127
		comment {
			access 'read write'
			type INTEGER
			count 1
			range '0 - 127'
			dbmin -9525
			dbmax 0
			dbvalue.0 0
		}
	}
	control.7 {
		iface MIXER
		name 'Center Playback Switch'
		value true
		comment {
			access 'read write'
			type BOOLEAN
			count 1
		}
	}
	control.8 {
		iface MIXER
		name 'LFE Playback Switch'
		value true
		comment {
			access 'read write'
			type BOOLEAN
			count 1
		}
	}
	control.9 {
		iface MIXER
		name 'Loopback Mixing'
		value Disabled
		comment {
			access 'read write'
			type ENUMERATED
			count 1
			item.0 Disabled
			item.1 Enabled
		}
	}
	control.10 {
		iface MIXER
		name 'Rear Mic Playback Volume'
		value.0 0
		value.1 0
		comment {
			access 'read write'
			type INTEGER
			count 2
			range '0 - 31'
			dbmin -3450
			dbmax 1200
			dbvalue.0 -3450
			dbvalue.1 -3450
		}
	}
	control.11 {
		iface MIXER
		name 'Rear Mic Playback Switch'
		value.0 false
		value.1 false
		comment {
			access 'read write'
			type BOOLEAN
			count 2
		}
	}
	control.12 {
		iface MIXER
		name 'Front Mic Playback Volume'
		value.0 0
		value.1 0
		comment {
			access 'read write'
			type INTEGER
			count 2
			range '0 - 31'
			dbmin -3450
			dbmax 1200
			dbvalue.0 -3450
			dbvalue.1 -3450
		}
	}
	control.13 {
		iface MIXER
		name 'Front Mic Playback Switch'
		value.0 false
		value.1 false
		comment {
			access 'read write'
			type BOOLEAN
			count 2
		}
	}
	control.14 {
		iface MIXER
		name 'Line Playback Volume'
		value.0 0
		value.1 0
		comment {
			access 'read write'
			type INTEGER
			count 2
			range '0 - 31'
			dbmin -3450
			dbmax 1200
			dbvalue.0 -3450
			dbvalue.1 -3450
		}
	}
	control.15 {
		iface MIXER
		name 'Line Playback Switch'
		value.0 false
		value.1 false
		comment {
			access 'read write'
			type BOOLEAN
			count 2
		}
	}
	control.16 {
		iface MIXER
		name 'CD Playback Volume'
		value.0 0
		value.1 0
		comment {
			access 'read write'
			type INTEGER
			count 2
			range '0 - 31'
			dbmin -3450
			dbmax 1200
			dbvalue.0 -3450
			dbvalue.1 -3450
		}
	}
	control.17 {
		iface MIXER
		name 'CD Playback Switch'
		value.0 false
		value.1 false
		comment {
			access 'read write'
			type BOOLEAN
			count 2
		}
	}
	control.18 {
		iface MIXER
		name 'Input Source'
		value 'Front Mic'
		comment {
			access 'read write'
			type ENUMERATED
			count 1
			item.0 'Internal Mic'
			item.1 'Rear Mic'
			item.2 'Front Mic'
			item.3 'Internal Mic 1'
			item.4 Line
			item.5 CD
		}
	}
	control.19 {
		iface MIXER
		name 'Input Source'
		index 1
		value 'Front Mic'
		comment {
			access 'read write'
			type ENUMERATED
			count 1
			item.0 'Internal Mic'
			item.1 'Rear Mic'
			item.2 'Front Mic'
			item.3 'Internal Mic 1'
			item.4 Line
			item.5 CD
		}
	}
	control.20 {
		iface MIXER
		name 'Capture Volume'
		value.0 15
		value.1 15
		comment {
			access 'read write'
			type INTEGER
			count 2
			range '0 - 15'
			dbmin 0
			dbmax 2250
			dbvalue.0 2250
			dbvalue.1 2250
		}
	}
	control.21 {
		iface MIXER
		name 'Capture Switch'
		value.0 true
		value.1 true
		comment {
			access 'read write'
			type BOOLEAN
			count 2
		}
	}
	control.22 {
		iface MIXER
		name 'Capture Volume'
		index 1
		value.0 0
		value.1 0
		comment {
			access 'read write'
			type INTEGER
			count 2
			range '0 - 15'
			dbmin 0
			dbmax 2250
			dbvalue.0 0
			dbvalue.1 0
		}
	}
	control.23 {
		iface MIXER
		name 'Capture Switch'
		index 1
		value.0 false
		value.1 false
		comment {
			access 'read write'
			type BOOLEAN
			count 2
		}
	}
	control.24 {
		iface MIXER
		name 'Internal Mic Boost Volume'
		value.0 0
		value.1 0
		comment {
			access 'read write'
			type INTEGER
			count 2
			range '0 - 3'
			dbmin 0
			dbmax 3000
			dbvalue.0 0
			dbvalue.1 0
		}
	}
	control.25 {
		iface MIXER
		name 'Rear Mic Boost Volume'
		value.0 0
		value.1 0
		comment {
			access 'read write'
			type INTEGER
			count 2
			range '0 - 3'
			dbmin 0
			dbmax 3000
			dbvalue.0 0
			dbvalue.1 0
		}
	}
	control.26 {
		iface MIXER
		name 'Front Mic Boost Volume'
		value.0 0
		value.1 0
		comment {
			access 'read write'
			type INTEGER
			count 2
			range '0 - 3'
			dbmin 0
			dbmax 3000
			dbvalue.0 0
			dbvalue.1 0
		}
	}
	control.27 {
		iface MIXER
		name 'Internal Mic Boost Volume'
		index 1
		value.0 0
		value.1 0
		comment {
			access 'read write'
			type INTEGER
			count 2
			range '0 - 3'
			dbmin 0
			dbmax 3000
			dbvalue.0 0
			dbvalue.1 0
		}
	}
	control.28 {
		iface MIXER
		name 'Line Boost Volume'
		value.0 0
		value.1 0
		comment {
			access 'read write'
			type INTEGER
			count 2
			range '0 - 3'
			dbmin 0
			dbmax 3000
			dbvalue.0 0
			dbvalue.1 0
		}
	}
	control.29 {
		iface MIXER
		name 'Beep Playback Switch'
		value false
		comment {
			access 'read write'
			type BOOLEAN
			count 1
		}
	}
	control.30 {
		iface MIXER
		name 'Beep Playback Volume'
		value 0
		comment {
			access 'read write'
			type INTEGER
			count 1
			range '0 - 3'
			dbmin -1800
			dbmax 0
			dbvalue.0 -1800
		}
	}
	control.31 {
		iface MIXER
		name 'IEC958 Playback Source'
		value 'Digital Playback'
		comment {
			access 'read write'
			type ENUMERATED
			count 1
			item.0 'Digital Playback'
			item.1 'Analog Mux 1'
			item.2 'Analog Mux 2'
		}
	}
	control.32 {
		iface MIXER
		name 'IEC958 Playback Source'
		index 1
		value 'Digital Playback'
		comment {
			access 'read write'
			type ENUMERATED
			count 1
			item.0 'Digital Playback'
			item.1 'Analog Mux 1'
			item.2 'Analog Mux 2'
		}
	}
	control.33 {
		iface MIXER
		name 'IEC958 Playback Con Mask'
		index 16
		value '0fff000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000'
		comment {
			access read
			type IEC958
			count 1
		}
	}
	control.34 {
		iface MIXER
		name 'IEC958 Playback Pro Mask'
		index 16
		value '0f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000'
		comment {
			access read
			type IEC958
			count 1
		}
	}
	control.35 {
		iface MIXER
		name 'IEC958 Playback Default'
		index 16
		value '0400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000'
		comment {
			access 'read write'
			type IEC958
			count 1
		}
	}
	control.36 {
		iface MIXER
		name 'IEC958 Playback Switch'
		index 16
		value false
		comment {
			access 'read write'
			type BOOLEAN
			count 1
		}
	}
	control.37 {
		iface MIXER
		name 'IEC958 Default PCM Playback Switch'
		value true
		comment {
			access 'read write'
			type BOOLEAN
			count 1
		}
	}
	control.38 {
		iface MIXER
		name 'IEC958 Capture Switch'
		value false
		comment {
			access 'read write'
			type BOOLEAN
			count 1
		}
	}
	control.39 {
		iface MIXER
		name 'IEC958 Capture Default'
		value '0400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000'
		comment {
			access read
			type IEC958
			count 1
		}
	}
	control.40 {
		iface MIXER
		name 'Master Playback Volume'
		value 102
		comment {
			access 'read write'
			type INTEGER
			count 1
			range '0 - 127'
			dbmin -9999999
			dbmax 0
			dbvalue.0 -1875
		}
	}
	control.41 {
		iface MIXER
		name 'Master Playback Switch'
		value true
		comment {
			access 'read write'
			type BOOLEAN
			count 1
		}
	}
	control.42 {
		iface CARD
		name 'Internal Mic Phantom Jack'
		value true
		comment {
			access read
			type BOOLEAN
			count 1
		}
	}
	control.43 {
		iface CARD
		name 'Rear Mic Phantom Jack'
		value true
		comment {
			access read
			type BOOLEAN
			count 1
		}
	}
	control.44 {
		iface CARD
		name 'Front Mic Phantom Jack'
		value true
		comment {
			access read
			type BOOLEAN
			count 1
		}
	}
	control.45 {
		iface CARD
		name 'Internal Mic Phantom Jack'
		index 1
		value true
		comment {
			access read
			type BOOLEAN
			count 1
		}
	}
	control.46 {
		iface CARD
		name 'Line Phantom Jack'
		value true
		comment {
			access read
			type BOOLEAN
			count 1
		}
	}
	control.47 {
		iface CARD
		name 'CD Phantom Jack'
		value true
		comment {
			access read
			type BOOLEAN
			count 1
		}
	}
	control.48 {
		iface CARD
		name 'Line Out Front Phantom Jack'
		value true
		comment {
			access read
			type BOOLEAN
			count 1
		}
	}
	control.49 {
		iface CARD
		name 'Line Out Surround Phantom Jack'
		value true
		comment {
			access read
			type BOOLEAN
			count 1
		}
	}
	control.50 {
		iface CARD
		name 'Line Out CLFE Phantom Jack'
		value true
		comment {
			access read
			type BOOLEAN
			count 1
		}
	}
	control.51 {
		iface CARD
		name 'Front Headphone Phantom Jack'
		value true
		comment {
			access read
			type BOOLEAN
			count 1
		}
	}
	control.52 {
		iface CARD
		name 'SPDIF Phantom Jack'
		value true
		comment {
			access read
			type BOOLEAN
			count 1
		}
	}
	control.53 {
		iface CARD
		name 'HDMI Phantom Jack'
		value true
		comment {
			access read
			type BOOLEAN
			count 1
		}
	}
	control.54 {
		iface CARD
		name 'SPDIF In Phantom Jack'
		value true
		comment {
			access read
			type BOOLEAN
			count 1
		}
	}
	control.55 {
		iface PCM
		name 'Playback Channel Map'
		value.0 0
		value.1 0
		value.2 0
		value.3 0
		value.4 0
		value.5 0
		comment {
			access read
			type INTEGER
			count 6
			range '0 - 36'
		}
	}
	control.56 {
		iface PCM
		name 'Capture Channel Map'
		value.0 0
		value.1 0
		comment {
			access read
			type INTEGER
			count 2
			range '0 - 36'
		}
	}
	control.57 {
		iface PCM
		device 1
		name 'Playback Channel Map'
		value.0 0
		value.1 0
		comment {
			access read
			type INTEGER
			count 2
			range '0 - 36'
		}
	}
	control.58 {
		iface PCM
		device 1
		name 'Capture Channel Map'
		value.0 0
		value.1 0
		comment {
			access read
			type INTEGER
			count 2
			range '0 - 36'
		}
	}
	control.59 {
		iface PCM
		device 2
		name 'Capture Channel Map'
		value.0 0
		value.1 0
		comment {
			access read
			type INTEGER
			count 2
			range '0 - 36'
		}
	}
	control.60 {
		iface CARD
		name 'HDMI/DP,pcm=3 Jack'
		value true
		comment {
			access read
			type BOOLEAN
			count 1
		}
	}
	control.61 {
		iface MIXER
		name 'IEC958 Playback Con Mask'
		value '0fff000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000'
		comment {
			access read
			type IEC958
			count 1
		}
	}
	control.62 {
		iface MIXER
		name 'IEC958 Playback Pro Mask'
		value '0f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000'
		comment {
			access read
			type IEC958
			count 1
		}
	}
	control.63 {
		iface MIXER
		name 'IEC958 Playback Default'
		value '0400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000'
		comment {
			access 'read write'
			type IEC958
			count 1
		}
	}
	control.64 {
		iface MIXER
		name 'IEC958 Playback Switch'
		value true
		comment {
			access 'read write'
			type BOOLEAN
			count 1
		}
	}
	control.65 {
		iface PCM
		device 3
		name ELD
		value '10000600601200010000000000000000158f00460907070000000000000000000000000000000000000000000000000000000000000000000000000000000000'
		comment {
			access 'read volatile'
			type BYTES
			count 64
		}
	}
	control.66 {
		iface PCM
		device 3
		name 'Playback Channel Map'
		value.0 0
		value.1 0
		value.2 0
		value.3 0
		value.4 0
		value.5 0
		value.6 0
		value.7 0
		comment {
			access 'read write'
			type INTEGER
			count 8
			range '0 - 36'
		}
	}
	control.67 {
		iface MIXER
		name 'PCM Playback Volume'
		value.0 255
		value.1 255
		comment {
			access 'read write user'
			type INTEGER
			count 2
			range '0 - 255'
			tlv '0000000100000008ffffec1400000014'
			dbmin -5100
			dbmax 0
			dbvalue.0 0
			dbvalue.1 0
		}
	}
}
state.U0xd8c0x0c {
	control.1 {
		iface PCM
		name 'Playback Channel Map'
		value.0 0
		value.1 0
		comment {
			access read
			type INTEGER
			count 2
			range '0 - 36'
		}
	}
	control.2 {
		iface PCM
		name 'Capture Channel Map'
		value 0
		comment {
			access read
			type INTEGER
			count 1
			range '0 - 36'
		}
	}
	control.3 {
		iface MIXER
		name 'Mic Playback Switch'
		value false
		comment {
			access 'read write'
			type BOOLEAN
			count 1
		}
	}
	control.4 {
		iface MIXER
		name 'Mic Playback Volume'
		value 0
		comment {
			access 'read write'
			type INTEGER
			count 1
			range '0 - 32'
			dbmin 0
			dbmax 4781
			dbvalue.0 0
		}
	}
	control.5 {
		iface MIXER
		name 'Speaker Playback Switch'
		value true
		comment {
			access 'read write'
			type BOOLEAN
			count 1
		}
	}
	control.6 {
		iface MIXER
		name 'Speaker Playback Volume'
		value.0 88
		value.1 88
		comment {
			access 'read write'
			type INTEGER
			count 2
			range '0 - 151'
			dbmin -2837
			dbmax -6
			dbvalue.0 -1188
			dbvalue.1 -1188
		}
	}
	control.7 {
		iface MIXER
		name 'Mic Capture Switch'
		value true
		comment {
			access 'read write'
			type BOOLEAN
			count 1
		}
	}
	control.8 {
		iface MIXER
		name 'Mic Capture Volume'
		value 7
		comment {
			access 'read write'
			type INTEGER
			count 1
			range '0 - 16'
			dbmin 0
			dbmax 2381
			dbvalue.0 1041
		}
	}
	control.9 {
		iface MIXER
		name 'Auto Gain Control'
		value true
		comment {
			access 'read write'
			type BOOLEAN
			count 1
		}
	}
}
--endcollapse--


!!All Loaded Modules
!!------------------

Module
iTCO_wdt
iTCO_vendor_support
af_packet
lirc_serial
nf_conntrack_ipv4
nf_defrag_ipv4
xt_recent
xt_state
cpufreq_powersave
cpufreq_ondemand
nf_conntrack
cpufreq_userspace
xt_tcpudp
cpufreq_stats
iptable_filter
cpufreq_conservative
ip_tables
x_tables
snd_hda_intel
uinput
gpio_ich
snd_hda_codec_hdmi
snd_hda_codec_idt
snd_hda_codec_generic
snd_hda_controller
snd_usb_audio
snd_hda_codec
snd_usbmidi_lib
snd_hwdep
snd_pcm_oss
snd_mixer_oss
snd_pcm
snd_seq_oss
arc4
snd_seq_midi
snd_seq_midi_event
rt2800pci
rt2800mmio
snd_rawmidi
rt2800lib
rt2x00pci
rt2x00mmio
rt2x00lib
psmouse
snd_seq
serio_raw
mac80211
snd_seq_device
snd_timer
ecb
btusb
lpc_ich
snd
cfg80211
eeprom_93cx6
crc_ccitt
ehci_pci
soundcore
ehci_hcd
fbcon
bitblit
softcursor
font
tileblit
ir_xmp_decoder
ir_lirc_codec
lirc_dev
ir_mce_kbd_decoder
ir_sharp_decoder
ir_sanyo_decoder
ir_sony_decoder
ir_jvc_decoder
ir_rc6_decoder
ir_rc5_decoder
ir_nec_decoder
rc_rc6_mce
ite_cir
rtc_cmos
rc_core
parport_pc
ppdev
lp
parport
intel_agp
evdev
processor
rfcomm
bnep
bluetooth
rfkill
crc16
usblp
lm63
ipv6
sbs
sbshc
coretemp
i2c_dev
hwmon_vid
nfsd
auth_rpcgss
nfs_acl
nfs
lockd
sunrpc
fscache
ext3
mbcache
jbd
sd_mod
crc_t10dif
crct10dif_common
hid_generic
usbhid
hid
microcode
ahci
libahci
libata
uhci_hcd
scsi_mod
e1000e
ptp
pps_core
usbcore
usb_common
i915
button
intel_gtt
i2c_algo_bit
video
drm_kms_helper
drm
agpgart
thermal_sys
squashfs


!!Sysfs Files
!!-----------

/sys/class/sound/hwC0D0/init_pin_configs:
0x0a 0x0221401f
0x0b 0x02a19040
0x0c 0x01813021
0x0d 0x01014010
0x0e 0x01a19020
0x0f 0x01011012
0x10 0x01016011
0x11 0x41f120f0
0x12 0x9933012e
0x13 0x90a30070
0x14 0x90a3007e
0x22 0x01451050
0x23 0x98560060
0x24 0x01c52080

/sys/class/sound/hwC0D0/driver_pin_configs:

/sys/class/sound/hwC0D0/user_pin_configs:

/sys/class/sound/hwC0D0/init_verbs:

/sys/class/sound/hwC0D0/hints:

/sys/class/sound/hwC0D3/init_pin_configs:
0x03 0x18560010

/sys/class/sound/hwC0D3/driver_pin_configs:

/sys/class/sound/hwC0D3/user_pin_configs:

/sys/class/sound/hwC0D3/init_verbs:

/sys/class/sound/hwC0D3/hints:


!!ALSA/HDA dmesg
!!--------------

[   13.857735] ieee80211 phy0: Selected rate control algorithm 'minstrel_ht'
[   14.332086] usbcore: registered new interface driver snd-usb-audio
[   14.340085] usb 2-1: new low-speed USB device number 3 using uhci_hcd
[   14.365351] snd_hda_intel 0000:00:1b.0: irq 29 for MSI/MSI-X
[   14.425022] sound hdaudioC0D0: autoconfig: line_outs=3 (0xd/0xf/0x10/0x0/0x0) type:line
[   14.425030] sound hdaudioC0D0:    speaker_outs=0 (0x0/0x0/0x0/0x0/0x0)
[   14.425035] sound hdaudioC0D0:    hp_outs=1 (0xa/0x0/0x0/0x0/0x0)
[   14.425038] sound hdaudioC0D0:    mono: mono_out=0x0
[   14.425042] sound hdaudioC0D0:    dig-out=0x22/0x23
[   14.425045] sound hdaudioC0D0:    inputs:
[   14.425050] sound hdaudioC0D0:      Internal Mic=0x14
[   14.425054] sound hdaudioC0D0:      Rear Mic=0xe
[   14.425058] sound hdaudioC0D0:      Front Mic=0xb
[   14.425062] sound hdaudioC0D0:      Internal Mic=0x13
[   14.425067] sound hdaudioC0D0:      Line=0xc
[   14.425070] sound hdaudioC0D0:      CD=0x12
[   14.425074] sound hdaudioC0D0:    dig-in=0x24
[   14.513403] usb 2-1: New USB device found, idVendor=13ba, idProduct=0017
--
[   14.513415] usb 2-1: Product: Generic USB K/B
[   14.525804] input: HDA Digital PCBeep as /devices/pci0000:00/0000:00:1b.0/sound/card0/hdaudioC0D0/input11
[   14.533329] input: Generic USB K/B as /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1:1.0/0003:13BA:0017.0004/input/input13
[   14.533679] hid-generic 0003:13BA:0017.0004: input,hidraw0: USB HID v1.10 Keyboard [Generic USB K/B] on usb-0000:00:1d.0-1/input0
[   14.539250] input: HDA Intel HDMI/DP,pcm=3 as /devices/pci0000:00/0000:00:1b.0/sound/card0/input12
[   14.552436] input: Generic USB K/B as /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1:1.1/0003:13BA:0017.0005/input/input14
--
[   18.297257] cfg80211:   (5735000 KHz - 5835000 KHz @ 40000 KHz), (300 mBi, 2000 mBm), (N/A)
[   18.950740] snd_hda_intel 0000:00:1b.0: irq 29 for MSI/MSI-X
[   18.965678] sound hdaudioC0D0: autoconfig: line_outs=3 (0xd/0xf/0x10/0x0/0x0) type:line
[   18.965687] sound hdaudioC0D0:    speaker_outs=0 (0x0/0x0/0x0/0x0/0x0)
[   18.965692] sound hdaudioC0D0:    hp_outs=1 (0xa/0x0/0x0/0x0/0x0)
[   18.965695] sound hdaudioC0D0:    mono: mono_out=0x0
[   18.965699] sound hdaudioC0D0:    dig-out=0x22/0x23
[   18.965702] sound hdaudioC0D0:    inputs:
[   18.965707] sound hdaudioC0D0:      Internal Mic=0x14
[   18.965711] sound hdaudioC0D0:      Rear Mic=0xe
[   18.965716] sound hdaudioC0D0:      Front Mic=0xb
[   18.965720] sound hdaudioC0D0:      Internal Mic=0x13
[   18.965723] sound hdaudioC0D0:      Line=0xc
[   18.965727] sound hdaudioC0D0:      CD=0x12
[   18.965731] sound hdaudioC0D0:    dig-in=0x24
[   19.003722] init: alsa-restore main process (2563) terminated with status 99
[   19.084090] input: HDA Digital PCBeep as /devices/pci0000:00/0000:00:1b.0/sound/card0/hdaudioC0D0/input16
[   19.092235] input: HDA Intel HDMI/DP,pcm=3 as /devices/pci0000:00/0000:00:1b.0/sound/card0/input17
[   19.703024] ip_tables: (C) 2000-2006 Netfilter Core Team
--
[   21.232925] pipe state doesn't match!
[   21.232927] Modules linked in: lirc_serial(C) nf_conntrack_ipv4 nf_defrag_ipv4 xt_recent xt_state cpufreq_powersave cpufreq_ondemand nf_conntrack cpufreq_userspace xt_tcpudp cpufreq_stats iptable_filter cpufreq_conservative ip_tables x_tables snd_hda_intel uinput gpio_ich snd_hda_codec_hdmi snd_hda_codec_idt snd_hda_codec_generic snd_hda_controller snd_usb_audio snd_hda_codec snd_usbmidi_lib snd_hwdep snd_pcm_oss snd_mixer_oss snd_pcm snd_seq_oss arc4 snd_seq_midi snd_seq_midi_event rt2800pci rt2800mmio snd_rawmidi rt2800lib rt2x00pci rt2x00mmio rt2x00lib psmouse snd_seq serio_raw mac80211 snd_seq_device snd_timer ecb btusb lpc_ich snd cfg80211 eeprom_93cx6 crc_ccitt ehci_pci soundcore ehci_hcd fbcon bitblit softcursor font tileblit ir_xmp_decoder ir_lirc_codec lirc_dev ir_mce_kbd_decoder ir_sharp_decoder ir_sanyo_decoder ir_sony_decoder ir_jvc_decoder ir_rc6_decoder ir_rc5_decoder ir_nec_decoder rc_rc6_mce ite_cir rtc_cmos rc_core parport_pc ppdev lp parport intel_agp evdev processor rfcomm bnep bluetooth rfkill crc16 usblp lm63 ipv6 sbs sbshc coretemp i2c_dev hwmon_vid nfsd auth_rpcgss nfs_acl nfs lockd sunrpc fscache ext3 mbcache jbd sd_mod crc_t10dif crct10dif_common hid_generic usbhid hid microcode ahci libahci libata uhci_hcd scsi_mod e1000e ptp pps_core usbcore usb_common i915 button intel_gtt i2c_algo_bit video drm_kms_helper drm agpgart thermal_sys squashfs [last unloaded: snd_hda_intel]
[   21.233046] CPU: 0 PID: 2836 Comm: Xorg Tainted: G        WC     3.17.0-rc4-64bit #1
--
[   23.168031] pipe state doesn't match!
[   23.168034] Modules linked in: lirc_serial(C) nf_conntrack_ipv4 nf_defrag_ipv4 xt_recent xt_state cpufreq_powersave cpufreq_ondemand nf_conntrack cpufreq_userspace xt_tcpudp cpufreq_stats iptable_filter cpufreq_conservative ip_tables x_tables snd_hda_intel uinput gpio_ich snd_hda_codec_hdmi snd_hda_codec_idt snd_hda_codec_generic snd_hda_controller snd_usb_audio snd_hda_codec snd_usbmidi_lib snd_hwdep snd_pcm_oss snd_mixer_oss snd_pcm snd_seq_oss arc4 snd_seq_midi snd_seq_midi_event rt2800pci rt2800mmio snd_rawmidi rt2800lib rt2x00pci rt2x00mmio rt2x00lib psmouse snd_seq serio_raw mac80211 snd_seq_device snd_timer ecb btusb lpc_ich snd cfg80211 eeprom_93cx6 crc_ccitt ehci_pci soundcore ehci_hcd fbcon bitblit softcursor font tileblit ir_xmp_decoder ir_lirc_codec lirc_dev ir_mce_kbd_decoder ir_sharp_decoder ir_sanyo_decoder ir_sony_decoder ir_jvc_decoder ir_rc6_decoder ir_rc5_decoder ir_nec_decoder rc_rc6_mce ite_cir rtc_cmos rc_core parport_pc ppdev lp parport intel_agp evdev processor rfcomm bnep bluetooth rfkill crc16 usblp lm63 ipv6 sbs sbshc coretemp i2c_dev hwmon_vid nfsd auth_rpcgss nfs_acl nfs lockd sunrpc fscache ext3 mbcache jbd sd_mod crc_t10dif crct10dif_common hid_generic usbhid hid microcode ahci libahci libata uhci_hcd scsi_mod e1000e ptp pps_core usbcore usb_common i915 button intel_gtt i2c_algo_bit video drm_kms_helper drm agpgart thermal_sys squashfs [last unloaded: snd_hda_intel]
[   23.168154] CPU: 0 PID: 2836 Comm: Xorg Tainted: G        WC     3.17.0-rc4-64bit #1



[-- Attachment #3: Type: text/plain, Size: 0 bytes --]



^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: Possible fix for snd-hda-intel model=no-jd failing since ~linux-3.9-rc1
  2014-07-09 23:07 adam richter
  2014-09-11  3:48 ` adam richter
  2014-09-11  7:17 ` Takashi Iwai
@ 2014-09-11  7:22 ` Adam Richter
  2 siblings, 0 replies; 21+ messages in thread
From: Adam Richter @ 2014-09-11  7:22 UTC (permalink / raw)
  To: linux-sound

Thank you, Takashi.  I will do that.  -Adam

On Thu, Sep 11, 2014 at 12:17 AM, Takashi Iwai <tiwai@suse.de> wrote:
> At Wed, 10 Sep 2014 20:48:26 -0700,
> adam richter wrote:
>>
>> Hello, Jaroslav and Takashi.
>>
>> Could you please tell me what I need to do to get this one line change
>> interegrated so that it will make its way to the mailing kernel?
>
> You're sending to a wrong list.  Please post to alsa-devel ML instead.
>
>
> Takashi

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: Possible fix for snd-hda-intel model=no-jd failing since ~linux-3.9-rc1
  2014-07-09 23:07 adam richter
  2014-09-11  3:48 ` adam richter
@ 2014-09-11  7:17 ` Takashi Iwai
  2014-09-11  7:22 ` Adam Richter
  2 siblings, 0 replies; 21+ messages in thread
From: Takashi Iwai @ 2014-09-11  7:17 UTC (permalink / raw)
  To: linux-sound

At Wed, 10 Sep 2014 20:48:26 -0700,
adam richter wrote:
> 
> Hello, Jaroslav and Takashi.
> 
> Could you please tell me what I need to do to get this one line change
> interegrated so that it will make its way to the mailing kernel?

You're sending to a wrong list.  Please post to alsa-devel ML instead.


Takashi

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: Possible fix for snd-hda-intel model=no-jd failing since ~linux-3.9-rc1
  2014-07-09 23:07 adam richter
@ 2014-09-11  3:48 ` adam richter
  2014-09-11  7:17 ` Takashi Iwai
  2014-09-11  7:22 ` Adam Richter
  2 siblings, 0 replies; 21+ messages in thread
From: adam richter @ 2014-09-11  3:48 UTC (permalink / raw)
  To: linux-sound

[-- Attachment #1: Type: text/plain, Size: 4371 bytes --]

Hello, Jaroslav and Takashi.

Could you please tell me what I need to do to get this one line change
interegrated so that it will make its way to the mailing kernel?

I apologize if I was unclear in my previous message that I do want to
see this patch integrated now until someone develops a better
solution.

This bug is a regression that began around Linux 3.9-rc1.  I described
it and a one line fix over two months ago on the linux-sound mailing
list.  I have just verified that the bug and the fix are still
applicable to newly released Linux 3.17.0-rc4, and that this change is
not already in git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound.git
or git://git.alsa-project.org/alsa-kernel.git .

For your convenience, I have included an attachment for this one line
patch against linux-3.17.0-rc4, although it is also shown in the text
below.

What do I need to do to get this fix on its way to upstream or get a
rejection with some kind of explanation (for example, maybe a better
fix is already in a git tree and will soon be sent to mainline)?

Thanks in advance for your attention to this, and, of course, thanks
for all of your contributions to Linux.

Adam Richter

On Wed, Jul 9, 2014 at 4:07 PM, adam richter <adamrichter4@gmail.com> wrote:
> Hi.
>
> Please feel free to redirect me to another email address.  I did not
> notice any contact information for sound/pci/hda in
> linux-3.16-rc4/MAINATINERS.
>
> The "model=no-jd" argument has not initialized correctly for me for
> linux-3.9-rc1 (if I recall correctly) through linux-3.16-rc4, although
> I have not tried every release candidate in between.
>
> The symptom is that, on a computer with an analog audio output jack
> that usually does not correctly sense a device is plugged in, audio
> output is completely muted until I physically replug the cable, even
> though I specified "model=no-jd" as an argument to the snd-hda-intel
> kernel module, which is supposed to cause the kernel to ignore the
> jack sense reported by hardware and just drive the audio output even
> if the hardware jack sense indicates nothing is plugged in.
>
> I have found a few single line workarounds that work, of which my
> favorite is the following (also attached to this email, in case any
> mailer subjects this message to reformatting), because it does not add
> code to anything that gets called frequently.
>
> --- linux-3.16.0-rc4-64bit/sound/pci/hda/hda_jack.c.orig    2014-07-08 15:34
> :36.567535340 -0700
> +++ linux-3.16.0-rc4-64bit/sound/
> pci/hda/hda_jack.c    2014-07-08 15:35:05.1715
> 34923 -0700
> @@ -106,6 +106,7 @@ snd_hda_jack_tbl_new(struct hda_codec *c
>     jack->nid = nid;
>     jack->jack_dirty = 1;
>     jack->tag = codec->jacktbl.used;
> +    jack->phantom_jack = codec->no_jack_detect;
>     return jack;
> }
> EXPORT_SYMBOL_GPL(snd_hda_jack_tbl_new);
>
>
> Signed-off-by: Adam J. Richter <adam_richter2004@yahoo.com>
>
>
> I consider this a workaround rather than than a perfect fix, because I
> think the underlying problem seems to be some kind of initialization
> order issue that I don't fully understand.  Basically, by the time
> jack->phantom_jack was being set, some caller had already called
> jack_detect_update(), which loaded the incorrect jack sense result
> from hardware and cleared jack->jack_dirty, so the jack sense would
> not be set again.  At least that is what I think the underlying
> problem probably is.
>
> Also, if a change like this is to be integrated, I'd like to know if
> it might be better for the line that I added to be:
>
>           jack->phantom_jack = !is_jack_detectable(codec, nid);
>
> ...which is what add_jack_kctl does (not sure why add_jack_kctls does
> not, by the way, at the risk of making a spectacle of my ignorance).
> My doubt about this approach is that perhaps is_jack_detectable()
> relies on some initialization that has not occurred at that point.
>
> Anyhow, I'd like to get the process started of either pushing this
> change upstream or quickly developing a more correct fix.  If a more
> correct fix does not become apparent in the next few days, I would
> recommend pushing the workaround upstream now until some future code
> cleanup, so people will no longer be effected by the bug.
>
> Any technical input or advice on how to proceed is welcome.  Thanks
> for taking the time to consider this.
>
> Adam Richter

[-- Attachment #2: jack.diff --]
[-- Type: text/plain, Size: 426 bytes --]

--- linux-3.17.0-rc4-64bit/sound/pci/hda/hda_jack.c.orig	2014-09-07 16:09:43.000000000 -0700
+++ linux-3.17.0-rc4-64bit/sound/pci/hda/hda_jack.c	2014-09-10 18:41:53.422900040 -0700
@@ -106,6 +106,7 @@ snd_hda_jack_tbl_new(struct hda_codec *c
 	jack->nid = nid;
 	jack->jack_dirty = 1;
 	jack->tag = codec->jacktbl.used;
+	jack->phantom_jack = codec->no_jack_detect;
 	return jack;
 }
 EXPORT_SYMBOL_GPL(snd_hda_jack_tbl_new);

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Possible fix for snd-hda-intel model=no-jd failing since ~linux-3.9-rc1
@ 2014-07-09 23:07 adam richter
  2014-09-11  3:48 ` adam richter
                   ` (2 more replies)
  0 siblings, 3 replies; 21+ messages in thread
From: adam richter @ 2014-07-09 23:07 UTC (permalink / raw)
  To: linux-sound

[-- Attachment #1: Type: text/plain, Size: 2983 bytes --]

Hi.

Please feel free to redirect me to another email address.  I did not
notice any contact information for sound/pci/hda in
linux-3.16-rc4/MAINATINERS.

The "model=no-jd" argument has not initialized correctly for me for
linux-3.9-rc1 (if I recall correctly) through linux-3.16-rc4, although
I have not tried every release candidate in between.

The symptom is that, on a computer with an analog audio output jack
that usually does not correctly sense a device is plugged in, audio
output is completely muted until I physically replug the cable, even
though I specified "model=no-jd" as an argument to the snd-hda-intel
kernel module, which is supposed to cause the kernel to ignore the
jack sense reported by hardware and just drive the audio output even
if the hardware jack sense indicates nothing is plugged in.

I have found a few single line workarounds that work, of which my
favorite is the following (also attached to this email, in case any
mailer subjects this message to reformatting), because it does not add
code to anything that gets called frequently.

--- linux-3.16.0-rc4-64bit/sound/pci/hda/hda_jack.c.orig    2014-07-08 15:34
:36.567535340 -0700
+++ linux-3.16.0-rc4-64bit/sound/
pci/hda/hda_jack.c    2014-07-08 15:35:05.1715
34923 -0700
@@ -106,6 +106,7 @@ snd_hda_jack_tbl_new(struct hda_codec *c
    jack->nid = nid;
    jack->jack_dirty = 1;
    jack->tag = codec->jacktbl.used;
+    jack->phantom_jack = codec->no_jack_detect;
    return jack;
}
EXPORT_SYMBOL_GPL(snd_hda_jack_tbl_new);


Signed-off-by: Adam J. Richter <adam_richter2004@yahoo.com>


I consider this a workaround rather than than a perfect fix, because I
think the underlying problem seems to be some kind of initialization
order issue that I don't fully understand.  Basically, by the time
jack->phantom_jack was being set, some caller had already called
jack_detect_update(), which loaded the incorrect jack sense result
from hardware and cleared jack->jack_dirty, so the jack sense would
not be set again.  At least that is what I think the underlying
problem probably is.

Also, if a change like this is to be integrated, I'd like to know if
it might be better for the line that I added to be:

          jack->phantom_jack = !is_jack_detectable(codec, nid);

...which is what add_jack_kctl does (not sure why add_jack_kctls does
not, by the way, at the risk of making a spectacle of my ignorance).
My doubt about this approach is that perhaps is_jack_detectable()
relies on some initialization that has not occurred at that point.

Anyhow, I'd like to get the process started of either pushing this
change upstream or quickly developing a more correct fix.  If a more
correct fix does not become apparent in the next few days, I would
recommend pushing the workaround upstream now until some future code
cleanup, so people will no longer be effected by the bug.

Any technical input or advice on how to proceed is welcome.  Thanks
for taking the time to consider this.

Adam Richter

[-- Attachment #2: no-jack-detect.diff --]
[-- Type: text/plain, Size: 426 bytes --]

--- linux-3.16.0-rc4-64bit/sound/pci/hda/hda_jack.c.orig	2014-07-08 15:34:36.567535340 -0700
+++ linux-3.16.0-rc4-64bit/sound/pci/hda/hda_jack.c	2014-07-08 15:35:05.171534923 -0700
@@ -106,6 +106,7 @@ snd_hda_jack_tbl_new(struct hda_codec *c
 	jack->nid = nid;
 	jack->jack_dirty = 1;
 	jack->tag = codec->jacktbl.used;
+	jack->phantom_jack = codec->no_jack_detect;
 	return jack;
 }
 EXPORT_SYMBOL_GPL(snd_hda_jack_tbl_new);

^ permalink raw reply	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2014-09-15  8:39 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-09-11  7:47 Possible fix for snd-hda-intel model=no-jd failing since ~linux-3.9-rc1 Adam Richter
2014-09-11  8:42 ` Takashi Iwai
2014-09-11  9:07 ` David Henningsson
2014-09-11  9:09   ` Takashi Iwai
2014-09-11  9:23   ` Takashi Iwai
2014-09-11  9:42     ` David Henningsson
2014-09-11 10:07       ` Takashi Iwai
2014-09-11 10:29         ` David Henningsson
2014-09-11 10:51           ` Takashi Iwai
2014-09-11 10:55         ` Takashi Iwai
2014-09-12  4:30           ` Adam Richter
2014-09-12  4:40             ` Adam Richter
2014-09-15  8:39             ` Takashi Iwai
  -- strict thread matches above, loose matches on Subject: below --
2014-09-11  9:32 Adam Richter
2014-09-11 11:48 ` Raymond Yau
2014-09-11 19:14   ` Adam Richter
2014-09-12  7:17     ` Raymond Yau
2014-07-09 23:07 adam richter
2014-09-11  3:48 ` adam richter
2014-09-11  7:17 ` Takashi Iwai
2014-09-11  7:22 ` Adam Richter

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.