Bug 265632

Summary: sound: add Lenovo Legion 5 speakers sound output
Product: Base System Reporter: Nuno Teixeira <eduardo>
Component: kernAssignee: Nuno Teixeira <eduardo>
Status: Closed FIXED    
Severity: Affects Only Me CC: emaste
Priority: --- Keywords: patch-ready
Version: CURRENT   
Hardware: amd64   
OS: Any   
URL: https://reviews.freebsd.org/D36511
See Also: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=262579
Attachments:
Description Flags
lenovo legion 5 intel speakers none

Description Nuno Teixeira freebsd_committer freebsd_triage 2022-08-04 20:20:57 UTC
Hello,

I'm looking for speakers support on a Lenovo Legion 5 Intel (15IMH05) laptop.

 - headphones work ok
 - speakers doesn't produce sound.

A past review D30333 was incorporated into source but it doesn't make it work on this laptop Intel version.

dmesg, sndstat and sysctl hdda logs at https://people.freebsd.org/~eduardo/logs/speakers/

Thanks in advance,

Nuno Teixeira
Comment 1 Nuno Teixeira freebsd_committer freebsd_triage 2022-08-25 18:58:50 UTC
It works with:

hint.hdaa.1.nid20.config="as=1 seq=0"
hint.hdaa.1.nid33.config="as=1 seq=15"
Comment 2 Nuno Teixeira freebsd_committer freebsd_triage 2022-08-26 10:20:27 UTC
(...)
#define LENOVO_L5INTEL_SUBVENDOR HDA_MODEL_CONSTRUCT(LENOVO, 0x380f)

hdac1@pci0:0:31:3:      class=0x040380 rev=0x00 hdr=0x00 vendor=0x8086 device=0x06c8 subvendor=0x17aa subdevice=0x380f
    vendor     = 'Intel Corporation'
    device     = 'Comet Lake PCH cAVS'
    class      = multimedia
    subclass   = HDA
Comment 3 Nuno Teixeira freebsd_committer freebsd_triage 2022-08-26 16:49:04 UTC
Created attachment 236133 [details]
lenovo legion 5 intel speakers

Laptop Lenovo Legion 5 15MH05 (Intel)

Without patch, only headphones works but not speakers.
Tested on 14 main-n257625-587649902329

Tests:

plug headphones: only sound on headphones
unplug headphones: sound on speakers
repeat and same results
Comment 4 Nuno Teixeira freebsd_committer freebsd_triage 2022-09-14 11:43:35 UTC
@ https://reviews.freebsd.org/D36511
Comment 5 commit-hook freebsd_committer freebsd_triage 2022-09-16 13:33:36 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=b44869cba1b391931b831135a9cefcc6ca635103

commit b44869cba1b391931b831135a9cefcc6ca635103
Author:     Nuno Teixeira <eduardo@FreeBSD.org>
AuthorDate: 2022-09-16 13:29:30 +0000
Commit:     Nuno Teixeira <eduardo@FreeBSD.org>
CommitDate: 2022-09-16 13:29:30 +0000

    sound: add patch for Lenovo Legion 5 Intel

    Laptop Legion Lenovo 5 15MH05 (Intel)

    Patch to fix the sound on this machine.
    It requires sending the speaker and the headphone jack to the same nid.

    PR:             265632
    Approved by:    emaste
    MFC after:      1 week
    Differential Revision:  https://reviews.freebsd.org/D36511

 sys/dev/sound/pci/hda/hdaa_patches.c | 3 ++-
 sys/dev/sound/pci/hda/hdac.h         | 1 +
 2 files changed, 3 insertions(+), 1 deletion(-)
Comment 6 Nuno Teixeira freebsd_committer freebsd_triage 2022-09-16 13:34:50 UTC
Committed, thanks!
Comment 7 Graham Perrin freebsd_committer freebsd_triage 2022-10-28 03:37:08 UTC
^Triage: with closure, assignment to a person. In this case: the committer who resolved the bug.
Comment 8 commit-hook freebsd_committer freebsd_triage 2023-02-05 13:41:18 UTC
A commit in branch stable/13 references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=3732e805b3f75008caf3bfc2a139d2893812457e

commit 3732e805b3f75008caf3bfc2a139d2893812457e
Author:     Nuno Teixeira <eduardo@FreeBSD.org>
AuthorDate: 2022-09-16 13:29:30 +0000
Commit:     Nuno Teixeira <eduardo@FreeBSD.org>
CommitDate: 2023-02-05 13:39:55 +0000

    sound: add patch for Lenovo Legion 5 Intel

    Laptop Legion Lenovo 5 15MH05 (Intel)

    Patch to fix the sound on this machine.
    It requires sending the speaker and the headphone jack to the same nid.

    PR:             265632
    Approved by:    emaste
    MFC after:      1 week
    Differential Revision:  https://reviews.freebsd.org/D36511

    (cherry picked from commit b44869cba1b391931b831135a9cefcc6ca635103)

 sys/dev/sound/pci/hda/hdaa_patches.c | 3 ++-
 sys/dev/sound/pci/hda/hdac.h         | 1 +
 2 files changed, 3 insertions(+), 1 deletion(-)