linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sergei Trofimovich <slyich@gmail.com>
To: Takashi Iwai <tiwai@suse.de>
Cc: "Maciej Rutecki" <maciej.rutecki@gmail.com>,
	linux-kernel@vger.kernel.org,
	"Éric Piel" <eric.piel@tremplin-utc.net>
Subject: Re: intel hda regression: 2.6.33-rc{1,2}: hd-audio0 eats 25% CPU  (according to top)
Date: Fri, 25 Dec 2009 20:00:00 +0200	[thread overview]
Message-ID: <20091225200000.5730fb45@mosly> (raw)
In-Reply-To: <s5hvdfvyoef.wl%tiwai@suse.de>

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

On Fri, 25 Dec 2009 18:06:00 +0100
Takashi Iwai <tiwai@suse.de> wrote:

> At Fri, 25 Dec 2009 18:32:05 +0200,
> Sergei Trofimovich wrote:
> > 
> > On Fri, 25 Dec 2009 17:05:16 +0100
> > Takashi Iwai <tiwai@suse.de> wrote:
> > 
> > > It's a bit surprising that this resulted in the high CPU usage
> > > instead of erroneous behavior.  This should be rather a bug of
> > > codec chip...
> > > 
> > > Anyway, Segei, which codec is on your machine?  Is it Analog Device
> > > one? 
> > > IIRC, the one's on Maciej and Eric machines are AD codecs.
> > > If so, we can just revert the changes to patch_analog.c in that
> > > commit.
> > 
> > How can I check? alsamixer shows 
> >     Chip: Analog Devices AD1981
> > Not sure it's valid though.
> > 
> > It's a HP Compaq 2510p laptop.
> > 
> > 00:1b.0 Audio device: Intel Corporation 82801H (ICH8 Family) HD Audio Controller (rev 03)
> >         Subsystem: Hewlett-Packard Company Device 30c9
> > (posted whole lspci output slightly earlier if needed)
> 
> OK, they all seem to have AD codecs indeed.
> Instead of reverting, how about the patch below?

Fixed both CPU load and crackling sounds for me!
Thank You!

> ---
> diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c
> index 950ee5c..f98b47c 100644
> --- a/sound/pci/hda/hda_codec.c
> +++ b/sound/pci/hda/hda_codec.c
> @@ -1327,11 +1327,13 @@ EXPORT_SYMBOL_HDA(snd_hda_query_pin_caps);
>   */
>  u32 snd_hda_pin_sense(struct hda_codec *codec, hda_nid_t nid)
>  {
> -	u32 pincap = snd_hda_query_pin_caps(codec, nid);
> -
> -	if (pincap & AC_PINCAP_TRIG_REQ) /* need trigger? */
> -		snd_hda_codec_read(codec, nid, 0, AC_VERB_SET_PIN_SENSE, 0);
> +	u32 pincap;
>  
> +	if (!codec->no_trigger_sense) {
> +		pincap = snd_hda_query_pin_caps(codec, nid);
> +		if (pincap & AC_PINCAP_TRIG_REQ) /* need trigger? */
> +			snd_hda_codec_read(codec, nid, 0, AC_VERB_SET_PIN_SENSE, 0);
> +	}
>  	return snd_hda_codec_read(codec, nid, 0,
>  				  AC_VERB_GET_PIN_SENSE, 0);
>  }
> diff --git a/sound/pci/hda/hda_codec.h b/sound/pci/hda/hda_codec.h
> index 1d541b7..0a770a2 100644
> --- a/sound/pci/hda/hda_codec.h
> +++ b/sound/pci/hda/hda_codec.h
> @@ -817,6 +817,7 @@ struct hda_codec {
>  	unsigned int pin_amp_workaround:1; /* pin out-amp takes index
>  					    * (e.g. Conexant codecs)
>  					    */
> +	unsigned int no_trigger_sense:1; /* don't trigger at pin-sensing */
>  #ifdef CONFIG_SND_HDA_POWER_SAVE
>  	unsigned int power_on :1;	/* current (global) power-state */
>  	unsigned int power_transition :1; /* power-state in transition */
> diff --git a/sound/pci/hda/patch_analog.c b/sound/pci/hda/patch_analog.c
> index 1a36137..69a941c 100644
> --- a/sound/pci/hda/patch_analog.c
> +++ b/sound/pci/hda/patch_analog.c
> @@ -1186,6 +1186,8 @@ static int patch_ad1986a(struct hda_codec *codec)
>  	 */
>  	spec->multiout.no_share_stream = 1;
>  
> +	codec->no_trigger_sense = 1;
> +
>  	return 0;
>  }
>  
> @@ -1371,6 +1373,8 @@ static int patch_ad1983(struct hda_codec *codec)
>  
>  	codec->patch_ops = ad198x_patch_ops;
>  
> +	codec->no_trigger_sense = 1;
> +
>  	return 0;
>  }
>  
> @@ -1813,6 +1817,9 @@ static int patch_ad1981(struct hda_codec *codec)
>  		codec->patch_ops.unsol_event = ad1981_hp_unsol_event;
>  		break;
>  	}
> +
> +	codec->no_trigger_sense = 1;
> +
>  	return 0;
>  }
>  
> @@ -3118,6 +3125,8 @@ static int patch_ad1988(struct hda_codec *codec)
>  #endif
>  	spec->vmaster_nid = 0x04;
>  
> +	codec->no_trigger_sense = 1;
> +
>  	return 0;
>  }
>  
> @@ -3330,6 +3339,8 @@ static int patch_ad1884(struct hda_codec *codec)
>  
>  	codec->patch_ops = ad198x_patch_ops;
>  
> +	codec->no_trigger_sense = 1;
> +
>  	return 0;
>  }
>  
> @@ -4287,6 +4298,8 @@ static int patch_ad1884a(struct hda_codec *codec)
>  		break;
>  	}
>  
> +	codec->no_trigger_sense = 1;
> +
>  	return 0;
>  }
>  
> @@ -4623,6 +4636,9 @@ static int patch_ad1882(struct hda_codec *codec)
>  		spec->mixers[2] = ad1882_6stack_mixers;
>  		break;
>  	}
> +
> +	codec->no_trigger_sense = 1;
> +
>  	return 0;
>  }
>  


-- 

  Sergei

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

  reply	other threads:[~2009-12-25 17:58 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-12-25  9:31 drm/radeon/kms regression: 2.6.33-rc2 does not boot Andrei Gaponenko
2009-12-25  9:46 ` Dave Airlie
2009-12-25 10:08   ` Andrei Gaponenko
2009-12-25 10:32     ` Dave Airlie
2009-12-25 10:44       ` Andrei Gaponenko
2009-12-25 12:35       ` Dr. David Alan Gilbert
2009-12-26 18:57         ` Alex Deucher
2009-12-25 10:21 ` intel hda regression: 2.6.33-rc{1,2}: hd-audio0 eats 25% CPU (according to top) Sergei Trofimovich
2009-12-25 11:18   ` Takashi Iwai
2009-12-25 14:25     ` Sergei Trofimovich
2009-12-25 15:31       ` Maciej Rutecki
2009-12-25 16:05         ` Takashi Iwai
2009-12-25 16:32           ` Sergei Trofimovich
2009-12-25 17:06             ` Takashi Iwai
2009-12-25 18:00               ` Sergei Trofimovich [this message]
2009-12-25 19:01               ` Maciej Rutecki
2009-12-25 21:59                 ` Takashi Iwai
2009-12-25 16:44           ` Maciej Rutecki

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20091225200000.5730fb45@mosly \
    --to=slyich@gmail.com \
    --cc=eric.piel@tremplin-utc.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maciej.rutecki@gmail.com \
    --cc=tiwai@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).