linux_dsm_epyc7002/sound/pci/hda
Takashi Iwai 6a6660d049 ALSA: hda/realtek - Improved routing for Thinkpad X1 7th/8th Gen
There've been quite a few regression reports about the lowered volume
(reduced to ca 65% from the previous level) on Lenovo Thinkpad X1
after the commit d2cd795c4e ("ALSA: hda - fixup for the bass speaker
on Lenovo Carbon X1 7th gen").  Although the commit itself does the
right thing from HD-audio POV in order to have a volume control for
bass speakers, it seems that the machine has some secret recipe under
the hood.

Through experiments, Benjamin Poirier found out that the following
routing gives the best result:
* DAC1 (NID 0x02) -> Speaker pin (NID 0x14)
* DAC2 (NID 0x03) -> Shared by both Bass Speaker pin (NID 0x17) &
                     Headphone pin (0x21)
* DAC3 (NID 0x06) -> Unused

DAC1 seems to have some equalizer internally applied, and you'd get
again the output in a bad quality if you connect this to the
headphone pin.  Hence the headphone is connected to DAC2, which is now
shared with the bass speaker pin.  DAC3 has no volume amp, hence it's
not connected at all.

For achieving the routing above, this patch introduced a couple of
workarounds:

* The connection list of bass speaker pin (NID 0x17) is reduced not to
  include DAC3 (NID 0x06)
* Pass preferred_pairs array to specify the fixed connection

Here, both workarounds are needed because the generic parser prefers
the individual DAC assignment over others.

When the routing above is applied, the generic parser creates the two
volume controls "Front" and "Bass Speaker".  Since we have only two
DACs for three output pins, those are not fully controlling each
output individually, and it would confuse PulseAudio.  For avoiding
the pitfall, in this patch, we rename those volume controls to some
unique ones ("DAC1" and "DAC2").  Then PulseAudio ignore them and
concentrate only on the still good-working "Master" volume control.
If a user still wants to control each DAC volume, they can still
change manually via "DAC1" and "DAC2" volume controls.

Fixes: d2cd795c4e ("ALSA: hda - fixup for the bass speaker on Lenovo Carbon X1 7th gen")
Reported-by: Benjamin Poirier <benjamin.poirier@gmail.com>
Reviewed-by: Jaroslav Kysela <perex@perex.cz>
Tested-by: Benjamin Poirier <benjamin.poirier@gmail.com>
Cc: <stable@vger.kernel.org>
BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=207407#c10
BugLink: https://gist.github.com/hamidzr/dd81e429dc86f4327ded7a2030e7d7d9#gistcomment-3214171
BugLink: https://gist.github.com/hamidzr/dd81e429dc86f4327ded7a2030e7d7d9#gistcomment-3276276
Link: https://lore/kernel.org/r/20200829112746.3118-1-benjamin.poirier@gmail.com
Link: https://lore.kernel.org/r/20200903083300.6333-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2020-09-03 12:49:12 +02:00
..
ca0132_regs.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 32 2019-05-24 17:27:10 +02:00
hda_auto_parser.c ALSA: hda - let hs_mic be picked ahead of hp_mic 2020-06-25 15:00:45 +02:00
hda_auto_parser.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 46 2019-05-24 17:27:12 +02:00
hda_beep.c ALSA: Use fallthrough pseudo-keyword 2020-07-09 13:01:29 +02:00
hda_beep.h ALSA: hda - Use standard device registration for beep 2019-01-29 18:28:09 +01:00
hda_bind.c ALSA: hda - Fix pending unsol events at shutdown 2019-10-28 12:44:28 +01:00
hda_codec.c ALSA: pci: delete repeated words in comments 2020-08-06 09:30:02 +02:00
hda_controller_trace.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
hda_controller.c ALSA: hda: Enable sync-write operation as default for all controllers 2020-06-19 12:05:02 +02:00
hda_controller.h Merge branch 'for-next' into for-linus 2020-08-03 08:10:08 +02:00
hda_eld.c ALSA: hda: Use scnprintf() for printing texts for sysfs/procfs 2020-02-18 10:15:41 +01:00
hda_generic.c ALSA: pci: delete repeated words in comments 2020-08-06 09:30:02 +02:00
hda_generic.h ALSA: Replace the word "slave" in vmaster API 2020-07-20 10:10:47 +02:00
hda_hwdep.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 32 2019-05-24 17:27:10 +02:00
hda_intel_trace.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
hda_intel.c ALSA: hda: add dev_dbg log when driver is not selected 2020-09-02 19:31:07 +02:00
hda_intel.h ALSA: hda: Release resources at error in delayed probe 2020-04-13 18:02:36 +02:00
hda_jack.c ALSA: hda: correct kernel-doc parameter descriptions 2020-01-14 07:47:44 +01:00
hda_jack.h ALSA: hda - Add DP-MST jack support 2019-11-19 11:51:07 +01:00
hda_local.h ALSA: Replace the word "slave" in vmaster API 2020-07-20 10:10:47 +02:00
hda_proc.c ALSA: hda: More constifications 2020-01-05 16:14:32 +01:00
hda_sysfs.c ALSA: hda: Use scnprintf() for printing texts for sysfs/procfs 2020-02-18 10:15:41 +01:00
hda_tegra.c ALSA: hda/tegra: Program WAKEEN register for Tegra 2020-08-25 09:32:42 +02:00
hp_x360_helper.c ALSA: hda/realtek - Fixup for HP x360 laptops with B&O speakers 2018-05-29 22:33:37 +02:00
Kconfig ALSA: hda/hdmi: Add Intel silent stream support 2020-07-07 12:42:35 +02:00
Makefile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
patch_analog.c ALSA: hda/analog - Minor optimization for SPDIF mux connections 2020-01-16 17:29:17 +01:00
patch_ca0110.c ALSA: hda: Unify get_response handling 2019-12-13 14:36:52 +01:00
patch_ca0132.c ALSA: hda/ca0132 - Fix AE-5 microphone selection commands. 2020-08-03 08:12:17 +02:00
patch_cirrus.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 32 2019-05-24 17:27:10 +02:00
patch_cmedia.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 32 2019-05-24 17:27:10 +02:00
patch_conexant.c ALSA: Use fallthrough pseudo-keyword 2020-07-09 13:01:29 +02:00
patch_hdmi.c ALSA: hda: hdmi - add Rocketlake support 2020-09-02 19:26:23 +02:00
patch_realtek.c ALSA: hda/realtek - Improved routing for Thinkpad X1 7th/8th Gen 2020-09-03 12:49:12 +02:00
patch_si3054.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 32 2019-05-24 17:27:10 +02:00
patch_sigmatel.c ALSA: pci: delete repeated words in comments 2020-08-06 09:30:02 +02:00
patch_via.c ALSA: hda: Manage concurrent reg access more properly 2020-01-13 13:40:41 +01:00
thinkpad_helper.c ALSA: hda/realtek: Use the new vmaster mute LED helper 2020-06-18 13:23:49 +02:00