Follow-up to comment #8: I replaced the two-slot model= workaround with
a codec-specific HDA early patch on kernel 7.0.0-38-generic.

The workaround from comment #4, which I confirmed in comment #8, works:

options snd-hda-intel model=17aa:3855,17aa:3855

However, it applies the same model parameter to both Intel and NVIDIA
HDA controller instances to account for their unstable enumeration
order.

The HDA early patch mechanism provides a more targeted alternative. It
matches the Realtek ALC287 codec by vendor ID (0x10ec0287), subsystem ID
(0x17aa3855), and codec address (0), without depending on controller
enumeration order.

I tested the following configuration successfully on my Lenovo Legion 7
16ITHg6 running 7.0.0-38-generic.

The script below creates the required firmware patch, modprobe
configuration, and initramfs hook. It must be run as root. Remove any
previous snd-hda-intel model= or patch= overrides before running it.

#!/bin/sh
set -eu

if [ "$(id -u)" -ne 0 ]; then
    echo "Run this script as root" >&2
    exit 1
fi

FW=/lib/firmware/lenovo-legion-alc287.fw
CONF=/etc/modprobe.d/lenovo-legion-alc287.conf
HOOK=/etc/initramfs-tools/hooks/lenovo-legion-alc287

for file in "$FW" "$CONF" "$HOOK"; do
    if [ -e "$file" ]; then
        echo "File already exists: $file" >&2
        exit 1
    fi
done

cat > "$FW" <<'EOF'
[codec]
0x10ec0287 0x17aa3855 0

[model]
17aa:3855
EOF

cat > "$CONF" <<'EOF'
options snd-hda-intel patch=lenovo-legion-alc287.fw,lenovo-legion-alc287.fw
EOF

cat > "$HOOK" <<'EOF'
#!/bin/sh
set -e

PREREQ=""
prereqs() {
    echo "$PREREQ"
}

case "$1" in
    prereqs)
        prereqs
        exit 0
        ;;
esac

. /usr/share/initramfs-tools/hook-functions

copy_file firmware /lib/firmware/lenovo-legion-alc287.fw
EOF

chmod 755 "$HOOK"
update-initramfs -u -k "$(uname -r)"

lsinitramfs "/boot/initrd.img-$(uname -r)" |
    grep 'lenovo-legion-alc287.fw'

After reboot, the kernel reports:

snd_hda_intel 0000:00:1f.3: Applying patch firmware 'lenovo-legion-alc287.fw'
snd_hda_intel 0000:01:00.1: Applying patch firmware 'lenovo-legion-alc287.fw'
ALC287: picked fixup for alias SSID 17aa:3855

Both Cirrus Logic CS35L41 amplifiers load their DSP firmware and bind
successfully.

I verified the codec-specific result through sysfs:

Realtek ALC287 (0x10ec0287): modelname = 17aa:3855
Intel Tiger Lake HDMI codec (0x80862812): modelname = empty
NVIDIA HDMI/DP codec (0x10de009f): modelname = empty

Although both HDA controllers load the patch firmware, only the matching
Realtek codec receives the model override.

Functional tests on 7.0.0-38-generic:

Internal speakers: working
NVIDIA HDMI/DP video output to TV: working
NVIDIA HDMI/DP audio output to TV: working

The Intel HDMI codec was not functionally tested; its sysfs state was
inspected only to verify that no model override was applied.

This is a workaround for the affected ALC287 codec, not a replacement
for the upstream fix dd074f04e046 referenced in comment #3.
Incorporating that fix into the Ubuntu kernel remains the preferred
resolution.

To remove the workaround, delete the three files created by the script,
rebuild the initramfs, and reboot.

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2163143

Title:
  [Lenovo Legion 7 16ITHg6 82K6, Realtek ALC287 + 2x CS35L41]
  Regression: internal speakers silent since 7.0.0-27; new PCI SSID
  quirk 17aa:3811 shadows codec SSID quirk 17aa:3855

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/2163143/+subscriptions


-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to