Bug 211743

Summary: alsa-utils crash with Dual ALC1220 Codec using MSI Godlike X570 Motherboard
Product: Drivers Reporter: Aeonik (aeonik.chaos)
Component: Sound(ALSA)Assignee: Jaroslav Kysela (perex)
Status: RESOLVED CODE_FIX    
Severity: normal CC: tiwai
Priority: P1    
Hardware: All   
OS: Linux   
Kernel Version: 5.10.15 Subsystem:
Regression: No Bisected commit-id:
Attachments: alsa-info output
Fix patch

Description Aeonik 2021-02-14 20:59:18 UTC
Created attachment 295269 [details]
alsa-info output

###Overview
I am running Arch Linux Kernel version 5.10.15 on an MSI Godlike X570 motherboard, and I believe Alsa is having issues with the Dual ALC1220 Codecs. I saw that this has been an issue before in the and looks solved, but for some reason, my Alsa utilities are crashing when trying to access my sound card (using Alsamixer and amixer).

I think this might be related to [Bug ID 195305](https://bugzilla.kernel.org/show\_bug.cgi?id=195305).

###Steps to reproduce
amixer -c 0
ALSA lib simple_none.c:1544:(simple_add1) helem (MIXER,'Master Playback Switch',0,1,0) appears twice or more
cannot load mixer controls: Invalid argument

###Expected Result
amixer should print data about my sound card.

###Actual Result
amixer crashes with the following error messages.
ALSA lib simple_none.c:1544:(simple_add1) helem (MIXER,'Master Playback Switch',0,1,0) appears twice or more
cannot load mixer controls: Invalid argument

###Build Date & Hardware:
Linux aeonik 5.10.15-arch1-1 #1 SMP PREEMPT Wed, 10 Feb 2021 18:32:40 +0000 x86_64 GNU/Linux
MSI Godlike X570 Motherboard
AMD 3900XT Processor

###Additional Information:
[Bug ID 195305](https://bugzilla.kernel.org/show_bug.cgi?id=195305) says this has been fixed, but this motherboard is apparently having the exact same issue.

I have tried solving the issue in a variety of ways, including explicitly setting the kernel module snd-hda_intel model name. I also experience the same bug in a fresh Arch Linux ISO, which rules out most configuration issues, I think.

I reviewed your documentation, and it looks like my next step is to file a bug report. I already reached out to the Arch Linux community, and you can review my post at the following link. I have also attached the output of alsa-info.sh to this post.

https://bbs.archlinux.org/viewtopic.php?pid=1949255#p1949255

Let me know if you need anything else from me, I appreciate all your work, and look forward to your response!

Aeonik
Comment 1 Takashi Iwai 2021-02-15 08:04:21 UTC
Could you try to pass the model=,dual-codecs to snd-hda-intel module (note the first comma that means an empty value for the first slot that is for Nvidia HD-audio)?

If this works, we can cook up a patch to enable the quirk easily.
Comment 2 Aeonik 2021-02-15 16:12:06 UTC
The fix worked! Thanks so much Takashi! 

I am curious what the root cause was.
Comment 3 Takashi Iwai 2021-03-03 14:25:25 UTC
There is a special setup for the boards with the dual codecs, and it's applied only for the known PCI SSID, where your device wasn't listed there.

Now I submitted and merged the fix to upstream.
Comment 4 Takashi Iwai 2021-03-03 14:25:50 UTC
Created attachment 295601 [details]
Fix patch
Comment 5 Takashi Iwai 2021-03-03 14:26:19 UTC
The fix will be included hopefully in 5.12-rc2 kernel and backported to stable trees later on.