Bug 290496 - fix speaker not configured properly on Lenovo Laptops w/ Realtek ALC257 codec
Summary: fix speaker not configured properly on Lenovo Laptops w/ Realtek ALC257 codec
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: 16.0-CURRENT
Hardware: Any Any
: --- Affects Some People
Assignee: Christos Margiolis
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-10-25 03:42 UTC by Adrian Chadd
Modified: 2025-11-24 12:26 UTC (History)
2 users (show)

See Also:


Attachments
pciconf.txt (7.58 KB, text/plain)
2025-10-25 03:42 UTC, Adrian Chadd
no flags Details
dmesg-boot.txt (89.60 KB, text/plain)
2025-10-25 03:44 UTC, Adrian Chadd
no flags Details
pinmux - no speaker audio, no headphone connected (1.46 KB, text/plain)
2025-10-25 03:45 UTC, Adrian Chadd
no flags Details
pinmux - audio works with headphone attached in (1.45 KB, text/plain)
2025-10-25 03:46 UTC, Adrian Chadd
no flags Details
pinmux - audio works with speakers (and yes headphones too), after the hints (1.45 KB, text/plain)
2025-10-25 03:46 UTC, Adrian Chadd
no flags Details
initial patch (1.12 KB, patch)
2025-11-03 16:24 UTC, Christos Margiolis
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Adrian Chadd freebsd_committer freebsd_triage 2025-10-25 03:42:32 UTC
Created attachment 264866 [details]
pciconf.txt

I recently acquired a Lenovo V15 G4 laptop (an AMD laptop) and although headphone output works fine, speaker output does not.

After some digging the speaker was labeled as "disconnected" and thus never had audio routed to it.

Adding this to /boot/device.hints fixed it:

```
hint.hdaa.1.nid20.config="as=1 seq=0 device=speakers"
hint.hdaa.1.nid33.config="as=1 seq=15 device=Headphones"
```

but I figure it'd be nice to have the mux work properly out of the box.

I'm not the first person with this problem either! See https://forums.freebsd.org/threads/lenovo-ideapad-3i-realtek-alc257-without-sound-and-mic.93980/ who ended up with the same answer.
Comment 1 Adrian Chadd freebsd_committer freebsd_triage 2025-10-25 03:44:01 UTC
Created attachment 264867 [details]
dmesg-boot.txt
Comment 2 Adrian Chadd freebsd_committer freebsd_triage 2025-10-25 03:45:55 UTC
Created attachment 264868 [details]
pinmux - no speaker audio, no headphone connected
Comment 3 Adrian Chadd freebsd_committer freebsd_triage 2025-10-25 03:46:15 UTC
Created attachment 264869 [details]
pinmux - audio works with headphone attached in
Comment 4 Adrian Chadd freebsd_committer freebsd_triage 2025-10-25 03:46:37 UTC
Created attachment 264870 [details]
pinmux - audio works with speakers (and yes headphones too), after the hints
Comment 5 Christos Margiolis freebsd_committer freebsd_triage 2025-11-03 16:24:40 UTC
Created attachment 265133 [details]
initial patch

Does this fix the issue? Make sure you have the hints removed.
Comment 6 Christos Margiolis freebsd_committer freebsd_triage 2025-11-12 20:37:56 UTC
Bump.
Comment 7 Adrian Chadd freebsd_committer freebsd_triage 2025-11-16 21:55:53 UTC
(In reply to Christos Margiolis from comment #6)

yup! tested and works great. please land!
Comment 8 commit-hook freebsd_committer freebsd_triage 2025-11-17 16:10:32 UTC
A commit in branch main references this bug:

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

commit 5f624d923db0f2fb33990948cffdc24da44deaa8
Author:     Christos Margiolis <christos@FreeBSD.org>
AuthorDate: 2025-11-17 16:09:18 +0000
Commit:     Christos Margiolis <christos@FreeBSD.org>
CommitDate: 2025-11-17 16:09:18 +0000

    snd_hda: Patch Lenovo V15

    PR:             290496
    Tested by:      adrian
    Sponsored by:   The FreeBSD Foundation
    MFC after:      1 week

 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 9 commit-hook freebsd_committer freebsd_triage 2025-11-24 12:26:24 UTC
A commit in branch stable/15 references this bug:

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

commit 4991bb6a5c45b518df9b1a265c4f6f8c17ea4493
Author:     Christos Margiolis <christos@FreeBSD.org>
AuthorDate: 2025-11-17 16:09:18 +0000
Commit:     Christos Margiolis <christos@FreeBSD.org>
CommitDate: 2025-11-24 12:25:19 +0000

    snd_hda: Patch Lenovo V15

    PR:             290496
    Tested by:      adrian
    Sponsored by:   The FreeBSD Foundation
    MFC after:      1 week

    (cherry picked from commit 5f624d923db0f2fb33990948cffdc24da44deaa8)

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