From patchwork Sun Feb 25 11:40:53 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Athaariq Ardhiansyah X-Patchwork-Id: 776537 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 7BF77C48BF6 for ; Mon, 26 Feb 2024 17:25:38 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 87BBA868; Mon, 26 Feb 2024 18:25:26 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 87BBA868 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1708968336; bh=f/VwGG/Xa37pwX+dykC40PbJQJ/HnNDNIS6jQdlWTpU=; h=Date:To:From:Subject:Cc:List-Id:List-Archive:List-Help:List-Owner: List-Post:List-Subscribe:List-Unsubscribe:From; b=kfssrL+LJFT0gneSurUv28KTyDWMUi3gDJ4WSuZVN+LOtKw6kT32YbAiZdiPhInh2 SoWxrYEouLLRJtVhnJxpWD6vlaXreVg0yfDLgeRCOYzsDmqw/i8GUgSITcMQ4BYsza Jl5b9JkaWmjjLw8XnmW5rpE6D9J0rsVJ4/NSHPLo= Received: by alsa1.perex.cz (Postfix, from userid 50401) id CA5C9F806BF; Mon, 26 Feb 2024 18:23:15 +0100 (CET) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id 4C99AF806BC; Mon, 26 Feb 2024 18:23:15 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 81312F80246; Sun, 25 Feb 2024 12:41:10 +0100 (CET) Received: from mail.athaariq.my.id (unknown [117.53.144.211]) by alsa1.perex.cz (Postfix) with ESMTP id 96477F800EE for ; Sun, 25 Feb 2024 12:41:07 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 96477F800EE Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key, unprotected) header.d=athaariq.my.id header.i=@athaariq.my.id header.a=rsa-sha256 header.s=dkim20240121 header.b=BcNPy/FX Received: from localhost (localhost [127.0.0.1]) by mail.athaariq.my.id (Postfix) with ESMTP id 11D823E0BD; Sun, 25 Feb 2024 11:41:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=athaariq.my.id; h=subject:subject:from:from:content-language:user-agent :mime-version:date:date:message-id:content-type:content-type :received; s=dkim20240121; t=1708861264; x=1710070865; bh=f/VwGG /Xa37pwX+dykC40PbJQJ/HnNDNIS6jQdlWTpU=; b=BcNPy/FXES170HzrFGbKsR JQ15ipdhJW710uOXD5EqKO/oCAvNrG7F5NQZwV0PnuSoIu7JwdT1Jm0gyo6toeQ2 6K7auf2zodwMErmQOzYvAOCIU62SQBd/8yUDWaqnhjtjlgwPSCC1hCmKnR3CCvLG ngvJRnsImOsqPoM4Y0ERIBhzH1QSFhNDhaTuATKPtmSkVFgHTcjiE6pS+3nAWtOb lbqUKsGJGcxu1xtDGkGJmtDaMlVNxu2Jq02XL3WZnIQLe6X+KMuIDTFw1ol+7uHX jjPm1GFCGLekda4mTyaALsh1lsnY/+huBjlLVShyCsS+CPsXSqjgiivj8YyxNdbA == Received: from [10.100.78.147] (unknown [192.168.100.1]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by mail.athaariq.my.id (Postfix) with ESMTPSA id E6C6A3B197; Sun, 25 Feb 2024 11:41:03 +0000 (UTC) Message-ID: <46f40b6f-645b-434d-a963-7d1834c8bd7d@athaariq.my.id> Date: Sun, 25 Feb 2024 18:40:53 +0700 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Content-Language: en-US To: Kailang Yang From: Athaariq Ardhiansyah Subject: Attempt to Fix ALC285 on Linux for HP Envy x360 Laptops Autocrypt: addr=foss@athaariq.my.id; keydata= xsFNBGWZYswBEADAQ+BO2k+TyLHXyCKu8yFvAKQ5uNwi3E+tq2C8oaol8OUOwkDOR7MElhtJ N0vT0BUq0EBV5GJY21NlIJopQ8LG7l1nfJtZDm3nvvJGN8J9eK+E/P3KXgBiW+2mDz8vKS3z vlqrL8LIssdX3AAz5rXlpZpE6Ak4xDCr4+66HBTM1Mcn1M70AGJdEif+1iVl8pKT1h6khqHt wY+d6afLNq5r/fczwHlvX4rCeeNtyQyueBbeLTatIzcmWMao75YslMg/ipCKte1O6xk3Bj65 a9vZZ1LAmtO9MzWSkeHHAnvxyu5j6WkbhGIHf+VJtrZvk0Lk5Lns5vQYCTZpTTnXZBQgmwss 6Zah8A+r8UT7Ao1TkKnq1i9tSku9XUBcAkyv+sAeaPzdzfLoT8fwMZ5HzVnTN41LnFcPtvjV M3pgkX6X4YNkjbgntLuytqyIrC7eLI2RzXi/RGmCys7imKfDA1bgAFCbAvQ5DAkcOZsJrD1E p4VGq+eNqNDDa+7lZXbxxkX8kDs/DeCjSZTes1Ae+7fQvoQHNpT7TGLqEkrizPkGZ+M/1czS +hOxzBbgxNMt2Mjn2SJqMelv+m/uF6aKysO/Dr9MznNvd/ieS9ush0ecp0e1nQFoeYQEGooB IpDL808iPtg5h8G00zUbvQtwR0MM4YKFJV12fdfFPsAKYMX3swARAQABzSpBdGhhYXJpcSBB cmRoaWFuc3lhaCA8Zm9zc0BhdGhhYXJpcS5teS5pZD7CwZEEEwEIADsWIQTdrvywSY1D19wo SFWk5ieJ9DG8DgUCZZlvpwIbAwULCQgHAgIiAgYVC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M6m4YI2In3ZIulPrMh3CZlBci+5D6kgTs39te0wJJ/q1XX k1EVqOA3E+xyLi9hErElkqzeatcnizLhgi7I+oEYmG1nds+rWsruUwRXhiSOSR5Fv8Szu6GQ JQRSHHYakg+8UsFvIZ/1KfUKAzjWHU9U24xWZ1bkZG6g+5yIaL4p9Qb84x3ofFFn9fTRs4vr MrDf822GzFzWgIY3Zb9tXTZ+l7q63DPGLClSQt0ptt0ytKMVsof0viY/NC04yOAwOfo27X1u 0dEGnjFF6CYWFhJI9WyAeqJdqlxIznCM6Xj97Y1yAMu8ZlCuaU3zGNsesKmgpHDYhSQU9v5V BlpKhAABlYFb4ZPCbyVpnxcWwHQ0u6M4f/1M0HdJRGQjWJfMrZZR6EYOFFHFhbuFjLw1uRyE /9ZmpUvCc8xKu0MykBQt0R1SoNCUnehkVzbCFSe3zYGq28gyHN6lmWoAWR0Lc3jU3JH4k0uR GMviPu198f0Mg1RQmg== Cc: alsa-devel@alsa-project.org X-MailFrom: foss@athaariq.my.id X-Mailman-Rule-Hits: nonmember-moderation X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1 Message-ID-Hash: DWW3I2LLLKX6RI2QAXFTUADVQ47VZJSD X-Message-ID-Hash: DWW3I2LLLKX6RI2QAXFTUADVQ47VZJSD X-Mailman-Approved-At: Mon, 26 Feb 2024 17:22:50 +0000 X-Mailman-Version: 3.3.9 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: <> List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Dear Mr. Yang and ALSA contributors, Currently, I'm trying to fix ALC285 for HP Envy x360 13-ar0107au convertible laptop on Linux v6.7.6 kernel. It has several problems including B&O soundbar speakers won't work and volume too low even though it's 100%. For now, the B&O soundbar is working. However, I'm still struggling to fix the low volume problem. The draft patch is attached to this mail. If you don't mind, please let me know the information about the correct coefficients, so I can help you fix the problem and test it on my device. Thank you for your attention. Sincerely, Eric diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c index e3096572881d..8e4cd71a40f4 100644 --- a/sound/pci/hda/patch_realtek.c +++ b/sound/pci/hda/patch_realtek.c @@ -6677,6 +6677,42 @@ static void alc285_fixup_hp_spectre_x360_eb1(struct hda_codec *codec, } } +static void alc285_fixup_hp_envy_x360(struct hda_codec *codec, + const struct hda_fixup *fix, + int action) +{ + static const struct coef_fw coefs[] = { + /* Amplifier process coefficient*/ + WRITE_COEF(0x08, 0x6a0c), WRITE_COEF(0x0d, 0xa023), + WRITE_COEF(0x10, 0x0320), WRITE_COEF(0x1a, 0x8c03), + WRITE_COEF(0x25, 0x1800), WRITE_COEF(0x26, 0x003a), + WRITE_COEF(0x28, 0x1dfe), WRITE_COEF(0x29, 0xb014), + WRITE_COEF(0x2b, 0xfdfe), WRITE_COEF(0x37, 0xfe15), + WRITE_COEF(0x38, 0x7909), WRITE_COEF(0x45, 0xd089), + WRITE_COEF(0x46, 0x00f4), WRITE_COEF(0x4a, 0x20e0), + WRITE_COEF(0x66, 0x03f0), WRITE_COEF(0x67, 0x1000), + WRITE_COEF(0x6e, 0x1005), { } + }; + + static const struct hda_pintbl pincfgs[] = { + { 0x14, 0x90170150 }, /* B&O soundbar speakers */ + { 0x17, 0x90170152 }, /* side speakers */ + { } + }; + + static const hda_nid_t conn[] = { 0x02, 0x03 }; + + switch (action) { + case HDA_FIXUP_ACT_PRE_PROBE: + snd_hda_apply_pincfgs(codec, pincfgs); + alc295_fixup_disable_dac3(codec, fix, action); + break; + case HDA_FIXUP_ACT_INIT: + alc_process_coef_fw(codec, coefs); + break; + } +} + static void alc285_fixup_hp_spectre_x360(struct hda_codec *codec, const struct hda_fixup *fix, int action) { @@ -7290,6 +7326,7 @@ enum { ALC280_FIXUP_HP_9480M, ALC245_FIXUP_HP_X360_AMP, ALC285_FIXUP_HP_SPECTRE_X360_EB1, + ALC285_FIXUP_HP_ENVY_X360, ALC288_FIXUP_DELL_HEADSET_MODE, ALC288_FIXUP_DELL1_MIC_NO_PRESENCE, ALC288_FIXUP_DELL_XPS_13, @@ -9244,6 +9281,12 @@ static const struct hda_fixup alc269_fixups[] = { .type = HDA_FIXUP_FUNC, .v.func = alc285_fixup_hp_spectre_x360_eb1 }, + [ALC285_FIXUP_HP_ENVY_X360] = { + .type = HDA_FIXUP_FUNC, + .v.func = alc285_fixup_hp_envy_x360, + .chained = true, + .chain_id = ALC285_FIXUP_HP_GPIO_AMP_INIT, + }, [ALC287_FIXUP_IDEAPAD_BASS_SPK_AMP] = { .type = HDA_FIXUP_FUNC, .v.func = alc285_fixup_ideapad_s740_coef, @@ -9862,6 +9905,7 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = { SND_PCI_QUIRK(0x103c, 0x880d, "HP EliteBook 830 G8 Notebook PC", ALC285_FIXUP_HP_GPIO_LED), SND_PCI_QUIRK(0x103c, 0x8811, "HP Spectre x360 15-eb1xxx", ALC285_FIXUP_HP_SPECTRE_X360_EB1), SND_PCI_QUIRK(0x103c, 0x8812, "HP Spectre x360 15-eb1xxx", ALC285_FIXUP_HP_SPECTRE_X360_EB1), + SND_PCI_QUIRK(0x103c, 0x85de, "HP Envy x360 13-ar0xxx", ALC285_FIXUP_HP_ENVY_X360), SND_PCI_QUIRK(0x103c, 0x881d, "HP 250 G8 Notebook PC", ALC236_FIXUP_HP_MUTE_LED_COEFBIT2), SND_PCI_QUIRK(0x103c, 0x8846, "HP EliteBook 850 G8 Notebook PC", ALC285_FIXUP_HP_GPIO_LED), SND_PCI_QUIRK(0x103c, 0x8847, "HP EliteBook x360 830 G8 Notebook PC", ALC285_FIXUP_HP_GPIO_LED), @@ -10509,6 +10553,7 @@ static const struct hda_model_fixup alc269_fixup_models[] = { {.id = ALC295_FIXUP_HP_OMEN, .name = "alc295-hp-omen"}, {.id = ALC285_FIXUP_HP_SPECTRE_X360, .name = "alc285-hp-spectre-x360"}, {.id = ALC285_FIXUP_HP_SPECTRE_X360_EB1, .name = "alc285-hp-spectre-x360-eb1"}, + {.id = ALC285_FIXUP_HP_ENVY_X360, .name = "alc285-hp-envy-x360"}, {.id = ALC287_FIXUP_IDEAPAD_BASS_SPK_AMP, .name = "alc287-ideapad-bass-spk-amp"}, {.id = ALC287_FIXUP_YOGA9_14IAP7_BASS_SPK_PIN, .name = "alc287-yoga9-bass-spk-pin"}, {.id = ALC623_FIXUP_LENOVO_THINKSTATION_P340, .name = "alc623-lenovo-thinkstation-p340"},