All of lore.kernel.org
 help / color / mirror / Atom feed
From: Phil Calvin <phil@philcalvin.com>
To: Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.com>
Cc: alsa-devel@alsa-project.org
Subject: [PATCH 1/1] ALSA: hda/realtek: fix mic boost on Intel NUC 8
Date: Thu, 15 Apr 2021 18:01:29 -0400	[thread overview]
Message-ID: <80dc5663-7734-e7e5-25ef-15b5df24511a@philcalvin.com> (raw)

Fix two bugs with the Intel HDA Realtek ALC233 sound codec
present in Intel NUC NUC8i7BEH and probably a few other similar
NUC models.

These codecs advertise a 4-level microphone input boost amplifier on
pin 0x19, but the highest two boost settings do not work correctly,
and produce only low analog noise that does not seem to contain any
discernible signal. There is an existing fixup for this exact problem
but for a different PCI subsystem ID, so we re-use that logic.

Changing the boost level also triggers a DC spike in the input signal
that bleeds off over about a second and overwhelms any input during
that time. Thankfully, the existing fixup has the side effect of
making the boost control show up in userspace as a mute/unmute switch,
and this keeps (e.g.) PulseAudio from fiddling with it during normal
input volume adjustments.

Finally, the NUC hardware has built-in inverted stereo mics. This
patch also enables the usual fixup for this so the two channels cancel
noise instead of the actual signal.

Signed-off-by: Phil Calvin <phil@philcalvin.com>
---
  sound/pci/hda/patch_realtek.c | 13 +++++++++++++
  1 file changed, 13 insertions(+)

diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index 58946d069ee5..e1fd4c81965a 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -6405,6 +6405,8 @@ enum {
  	ALC269_FIXUP_LEMOTE_A1802,
  	ALC269_FIXUP_LEMOTE_A190X,
  	ALC256_FIXUP_INTEL_NUC8_RUGGED,
+	ALC233_FIXUP_INTEL_NUC8_DMIC,
+	ALC233_FIXUP_INTEL_NUC8_BOOST,
  	ALC256_FIXUP_INTEL_NUC10,
  	ALC255_FIXUP_XIAOMI_HEADSET_MIC,
  	ALC274_FIXUP_HP_MIC,
@@ -7122,6 +7124,16 @@ static const struct hda_fixup alc269_fixups[] = {
  		.type = HDA_FIXUP_FUNC,
  		.v.func = alc233_fixup_lenovo_line2_mic_hotkey,
  	},
+	[ALC233_FIXUP_INTEL_NUC8_DMIC] = {
+		.type = HDA_FIXUP_FUNC,
+		.v.func = alc_fixup_inv_dmic,
+		.chained = true,
+		.chain_id = ALC233_FIXUP_INTEL_NUC8_BOOST,
+	},
+	[ALC233_FIXUP_INTEL_NUC8_BOOST] = {
+		.type = HDA_FIXUP_FUNC,
+		.v.func = alc269_fixup_limit_int_mic_boost
+	},
  	[ALC255_FIXUP_DELL_SPK_NOISE] = {
  		.type = HDA_FIXUP_FUNC,
  		.v.func = alc_fixup_disable_aamix,
@@ -8265,6 +8277,7 @@ static const struct snd_pci_quirk 
alc269_fixup_tbl[] = {
  	SND_PCI_QUIRK(0x1c06, 0x2013, "Lemote A1802", ALC269_FIXUP_LEMOTE_A1802),
  	SND_PCI_QUIRK(0x1c06, 0x2015, "Lemote A190X", ALC269_FIXUP_LEMOTE_A190X),
  	SND_PCI_QUIRK(0x8086, 0x2080, "Intel NUC 8 Rugged", 
ALC256_FIXUP_INTEL_NUC8_RUGGED),
+	SND_PCI_QUIRK(0x8086, 0x2074, "Intel NUC 8", 
ALC233_FIXUP_INTEL_NUC8_DMIC),
  	SND_PCI_QUIRK(0x8086, 0x2081, "Intel NUC 10", ALC256_FIXUP_INTEL_NUC10),
   #if 0
-- 
2.30.2


             reply	other threads:[~2021-04-15 22:03 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-15 22:01 Phil Calvin [this message]
2021-04-16  8:05 ` [PATCH 1/1] ALSA: hda/realtek: fix mic boost on Intel NUC 8 Takashi Iwai

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=80dc5663-7734-e7e5-25ef-15b5df24511a@philcalvin.com \
    --to=phil@philcalvin.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=perex@perex.cz \
    --cc=tiwai@suse.com \
    /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 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.