Bug 219533

Summary: Builtin microphone doesn't work on Thinkpad p14s Gen 5 (21MES00B00)
Product: Drivers Reporter: Ilya Zverev (ilya)
Component: Sound(ALSA)Assignee: Jaroslav Kysela (perex)
Status: RESOLVED IMPLEMENTED    
Severity: normal CC: ilya
Priority: P3    
Hardware: AMD   
OS: Linux   
Kernel Version: 6.11.8 Subsystem:
Regression: No Bisected commit-id:
Attachments: Patch that possibly fixes the issue

Description Ilya Zverev 2024-11-26 07:49:46 UTC
Created attachment 307282 [details]
Patch that possibly fixes the issue

Basically the same as https://bugzilla.kernel.org/show_bug.cgi?id=216925

External microphones work, internal doesn't. I've made a patch similar to that another issue (attached), but had issues running with the recompiled kernel, so not yet sure it works.

$ lspci|grep Audio
c4:00.1 Audio device: Advanced Micro Devices, Inc. [AMD/ATI] Rembrandt Radeon High Definition Audio Controller
c4:00.5 Multimedia controller: Advanced Micro Devices, Inc. [AMD] ACP/ACP3X/ACP6x Audio Coprocessor (rev 63)
c4:00.6 Audio device: Advanced Micro Devices, Inc. [AMD] Family 17h/19h HD Audio Controller

$ arecord -l
card 1: Generic_1 [HD-Audio Generic], device 0: ALC257 Analog [ALC257 Analog]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 2: acp63 [acp63], device 0: DMIC capture dmic-hifi-0 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0

$ sudo dmidecode -t system
Handle 0x0010, DMI type 1, 27 bytes
System Information
        Manufacturer: LENOVO
        Product Name: 21MES00B00
        Version: ThinkPad P14s Gen 5 AMD
        Serial Number: PF51A2KB
        UUID: 3c98c04c-33cd-11b2-a85c-9c1ee103416e
        Wake-up Type: Power Switch
        SKU Number: LENOVO_MT_21ME_BU_Think_FM_ThinkPad P14s Gen 5 AMD
        Family: ThinkPad P14s Gen 5 AMD

$ sudo dmidecode -t baseboard
Handle 0x0011, DMI type 2, 15 bytes
Base Board Information
        Manufacturer: LENOVO
        Product Name: 21MES00B00
        Version: Not Defined
        Serial Number: L1HF46J01ZS

$ sudo dmesg | grep 'acp6x\|DMIC\|snd\|udio'
[    5.685610] snd_hda_intel 0000:c4:00.1: enabling device (0000 -> 0002)
[    5.686586] snd_hda_intel 0000:c4:00.1: Handle vga_switcheroo audio client
[    5.687232] snd_hda_intel 0000:c4:00.6: enabling device (0000 -> 0002)
[    5.713598] snd_hda_intel 0000:c4:00.1: bound 0000:c4:00.0 (ops amdgpu_dm_audio_component_bind_ops [amdgpu])
[    5.718357] input: HD-Audio Generic HDMI/DP,pcm=3 as /devices/pci0000:00/0000:00:08.1/0000:c4:00.1/sound/card0/input16
[    5.718848] input: HD-Audio Generic HDMI/DP,pcm=7 as /devices/pci0000:00/0000:00:08.1/0000:c4:00.1/sound/card0/input17
[    5.720873] input: HD-Audio Generic HDMI/DP,pcm=8 as /devices/pci0000:00/0000:00:08.1/0000:c4:00.1/sound/card0/input18
[    5.754228] snd_pci_ps 0000:c4:00.5: enabling device (0000 -> 0002)
[    5.754911] snd_hda_codec_realtek hdaudioC1D0: autoconfig for ALC257: line_outs=1 (0x14/0x0/0x0/0x0/0x0) type:speaker
[    5.754914] snd_hda_codec_realtek hdaudioC1D0:    speaker_outs=0 (0x0/0x0/0x0/0x0/0x0)
[    5.754916] snd_hda_codec_realtek hdaudioC1D0:    hp_outs=1 (0x21/0x0/0x0/0x0/0x0)
[    5.754918] snd_hda_codec_realtek hdaudioC1D0:    mono: mono_out=0x0
[    5.754919] snd_hda_codec_realtek hdaudioC1D0:    inputs:
[    5.754920] snd_hda_codec_realtek hdaudioC1D0:      Mic=0x19
Comment 1 Ilya Zverev 2024-11-27 12:38:32 UTC
Just tested the patch, and it works fine, I get sound from the mic.

Both the short "21ME" and the long "21MES00B00" work for the product name, although I don't understand why.
Comment 2 Ilya Zverev 2024-11-27 12:39:57 UTC
The problem is, I don't see "acp6x" in the dmesg output. Should I?

$ sudo dmesg | grep 'acp6x\|DMIC\|snd\|udio'
[    6.000040] snd_hda_intel 0000:c4:00.1: enabling device (0000 -> 0002)
[    6.000324] snd_hda_intel 0000:c4:00.1: Handle vga_switcheroo audio client
[    6.003989] snd_hda_intel 0000:c4:00.6: enabling device (0000 -> 0002)
[    6.016977] snd_hda_intel 0000:c4:00.1: bound 0000:c4:00.0 (ops amdgpu_dm_audio_component_bind_ops [amdgpu])
[    6.041615] input: HD-Audio Generic HDMI/DP,pcm=3 as /devices/pci0000:00/0000:00:08.1/0000:c4:00.1/sound/card0/input15
[    6.041725] input: HD-Audio Generic HDMI/DP,pcm=7 as /devices/pci0000:00/0000:00:08.1/0000:c4:00.1/sound/card0/input16
[    6.041828] input: HD-Audio Generic HDMI/DP,pcm=8 as /devices/pci0000:00/0000:00:08.1/0000:c4:00.1/sound/card0/input17
[    6.068296] snd_hda_codec_realtek hdaudioC1D0: autoconfig for ALC257: line_outs=1 (0x14/0x0/0x0/0x0/0x0) type:speaker
[    6.068301] snd_hda_codec_realtek hdaudioC1D0:    speaker_outs=0 (0x0/0x0/0x0/0x0/0x0)
[    6.068303] snd_hda_codec_realtek hdaudioC1D0:    hp_outs=1 (0x21/0x0/0x0/0x0/0x0)
[    6.068304] snd_hda_codec_realtek hdaudioC1D0:    mono: mono_out=0x0
[    6.068306] snd_hda_codec_realtek hdaudioC1D0:    inputs:
[    6.068307] snd_hda_codec_realtek hdaudioC1D0:      Mic=0x19
[    6.068317] snd_pci_ps 0000:c4:00.5: enabling device (0000 -> 0002)
[    6.108190] input: HD-Audio Generic Mic as /devices/pci0000:00/0000:00:08.1/0000:c4:00.6/sound/card1/input18
[    6.108296] input: HD-Audio Generic Headphone as /devices/pci0000:00/0000:00:08.1/0000:c4:00.6/sound/card1/input19
Comment 3 Ilya Zverev 2024-11-27 13:52:31 UTC
Patch submitted: https://lore.kernel.org/all/20241127134420.14471-1-ilya@zverev.info/