Bugzilla – Bug 1228269
Internal microphone not working on Lenovo Thinkpad E16 Gen 2 (Model 21M5)
Last modified: 2024-07-26 16:56:51 UTC
Created attachment 876227 [details] Output of arecord --list-devices Running Leap 15.6 as distributed, apart from the kernel parameter trace_clock=local. Leap 15.6 is up-to-date. Kernel release is 6.4.0-150600.23.14-default. My machine is a new Lenovo Thinkpad E16 Gen 2 (model 21M5) laptop with an AMD Rembrandt Radeon High Definition Audio card. The Thinkpad BIOS version is R2KET24W v1.07 (which it was shipped with), although v1.06 is the latest BIOS version showing for my model on Lenovo's support page : https://pcsupport.lenovo.com/gb/en/products/laptops-and-netbooks/thinkpad-edge-laptops/thinkpad-e16-gen-2-type-21m5-21m6/21m5/21m5cto1ww/pf51p4m9/downloads/driver-list/component?name=BIOS%2FUEFI&id=5AC6A815-321D-440E-8833-B07A93E0428C The laptop has a function button (F4) to turn the microphone on and off - I have tried in Linux both with it on and off and no joy. The function button lights up or the light turns off when pressed. There is a toggle setting in the BIOS settings where you can set it so that the microphone function is operated with either (F4) or (Fn + F4). Both sound input and output work fine in Windows 11, either with or without a headphone plugged in. I did have to enable the internal microphone in Windows Control Panel -Hardware and Sound - Device Manager - Sound, video and Game Controllers - AMD High Definition Audio Device - Properties - Driver before I could get it to work. In Leap 15.6, if I plug a headphone in, both input and output sound work. If no headphone is plugged in, the internal speakers work, but the internal microphone doesn't. KDE Audio Settings shows AMD Rembrandt Radeon High Definition Audio under "Inactive Cards", with Profile "Off" and no other profile options to choose. I am attaching some diagnostic outputs. Happy to send more diagnostics if wanted.
Created attachment 876228 [details] Output of lspci -vk
Created attachment 876229 [details] Output of lsmod
Created attachment 876230 [details] alsa-info
Created attachment 876231 [details] Output of inxi -Axxx
Created attachment 876232 [details] Output of dmesg shortly after boot
Created attachment 876233 [details] Output of hwinfo
(In reply to tigerlily from comment #0) > In Leap 15.6, if I plug a headphone in, both input and output sound work. If > no headphone is plugged in, the internal speakers work, but the internal > microphone doesn't. What does the above mean exactly (about the headphone plugged in)? Does the "internal" mic work when you plug the headphone? Or you're testing the (external) headset mic?
(In reply to Takashi Iwai from comment #7) > (In reply to tigerlily from comment #0) > > In Leap 15.6, if I plug a headphone in, both input and output sound work. If > > no headphone is plugged in, the internal speakers work, but the internal > > microphone doesn't. > > What does the above mean exactly (about the headphone plugged in)? > Does the "internal" mic work when you plug the headphone? Or you're testing > the (external) headset mic? Apologies if I was unclear. Testing with aplay and arecord, if I plug a headphone in, the headphone records and plays (and there is no sound from the internal speakers). If there is no headphone plugged in, the internal speakers play but the internal microphone doesn't record, whether the light on the keyboard F4 button is illuminated or not.
(In reply to tigerlily from comment #8) > (In reply to Takashi Iwai from comment #7) > > (In reply to tigerlily from comment #0) > > > In Leap 15.6, if I plug a headphone in, both input and output sound work. If > > > no headphone is plugged in, the internal speakers work, but the internal > > > microphone doesn't. > > > > What does the above mean exactly (about the headphone plugged in)? > > Does the "internal" mic work when you plug the headphone? Or you're testing > > the (external) headset mic? > > Apologies if I was unclear. Testing with aplay and arecord, if I plug a > headphone in, the headphone records and plays (and there is no sound from > the internal speakers). Do you mean a "headset", right? That is, a mic is on the headphone. (In theory, you can record even directly from a headphone, by re-configuring the pin direction, but I don't think you did that :) > If there is no headphone plugged in, the internal > speakers play but the internal microphone doesn't record, whether the light > on the keyboard F4 button is illuminated or not. That's no wonder. At least BIOS doesn't specify any built-in microphone as the HD-audio pin configuration, hence there is only a single input source, and that's likely a headset mic. On many AMD machines, there is a dedicated digital mic device. But strangely it's not found on your machine, judging from alsa-info.sh output. To be sure, could you install 6.10.x kernel from OBS Kernel:stable:Backport repo, and test with that? Please give alsa-info.sh, dmesg and hwinfo outputs from that.
(In reply to Takashi Iwai from comment #9) > On many AMD machines, there is a dedicated digital mic device. But > strangely it's not found on your machine, judging from alsa-info.sh output. Correction: the driver has been loaded (snd_pci_acp6x), but there is no sound card probed, by some reason. > To be sure, could you install 6.10.x kernel from OBS Kernel:stable:Backport > repo, and test with that? Please give alsa-info.sh, dmesg and hwinfo > outputs from that. ... so please try the above. If it's still a problem with 6.10.x kernel, we need to ping AMD devs. OTOH, if it works, I can try backporting the fix.
I'm building a test kernel with a quirk addition for your device. If 6.10.x kernel still doesn't work, please try later the kernel in OBS home:tiwai:bsc1228269 repo, which will be available (once after the build finishes) at: http://download.opensuse.org/repositories/home:/tiwai:/bsc1228269/pool/ Oh, BTW, 6.10.x kernel in OBS Kernel:stable:Backport repo is available at: http://download.opensuse.org/repositories/Kernel:/stable:/Backport/standard/
Created attachment 876239 [details] Output of alsa-info with kernel 6.10.0-lp155.4.gcee765e-default running
Created attachment 876240 [details] Output of hwinfo with kernel 6.10.0-lp155.4.gcee765e-default running
Created attachment 876241 [details] Output of with kernel 6.10.0-lp155.4.gcee765e-default running
(In reply to Takashi Iwai from comment #10) > (In reply to Takashi Iwai from comment #9) > > On many AMD machines, there is a dedicated digital mic device. But > > strangely it's not found on your machine, judging from alsa-info.sh output. > > Correction: the driver has been loaded (snd_pci_acp6x), but there is no > sound card probed, by some reason. > > > To be sure, could you install 6.10.x kernel from OBS Kernel:stable:Backport > > repo, and test with that? Please give alsa-info.sh, dmesg and hwinfo > > outputs from that. > > ... so please try the above. If it's still a problem with 6.10.x kernel, we > need to ping AMD devs. OTOH, if it works, I can try backporting the fix. I tried with kernel 6.10.0-lp155.4.gcee765e-default but the internal microphone still didn't work. KDE Audio Settings only showed speakers, no Inactive Cards. I have attached alsa-info.sh, dmesg and hwinfo outputs. Although pressing F4 on the keyboard made the key light up, pressing it again didn't turn the light off. And yes, it was a headset, not a headphone :-) Will try your special kernel next.
(In reply to Takashi Iwai from comment #11) > I'm building a test kernel with a quirk addition for your device. If 6.10.x > kernel still doesn't work, please try later the kernel in OBS > home:tiwai:bsc1228269 repo, which will be available (once after the build > finishes) at: > http://download.opensuse.org/repositories/home:/tiwai:/bsc1228269/pool/ > > Oh, BTW, 6.10.x kernel in OBS Kernel:stable:Backport repo is available at: > > http://download.opensuse.org/repositories/Kernel:/stable:/Backport/standard/ That made a huge difference. Running kernel 6.4.0-150600.1.gccaea45-default, all seems to be working ! I spent quite a lot of time testing sound, but I couldn't find anything that didn't work.
I do notice one slight thing with the kernel 6.4.0-150600.1.gccaea45-default, which is that there is an audible blip on shutdown, just before a Lenovo splash screen with the openSUSE logo at the bottom displays.
Good to hear that the quirk works. I submitted the fix patch to the upstream now. I'm going to backport it to Leap 15.6 and TW kernels later. About the noise at shutdown: does it happen if you mute the speaker volume before shutdown, too?
(In reply to Takashi Iwai from comment #18) > Good to hear that the quirk works. I submitted the fix patch to the > upstream now. I'm going to backport it to Leap 15.6 and TW kernels later. > > About the noise at shutdown: does it happen if you mute the speaker volume > before shutdown, too? No, I don't hear any blip if the speaker is muted before shutdown. I have noticed, though, that if I record something through the internal mic and then play that recording back through the internal speakers, there is an audible blip at the start and end of the recording. If I play some pre-existing audio file, there are no blips. That makes me think the internal mic is recording a blip at the start and end of the recording.
OK, the click noise at shutdown could be worked around by implementing the forcible mute at shutdown. I prepared a test patch, and am now building a test kernel at OBS home:tiwai:bsc1228269-2 repo. The kernel package will be available later at http://download.opensuse.org/repositories/home:/tiwai:/bsc1228269-2/pool/ Please give it a try later. FWIW, the upstream submission of the fix for the mic was https://lore.kernel.org/20240725065442.9293-1-tiwai@suse.de It's already included in SLE15-SP6 git branch for Leap 15.6 update.
Created attachment 876269 [details] Workaround for noise at shutdown
(In reply to Takashi Iwai from comment #21) > Created attachment 876269 [details] > Workaround for noise at shutdown I tried the kernel from http://download.opensuse.org/repositories/home:/tiwai:/bsc1228269-2/pool/, and with this kernel : The audible blip at shutdown has disappeared. Recordings made with the internal microphone have an audible blip at the start, but not at the end. Recordings made with the headset also have an audible blip at the start, but not at the end.
The noise at recording is a bug in the ASoC AMD driver. We need to ping AMD guys. I reorganized the fix patch for the speaker noise, and yet another test kernel is being built in OBS home:tiwai:bsc1228269-3 repo. A package will be available later at http://download.opensuse.org/repositories/home:/tiwai:/bsc1228269-3/pool/ Please give it a try later again. Once after confirming this kernel works, I'll submit it to the upstream and backport to Leap 15.6 kernel for the next update.
Created attachment 876289 [details] Workaround for noise at shutdown
(In reply to Takashi Iwai from comment #23) > The noise at recording is a bug in the ASoC AMD driver. We need to ping AMD > guys. > > I reorganized the fix patch for the speaker noise, and yet another test > kernel is being built in OBS home:tiwai:bsc1228269-3 repo. > A package will be available later at > http://download.opensuse.org/repositories/home:/tiwai:/bsc1228269-3/pool/ > Please give it a try later again. Once after confirming this kernel works, > I'll submit it to the upstream and backport to Leap 15.6 kernel for the next > update. With kernel 6.4.0-150600.1.gdc73025-default: The headset mic did not record any audible blips, but the internal mic seemed to record an audible blip at both the beginning and end of the recording. Shutdown was silent. All else seemed fine, although I did think it was strange that you can select a profile "Play HiFi quality Music (Headphones, Mic1, Mic2)" when no headset or headphone is plugged in. Not sure if that is expected behaviour.
Thanks for confirmation. So it indicates that the remaining click noise bug is specific to ASoC AMD driver. I submitted the fix patches for the shutdown noise to the upstream, and backported to SLE15-SP6 git branch now.
(In reply to Takashi Iwai from comment #26) > Thanks for confirmation. So it indicates that the remaining click noise bug > is specific to ASoC AMD driver. > > I submitted the fix patches for the shutdown noise to the upstream, and > backported to SLE15-SP6 git branch now. Many thanks for your help