Bug 216590

Summary: No internal microphone available on Alienware m17 R5 (AMD ACP/ACP3X/ACP6X Audio Coprocessor)
Product: Drivers Reporter: Brent Mendelsohn (mendiebm)
Component: Sound(ALSA)Assignee: Jaroslav Kysela (perex)
Status: RESOLVED CODE_FIX    
Severity: normal CC: mario.limonciello, mendiebm
Priority: P1    
Hardware: AMD   
OS: Linux   
See Also: https://bugzilla.kernel.org/show_bug.cgi?id=216270
https://bugzilla.kernel.org/show_bug.cgi?id=216299
Kernel Version: 5.19.13 Subsystem:
Regression: No Bisected commit-id:

Description Brent Mendelsohn 2022-10-15 11:18:07 UTC
This is an AMD model, with a Realtek ALC3254 and "Digital-array microphones in camera assembly) (specs from https://dl.dell.com/content/manual7958950-alienware-m17-r5-amd-setup-and-specifications.pdf?language=en-us&ps=true)

[mendie@aw-m17 ~/rpmbuild/SOURCES]$ lspci -nn | grep Audio
03:00.1 Audio device [0403]: Advanced Micro Devices, Inc. [AMD/ATI] Navi 21/23 HDMI/DP Audio Controller [1002:ab28]
36:00.1 Audio device [0403]: Advanced Micro Devices, Inc. [AMD/ATI] Rembrandt Radeon High Definition Audio Controller [1002:1640]
36:00.5 Multimedia controller [0480]: Advanced Micro Devices, Inc. [AMD] ACP/ACP3X/ACP6x Audio Coprocessor [1022:15e2] (rev 60)
36:00.6 Audio device [0403]: Advanced Micro Devices, Inc. [AMD] Family 17h/19h HD Audio Controller [1022:15e3]

Audio output is ok, but the internal microphone is not shown - only the combo headphone/microphone jack. 

It seems this is the same problem as https://bbs.archlinux.org/viewtopic.php?id=278886, and also reported in https://bugzilla.kernel.org/show_bug.cgi?id=216270 and https://bugzilla.kernel.org/show_bug.cgi?id=216299.

modifying acp6x-mach.c to include the device shows a microphone, which can now be used

--- a/sound/soc/amd/yc/acp6x-mach.c
+++ b/sound/soc/amd/yc/acp6x-mach.c
@@ -143,6 +143,13 @@ static const struct dmi_system_id yc_acp_quirk_table[] = {
                        DMI_MATCH(DMI_PRODUCT_NAME, "21CL"),
                }
        },
+       {
+               .driver_data = &acp6x_card,
+               .matches = {
+                       DMI_MATCH(DMI_BOARD_VENDOR, "Alienware"),
+                       DMI_MATCH(DMI_PRODUCT_NAME, "Alienware m17 R5 AMD"),
+               }
+       },
        {}
 };

This device only has 2 speakers, so https://github.com/alsa-project/alsa-ucm-conf/issues/215 doesn't seem to be a problem, although I will look into this as well.
Comment 1 Brent Mendelsohn 2022-10-15 11:21:08 UTC
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/tree/sound/soc/amd/yc/acp6x-mach.c?h=v6.0.2 shows only quirks for Lenovo models, and https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git/tree/sound/soc/amd/yc/acp6x-mach.c has the extra one for the Asus model, but the Alienware model does not appear to be covered
Comment 2 Mario Limonciello (AMD) 2022-10-20 03:00:47 UTC
As you already identified the solution would you mind submitting a patch to the mailing list for this?
Comment 3 Brent Mendelsohn 2022-10-20 21:56:06 UTC
I'll give it a go. I've never done a kernel patch submission before though, so I'll need to have a look at how that should be done. Just to confirm - checking the MAINTAINERS file it would be to alsa-devel@alsa-project.org right? Thanks!
Comment 4 Brent Mendelsohn 2022-10-20 22:20:58 UTC
(In reply to Brent Mendelsohn from comment #3)
> I'll give it a go. I've never done a kernel patch submission before though,
> so I'll need to have a look at how that should be done. Just to confirm -
> checking the MAINTAINERS file it would be to alsa-devel@alsa-project.org
> right? Thanks!

My apologies for replying without having done my homework. I have found previous submissions to this file for the other models as https://mailman.alsa-project.org/pipermail/alsa-devel/2022-October/206838.html and https://mailman.alsa-project.org/pipermail/alsa-devel/2022-October/206839.html. I will post to that list.
Comment 5 Mario Limonciello (AMD) 2022-10-21 13:05:11 UTC
Great thanks!  A few suggestions to help you with your first time submitting a patch:

1) in the commit message you should add a Link: back to this bug. 
2) Make sure that address it to the maintainers in the subsystem too (Mark Brown) so they're not missed.
3) You can CC Syed and I too if you want and one of us can review your submission and if it looks good add a Reviewed-by response.
Comment 6 Brent Mendelsohn 2022-12-07 18:19:21 UTC
Confirming as fixed by 
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=linux-6.0.y&id=dba5186f836a76245863eff143b3e7353eed26b8
in 6.0.11. Thanks all, especially Mario, for bumping this along.