Comment 671 for bug 1958019

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

(In reply to baipush from comment #655)
> Hello everybody,
>
> I have a similar problem as desribed in this thread:
>
> I have a Lenovo Yoga 7i 14ial7 (some kind of exclusive german / swiss /
> austrian model) with Realtek ALC3306 which is also recognized as an ALC287
> by ALSA. Bass speakers do not work so I just have a very weak sound from the
> bottom speakers.
>
> I'm using Fedora 36 with the latest stable kernel (and parallel latest
> vanilla kernel hoping it will get fixed).
>
> I have seen there are some patches in this thread and also in the latest
> Kernel-Versions, but I have a different audio codec ID so they don't apply.
>
> My codec ID is 0x17aa3869.
>
> I'm actually not a noob to linux but also not advanced enough to compile my
> own kernel and apply any kind of patch to it.
>
> Is there anybody who can help me to get my speakers to work properly?
>
> What kind of output is needed?
>
> Thanks in advance and kind regards
>
> Pascal

Hi Pascal,

You should try what I did: patch the kernel with your device ID.

I don't use Fedore but they have a tutorial for building custom kernels:

https://fedoraproject.org/wiki/Building_a_custom_kernel

You should follow those instructions up to the line which says "You can now make whatever changes / customizations you need before generating the rpms and installing them"

At that point you have to apply the patch.
In your case, you should edit in the patch file provided by Philipp the following line:

+ SND_PCI_QUIRK(0x17aa, 0x3801, "Yoga 9 14IAP7", ALC287_FIXUP_YOGA9_IAP7_BASS_SPK_PIN),

And edit your device id:

+ SND_PCI_QUIRK(0x17aa, 0x3869, "Yoga 9 14IAP7", ALC287_FIXUP_YOGA9_IAP7_BASS_SPK_PIN),

To apply the patch, you should get into the kernel source directory (the one containing the "sound/" directory) and execute the following command:

patch -p1 < your_edited_patch_file.patch

The patch application might fail, and you may end up with these three files in your sound/pci/hda/ folder:
patch_realtek.c (the partial patch)
patch_realtek.c.orig (the original file)
patch_realtek.c.rej (the rejected part of the patch)

In my own experience, the rejected part for this patch is the SND_PCI_QUIRK line mentioned above. In that case, you can edit manually the patch_realtek.c file and add that new line (there is a loooong list of SND_PCI_QUIRK entries near the end of the file, and the order doesn't matter, so you can just add it anywhere in the middle).
Keep in mind that the trailing "+" symbol should not be written when manually editing the source file (it's part of the patch tool syntax).

After doing that, you can go ahead and compile/install/try the new kernel (following the rest of the Fedora tutorial).

I can help if you get stuck. Send me an email.

Regards,
Gervasio