Comment 565 for bug 1958019

Revision history for this message
In , info (info-linux-kernel-bugs) wrote :

Hi all,

Good news for Lenovo Yoga Duet 7 13IML05 owners!

The HDA verbs (and therefore the quirks) for the Yoga 7 work perfectly on the Yoga Duet 7 13IML05 after the following patch is reverted:
https://git.kernel.org/pub/scm/linux/kernel/git/stable/stable-queue.git/diff/releases/5.4.89/alsa-hda-realtek-fix-speaker-volume-control-on-lenovo-c940.patch?id=1889f9ac9f9eb7f91ffc22e607a2e3db3db2e72e

Thus, writing a kernel patch for the Yoga Duet 7 becomes trivial:

--- a/sound/pci/hda/patch_realtek.c
+++ a/sound/pci/hda/patch_realtek.c
@@ -9008,7 +9008,7 @@
  SND_PCI_QUIRK(0x17aa, 0x3178, "ThinkCentre Station", ALC283_FIXUP_HEADSET_MIC),
  SND_PCI_QUIRK(0x17aa, 0x31af, "ThinkCentre Station", ALC623_FIXUP_LENOVO_THINKSTATION_P340),
  SND_PCI_QUIRK(0x17aa, 0x3813, "Legion 7i 15IMHG05", ALC287_FIXUP_LEGION_15IMHG05_SPEAKERS),
- SND_PCI_QUIRK(0x17aa, 0x3818, "Lenovo C940", ALC298_FIXUP_LENOVO_SPK_VOLUME),
+ SND_PCI_QUIRK(0x17aa, 0x3818, "Yoga Duet 7 13IML05", ALC287_FIXUP_YOGA7_14ITL_SPEAKERS),
  SND_PCI_QUIRK(0x17aa, 0x3819, "Lenovo 13s Gen2 ITL", ALC287_FIXUP_13S_GEN2_SPEAKERS),
  SND_PCI_QUIRK(0x17aa, 0x3824, "Legion Y9000X 2020", ALC285_FIXUP_LEGION_Y9000X_SPEAKERS),
  SND_PCI_QUIRK(0x17aa, 0x3827, "Ideapad S740", ALC285_FIXUP_IDEAPAD_S740_COEF),

With this patch, the internal speakers, headphones, headset mic and internal microphone all work on the Duet 7.

Now, I'm not sure how to get this patch to be merged, as reverting the patch for the C940 would obviously break sound on the C940. Why Lenovo decided to use the same subsystem ID (0x17aa, 0x3818) on both laptops is beyond me. I haven't been able to find another example of identical subsystem IDs for two different machines anywhere else in the "patch_realtek.c" file. At first, I thought that simply adding the quirk for the Yoga Duet 7 with the same subsystem ID might work, as the different DMI info allows to distinguish between both laptops. Well, that doesn't do the trick, so the only working fix right now is to revert the c940 patch.

Perhaps someone from the ALSA team would know how to deal with this odd issue.

By the way, no need to compile the whole kernel, compiling the 'snd-hda-codec-realtek.ko' module is enough. Backup and replace the module in /lib/modules/5.x.x/kernel/sound/pci/hda/ with the new module you just compiled and reboot to have working sound.