[alsa-devel] [PATCH] ALSA: hda - limit internal mic boost for Asus X202E
When the input gain for the internal mic is set to its maximum level, the background noise becomes so high - and any relevant signal clipped - that the setting becomes unusable. It is better to limit the amplification.
BugLink: https://bugs.launchpad.net/bugs/1052460 Signed-off-by: David Henningsson david.henningsson@canonical.com ---
Feel free to add cc to stable if you think it makes sense to do so. Alsa info available at: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1052460/+attachment/332...
sound/pci/hda/patch_via.c | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+)
diff --git a/sound/pci/hda/patch_via.c b/sound/pci/hda/patch_via.c index d5f36a1..74fb6fd 100644 --- a/sound/pci/hda/patch_via.c +++ b/sound/pci/hda/patch_via.c @@ -3666,6 +3666,32 @@ static void set_widgets_power_state_vt2002P(struct hda_codec *codec) update_power_state(codec, 0x21, AC_PWRST_D3); }
+/* + * pin fix-up + */ +enum { + VIA_FIXUP_INTMIC_BOOST, +}; + +static void via_fixup_intmic_boost(struct hda_codec *codec, + const struct hda_fixup *fix, int action) +{ + if (action == HDA_FIXUP_ACT_PRE_PROBE) + override_mic_boost(codec, 0x30, 0, 2, 40); +} + +static const struct hda_fixup via_fixups[] = { + [VIA_FIXUP_INTMIC_BOOST] = { + .type = HDA_FIXUP_FUNC, + .v.func = via_fixup_intmic_boost, + }, +}; + +static const struct snd_pci_quirk vt2002p_fixups[] = { + SND_PCI_QUIRK(0x1043, 0x8532, "Asus X202E", VIA_FIXUP_INTMIC_BOOST), + {} +}; + /* patch for vt2002P */ static int patch_vt2002P(struct hda_codec *codec) { @@ -3682,6 +3708,9 @@ static int patch_vt2002P(struct hda_codec *codec) override_mic_boost(codec, 0x29, 0, 3, 40); add_secret_dac_path(codec);
+ snd_hda_pick_fixup(codec, NULL, vt2002p_fixups, via_fixups); + snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); + /* automatic parse from the BIOS config */ err = via_parse_auto_config(codec); if (err < 0) {
At Tue, 18 Sep 2012 14:26:59 +0200, David Henningsson wrote:
When the input gain for the internal mic is set to its maximum level, the background noise becomes so high - and any relevant signal clipped - that the setting becomes unusable. It is better to limit the amplification.
BugLink: https://bugs.launchpad.net/bugs/1052460 Signed-off-by: David Henningsson david.henningsson@canonical.com
Feel free to add cc to stable if you think it makes sense to do so. Alsa info available at: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1052460/+attachment/332...
Thanks, applied now with Cc to stable 3.5+.
Takashi
sound/pci/hda/patch_via.c | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+)
diff --git a/sound/pci/hda/patch_via.c b/sound/pci/hda/patch_via.c index d5f36a1..74fb6fd 100644 --- a/sound/pci/hda/patch_via.c +++ b/sound/pci/hda/patch_via.c @@ -3666,6 +3666,32 @@ static void set_widgets_power_state_vt2002P(struct hda_codec *codec) update_power_state(codec, 0x21, AC_PWRST_D3); }
+/*
- pin fix-up
- */
+enum {
- VIA_FIXUP_INTMIC_BOOST,
+};
+static void via_fixup_intmic_boost(struct hda_codec *codec,
const struct hda_fixup *fix, int action)
+{
- if (action == HDA_FIXUP_ACT_PRE_PROBE)
override_mic_boost(codec, 0x30, 0, 2, 40);
+}
+static const struct hda_fixup via_fixups[] = {
- [VIA_FIXUP_INTMIC_BOOST] = {
.type = HDA_FIXUP_FUNC,
.v.func = via_fixup_intmic_boost,
- },
+};
+static const struct snd_pci_quirk vt2002p_fixups[] = {
- SND_PCI_QUIRK(0x1043, 0x8532, "Asus X202E", VIA_FIXUP_INTMIC_BOOST),
- {}
+};
/* patch for vt2002P */ static int patch_vt2002P(struct hda_codec *codec) { @@ -3682,6 +3708,9 @@ static int patch_vt2002P(struct hda_codec *codec) override_mic_boost(codec, 0x29, 0, 3, 40); add_secret_dac_path(codec);
- snd_hda_pick_fixup(codec, NULL, vt2002p_fixups, via_fixups);
- snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
- /* automatic parse from the BIOS config */ err = via_parse_auto_config(codec); if (err < 0) {
-- 1.7.9.5
participants (2)
-
David Henningsson
-
Takashi Iwai