rpms/kernel/devel linux-2.6-alsa-improve-hda-powerdown.patch, NONE, 1.1 kernel.spec, 1.1659, 1.1660
Matthew Garrett
mjg59 at fedoraproject.org
Mon Jul 27 17:11:46 UTC 2009
Author: mjg59
Update of /cvs/pkgs/rpms/kernel/devel
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv20336
Modified Files:
kernel.spec
Added Files:
linux-2.6-alsa-improve-hda-powerdown.patch
Log Message:
* Mon Jul 27 2009 Matthew Garrett <mjg at redhat.com>
- linux-2.6-alsa-improve-hda-powerdown.patch - attempt to reduce audio glitches
caused by HDA powerdown
linux-2.6-alsa-improve-hda-powerdown.patch:
hda_codec.c | 9 +++++++--
patch_sigmatel.c | 14 ++++++++++++++
2 files changed, 21 insertions(+), 2 deletions(-)
--- NEW FILE linux-2.6-alsa-improve-hda-powerdown.patch ---
From: Takashi Iwai <tiwai at suse.de>
Date: Wed, 22 Jul 2009 10:39:24 +0000 (+0200)
Subject: ALSA: hda - Reduce click noise at power-saving
X-Git-Url: http://kernel.ubuntu.com/git?p=dtchen%2Fubuntu-karmic.git;a=commitdiff_plain;h=d6c571bdc08f1958f70c71eb11677066729e8505
ALSA: hda - Reduce click noise at power-saving
Add some tricks to reduce the click noise at powering down to D3
in the power saving mode on STAC/IDT codecs.
The key seems to be to reset PINs before the power-down, and some
delay before entering D3. The needed delay is significantly long,
but I don't know why.
Signed-off-by: Takashi Iwai <tiwai at suse.de>
Signed-off-by: Daniel T Chen <seven.steps at gmail.com>
---
diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c
index 88480c0..4d72e50 100644
--- a/sound/pci/hda/hda_codec.c
+++ b/sound/pci/hda/hda_codec.c
@@ -2356,9 +2356,14 @@ static void hda_set_power_state(struct hda_codec *codec, hda_nid_t fg,
hda_nid_t nid;
int i;
- snd_hda_codec_write(codec, fg, 0, AC_VERB_SET_POWER_STATE,
+ /* this delay seems necessary to avoid click noise at power-down */
+ if (power_state == AC_PWRST_D3)
+ msleep(100);
+ snd_hda_codec_read(codec, fg, 0, AC_VERB_SET_POWER_STATE,
power_state);
- msleep(10); /* partial workaround for "azx_get_response timeout" */
+ /* partial workaround for "azx_get_response timeout" */
+ if (power_state == AC_PWRST_D0)
+ msleep(10);
nid = codec->start_nid;
for (i = 0; i < codec->num_nodes; i++, nid++) {
diff --git a/sound/pci/hda/patch_sigmatel.c b/sound/pci/hda/patch_sigmatel.c
index da7f9f6..3637b31 100644
--- a/sound/pci/hda/patch_sigmatel.c
+++ b/sound/pci/hda/patch_sigmatel.c
@@ -4746,6 +4746,20 @@ static int stac92xx_hp_check_power_status(struct hda_codec *codec,
static int stac92xx_suspend(struct hda_codec *codec, pm_message_t state)
{
struct sigmatel_spec *spec = codec->spec;
+ int i;
+ hda_nid_t nid;
+
+ /* reset each pin before powering down DAC/ADC to avoid click noise */
+ nid = codec->start_nid;
+ for (i = 0; i < codec->num_nodes; i++, nid++) {
+ unsigned int wcaps = get_wcaps(codec, nid);
+ unsigned int wid_type = (wcaps & AC_WCAP_TYPE) >>
+ AC_WCAP_TYPE_SHIFT;
+ if (wid_type == AC_WID_PIN)
+ snd_hda_codec_read(codec, nid, 0,
+ AC_VERB_SET_PIN_WIDGET_CONTROL, 0);
+ }
+
if (spec->eapd_mask)
stac_gpio_set(codec, spec->gpio_mask,
spec->gpio_dir, spec->gpio_data &
Index: kernel.spec
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/devel/kernel.spec,v
retrieving revision 1.1659
retrieving revision 1.1660
diff -u -p -r1.1659 -r1.1660
--- kernel.spec 27 Jul 2009 03:04:07 -0000 1.1659
+++ kernel.spec 27 Jul 2009 17:11:46 -0000 1.1660
@@ -635,6 +635,7 @@ Patch570: linux-2.6-selinux-mprotect-che
Patch580: linux-2.6-sparc-selinux-mprotect-checks.patch
Patch600: linux-2.6-defaults-alsa-hda-beep-off.patch
+Patch601: linux-2.6-alsa-improve-hda-powerdown.patch
Patch610: hda_intel-prealloc-4mb-dmabuffer.patch
Patch670: linux-2.6-ata-quirk.patch
@@ -1190,6 +1191,7 @@ ApplyPatch linux-2.6-defaults-aspm.patch
# ALSA
# squelch hda_beep by default
ApplyPatch linux-2.6-defaults-alsa-hda-beep-off.patch
+ApplyPatch linux-2.6-alsa-improve-hda-powerdown.patch
ApplyPatch hda_intel-prealloc-4mb-dmabuffer.patch
# Networking
@@ -1894,6 +1896,10 @@ fi
# and build.
%changelog
+* Mon Jul 27 2009 Matthew Garrett <mjg at redhat.com>
+- linux-2.6-alsa-improve-hda-powerdown.patch - attempt to reduce audio glitches
+ caused by HDA powerdown
+
* Mon Jul 27 2009 Dave Airlie <airlied at redhat.com>
- update vga arb code
More information about the fedora-extras-commits
mailing list