Created attachment 297069 [details] Commands Output Latest freshly compiled kernel - 5.12.6-custom, sound card gets seen by lspci but it does not get detected by "pacmd list-cards", "aplay -l" and others so I can't switch to it and utilize it. Problem exists across all distributions I have tried: Fedora 34, Manjaro 21.0.5, OpenSuSE 15.3 as well as vanilla Ubuntu with 5.8.0-53-generic. ------------------------------------------------------------------------------ Motherboard: AsRock B550 Taichi CPU: AMD Ryzen 5950x BIOS Version: P1.90 kernel: 5.12.6-custom (compiled about an hour ago) OS: Ubuntu 20.04.2 LTS ------------------------------------------------------------------------------ About the kernel, there is nothing really custom about it, all I did is change "CONFIG_SND_HDA_INTEL=m" to "CONFIG_SND_HDA_INTEL=y" for the sake of testing. Super-usered "lspci -vv" attached, the appropriate section is the last one at the very bottom: "0d:00.4 Audio device: Advanced Micro Devices, Inc. [AMD] Starship/Matisse HD Audio Controller" ------------------------------------------------------------------------------ Output of non-superusered "lspci -vv" (non-super-usered version) ------------------------------------------------------------------------------ "0d:00.4 Audio device: Advanced Micro Devices, Inc. [AMD] Starship/Matisse HD Audio Controller Subsystem: ASRock Incorporation Starship/Matisse HD Audio Controller Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx+ Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx- Latency: 0, Cache Line Size: 64 bytes Interrupt: pin D routed to IRQ 127 Region 0: Memory at fcc00000 (32-bit, non-prefetchable) [size=32K] Capabilities: <access denied> Kernel driver in use: snd_hda_intel Kernel modules: snd_hda_intel" ------------------------------------------------------------------------------ Output of superusered version "lspci -vv" ------------------------------------------------------------------------------ 0d:00.4 Audio device: Advanced Micro Devices, Inc. [AMD] Starship/Matisse HD Audio Controller Subsystem: ASRock Incorporation Starship/Matisse HD Audio Controller Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx+ Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx- Latency: 0, Cache Line Size: 64 bytes Interrupt: pin D routed to IRQ 127 Region 0: Memory at fcc00000 (32-bit, non-prefetchable) [size=32K] Capabilities: [48] Vendor Specific Information: Len=08 <?> Capabilities: [50] Power Management version 3 Flags: PMEClk- DSI- D1- D2- AuxCurrent=0mA PME(D0+,D1-,D2-,D3hot+,D3cold+) Status: D3 NoSoftRst+ PME-Enable+ DSel=0 DScale=0 PME- Capabilities: [64] Express (v2) Endpoint, MSI 00 DevCap: MaxPayload 256 bytes, PhantFunc 0, Latency L0s <4us, L1 unlimited ExtTag+ AttnBtn- AttnInd- PwrInd- RBE+ FLReset+ SlotPowerLimit 0.000W DevCtl: CorrErr- NonFatalErr- FatalErr- UnsupReq- RlxdOrd+ ExtTag+ PhantFunc- AuxPwr- NoSnoop+ FLReset- MaxPayload 256 bytes, MaxReadReq 512 bytes DevSta: CorrErr+ NonFatalErr- FatalErr- UnsupReq+ AuxPwr- TransPend- LnkCap: Port #0, Speed 16GT/s, Width x16, ASPM L0s L1, Exit Latency L0s <64ns, L1 <1us ClockPM- Surprise- LLActRep- BwNot- ASPMOptComp+ LnkCtl: ASPM Disabled; RCB 64 bytes Disabled- CommClk+ ExtSynch- ClockPM- AutWidDis- BWInt- AutBWInt- LnkSta: Speed 16GT/s (ok), Width x16 (ok) TrErr- Train- SlotClk+ DLActive- BWMgmt- ABWMgmt- DevCap2: Completion Timeout: Range ABCD, TimeoutDis+, NROPrPrP-, LTR- 10BitTagComp+, 10BitTagReq-, OBFF Not Supported, ExtFmt-, EETLPPrefix- EmergencyPowerReduction Not Supported, EmergencyPowerReductionInit- FRS-, TPHComp+, ExtTPHComp- AtomicOpsCap: 32bit- 64bit- 128bitCAS- DevCtl2: Completion Timeout: 50us to 50ms, TimeoutDis-, LTR-, OBFF Disabled AtomicOpsCtl: ReqEn- LnkSta2: Current De-emphasis Level: -3.5dB, EqualizationComplete-, EqualizationPhase1- EqualizationPhase2-, EqualizationPhase3-, LinkEqualizationRequest- Capabilities: [a0] MSI: Enable+ Count=1/1 Maskable- 64bit+ Address: 00000000fee0f000 Data: 0023 Capabilities: [100 v1] Vendor Specific Information: ID=0001 Rev=1 Len=010 <?> Capabilities: [150 v2] Advanced Error Reporting UESta: DLP- SDES- TLP- FCP- CmpltTO- CmpltAbrt- UnxCmplt- RxOF- MalfTLP- ECRC- UnsupReq- ACSViol- UEMsk: DLP- SDES- TLP- FCP- CmpltTO- CmpltAbrt- UnxCmplt- RxOF- MalfTLP- ECRC- UnsupReq- ACSViol- UESvrt: DLP+ SDES+ TLP- FCP+ CmpltTO- CmpltAbrt- UnxCmplt- RxOF+ MalfTLP+ ECRC- UnsupReq- ACSViol- CESta: RxErr- BadTLP- BadDLLP- Rollover- Timeout- AdvNonFatalErr+ CEMsk: RxErr- BadTLP- BadDLLP- Rollover- Timeout- AdvNonFatalErr+ AERCap: First Error Pointer: 00, ECRCGenCap- ECRCGenEn- ECRCChkCap- ECRCChkEn- MultHdrRecCap- MultHdrRecEn- TLPPfxPres- HdrLogCap- HeaderLog: 00000000 00000000 00000000 00000000 Capabilities: [2a0 v1] Access Control Services ACSCap: SrcValid- TransBlk- ReqRedir- CmpltRedir- UpstreamFwd- EgressCtrl- DirectTrans- ACSCtl: SrcValid- TransBlk- ReqRedir- CmpltRedir- UpstreamFwd- EgressCtrl- DirectTrans- Capabilities: [370 v1] Transaction Processing Hints Device specific mode supported Steering table in TPH capability structure Kernel driver in use: snd_hda_intel Kernel modules: snd_hda_intel ------------------------------------------------------------------------------ Output of "dmesg | grep snd_hda_intel" ------------------------------------------------------------------------------ [ 4.751717] snd_hda_intel 0000:0b:00.1: enabling device (0000 -> 0002) [ 4.751780] snd_hda_intel 0000:0b:00.1: Disabling MSI [ 4.751786] snd_hda_intel 0000:0b:00.1: Handle vga_switcheroo audio client [ 4.751847] snd_hda_intel 0000:0d:00.4: enabling device (0000 -> 0002) [ 4.755108] snd_hda_intel 0000:0d:00.4: no codecs found! [ 5.000977] snd_hda_intel 0000:0b:00.1: bound 0000:0b:00.0 (ops nv50_audio_component_bind_ops [nouveau]) ------------------------------------------------------------------------------ Output of "ls -l /proc/asound/" ------------------------------------------------------------------------------ dr-xr-xr-x 27 root root 0 May 31 19:01 card0 dr-xr-xr-x 3 root root 0 May 31 19:01 card1 -r--r--r-- 1 root root 0 May 31 19:30 cards -r--r--r-- 1 root root 0 May 31 19:30 devices lrwxrwxrwx 1 root root 5 May 31 19:30 Generic -> card1 -r--r--r-- 1 root root 0 May 31 19:30 hwdep -r--r--r-- 1 root root 0 May 31 19:30 modules lrwxrwxrwx 1 root root 5 May 31 19:30 NVidia -> card0 dr-xr-xr-x 4 root root 0 May 31 19:30 oss -r--r--r-- 1 root root 0 May 31 19:30 pcm dr-xr-xr-x 6 root root 0 May 31 19:30 seq -r--r--r-- 1 root root 0 May 31 19:30 timers -r--r--r-- 1 root root 0 May 31 19:30 version ------------------------------------------------------------------------------ Output of "ls -l /proc/asound/card0" (irrelevant, nvidia but attached) ------------------------------------------------------------------------------ -r--r--r-- 1 root root 0 May 31 19:32 codec#0 -rw-r--r-- 1 root root 0 May 31 19:32 eld#0.0 -rw-r--r-- 1 root root 0 May 31 19:32 eld#0.1 -rw-r--r-- 1 root root 0 May 31 19:32 eld#0.10 -rw-r--r-- 1 root root 0 May 31 19:32 eld#0.11 -rw-r--r-- 1 root root 0 May 31 19:32 eld#0.12 -rw-r--r-- 1 root root 0 May 31 19:32 eld#0.13 -rw-r--r-- 1 root root 0 May 31 19:32 eld#0.14 -rw-r--r-- 1 root root 0 May 31 19:32 eld#0.15 -rw-r--r-- 1 root root 0 May 31 19:32 eld#0.2 -rw-r--r-- 1 root root 0 May 31 19:32 eld#0.3 -rw-r--r-- 1 root root 0 May 31 19:32 eld#0.4 -rw-r--r-- 1 root root 0 May 31 19:32 eld#0.5 -rw-r--r-- 1 root root 0 May 31 19:32 eld#0.6 -rw-r--r-- 1 root root 0 May 31 19:32 eld#0.7 -rw-r--r-- 1 root root 0 May 31 19:32 eld#0.8 -rw-r--r-- 1 root root 0 May 31 19:32 eld#0.9 -r--r--r-- 1 root root 0 May 31 19:32 id dr-xr-xr-x 4 root root 0 May 31 19:01 pcm10p dr-xr-xr-x 4 root root 0 May 31 19:01 pcm11p dr-xr-xr-x 4 root root 0 May 31 19:01 pcm12p dr-xr-xr-x 4 root root 0 May 31 19:01 pcm3p dr-xr-xr-x 4 root root 0 May 31 19:01 pcm7p dr-xr-xr-x 4 root root 0 May 31 19:01 pcm8p dr-xr-xr-x 4 root root 0 May 31 19:01 pcm9p ------------------------------------------------------------------------------ Output of "ls -l /proc/asound/card1" ------------------------------------------------------------------------------ -r--r--r-- 1 root root 0 May 31 19:31 id ------------------------------------------------------------------------------ Output of "cat /proc/asound/card1/id" ------------------------------------------------------------------------------ Generic ------------------------------------------------------------------------------ Output of "cat /proc/asound/cards" ------------------------------------------------------------------------------ 0 [NVidia ]: HDA-Intel - HDA NVidia HDA NVidia at 0xfc080000 irq 125 1 [Generic ]: HDA-Intel - HD-Audio Generic HD-Audio Generic at 0xfcc00000 irq 127 ------------------------------------------------------------------------------ Output of "cat /proc/asound/modules" ------------------------------------------------------------------------------ 0 snd_hda_intel 1 snd_hda_intel ------------------------------------------------------------------------------ Output of "ls -l /proc/asound/Generic" ------------------------------------------------------------------------------ lrwxrwxrwx 1 root root 5 May 31 19:30 /proc/asound/Generic -> card1 ------------------------------------------------------------------------------ Output of "ls -l /proc/asound/NVidia" (working) ------------------------------------------------------------------------------ lrwxrwxrwx 1 root root 5 May 31 19:30 /proc/asound/NVidia -> card0 ------------------------------------------------------------------------------ Output of "cat /proc/asound/version" ------------------------------------------------------------------------------ Advanced Linux Sound Architecture Driver Version k5.12.6-custom. ------------------------------------------------------------------------------ Output of "pacmd list-cards" ------------------------------------------------------------------------------ 1 card(s) available. index: 0 name: <alsa_card.pci-0000_0b_00.1> driver: <module-alsa-card.c> owner module: 7 properties: alsa.card = "0" alsa.card_name = "HDA NVidia" alsa.long_card_name = "HDA NVidia at 0xfc080000 irq 125" alsa.driver_name = "snd_hda_intel" device.bus_path = "pci-0000:0b:00.1" sysfs.path = "/devices/pci0000:00/0000:00:03.1/0000:0b:00.1/sound/card0" device.bus = "pci" device.vendor.id = "10de" device.vendor.name = "NVIDIA Corporation" device.product.id = "1aeb" device.product.name = "TU116 High Definition Audio Controller" device.string = "0" device.description = "TU116 High Definition Audio Controller" module-udev-detect.discovered = "1" device.icon_name = "audio-card-pci" profiles: output:hdmi-stereo: Digital Stereo (HDMI) Output (priority 5900, available: unknown) output:hdmi-stereo-extra1: Digital Stereo (HDMI 2) Output (priority 5700, available: no) output:hdmi-surround-extra1: Digital Surround 5.1 (HDMI 2) Output (priority 600, available: no) output:hdmi-surround71-extra1: Digital Surround 7.1 (HDMI 2) Output (priority 600, available: no) output:hdmi-stereo-extra2: Digital Stereo (HDMI 3) Output (priority 5700, available: no) output:hdmi-surround-extra2: Digital Surround 5.1 (HDMI 3) Output (priority 600, available: no) output:hdmi-surround71-extra2: Digital Surround 7.1 (HDMI 3) Output (priority 600, available: no) output:hdmi-stereo-extra3: Digital Stereo (HDMI 4) Output (priority 5700, available: no) output:hdmi-surround-extra3: Digital Surround 5.1 (HDMI 4) Output (priority 600, available: no) output:hdmi-surround71-extra3: Digital Surround 7.1 (HDMI 4) Output (priority 600, available: no) output:hdmi-stereo-extra4: Digital Stereo (HDMI 5) Output (priority 5700, available: no) output:hdmi-surround-extra4: Digital Surround 5.1 (HDMI 5) Output (priority 600, available: no) output:hdmi-surround71-extra4: Digital Surround 7.1 (HDMI 5) Output (priority 600, available: no) output:hdmi-stereo-extra5: Digital Stereo (HDMI 6) Output (priority 5700, available: no) output:hdmi-surround-extra5: Digital Surround 5.1 (HDMI 6) Output (priority 600, available: no) output:hdmi-surround71-extra5: Digital Surround 7.1 (HDMI 6) Output (priority 600, available: no) output:hdmi-stereo-extra6: Digital Stereo (HDMI 7) Output (priority 5700, available: no) output:hdmi-surround-extra6: Digital Surround 5.1 (HDMI 7) Output (priority 600, available: no) output:hdmi-surround71-extra6: Digital Surround 7.1 (HDMI 7) Output (priority 600, available: no) off: Off (priority 0, available: unknown) active profile: <output:hdmi-stereo> sinks: alsa_output.pci-0000_0b_00.1.hdmi-stereo/#0: TU116 High Definition Audio Controller Digital Stereo (HDMI) sources: alsa_output.pci-0000_0b_00.1.hdmi-stereo.monitor/#0: Monitor of TU116 High Definition Audio Controller Digital Stereo (HDMI) ports: hdmi-output-0: HDMI / DisplayPort (priority 5900, latency offset 0 usec, available: yes) properties: device.icon_name = "video-display" device.product.name = "VX2363 Series" hdmi-output-1: HDMI / DisplayPort 2 (priority 5800, latency offset 0 usec, available: no) properties: device.icon_name = "video-display" hdmi-output-2: HDMI / DisplayPort 3 (priority 5700, latency offset 0 usec, available: no) properties: device.icon_name = "video-display" hdmi-output-3: HDMI / DisplayPort 4 (priority 5600, latency offset 0 usec, available: no) properties: device.icon_name = "video-display" hdmi-output-4: HDMI / DisplayPort 5 (priority 5500, latency offset 0 usec, available: no) properties: device.icon_name = "video-display" hdmi-output-5: HDMI / DisplayPort 6 (priority 5400, latency offset 0 usec, available: no) properties: device.icon_name = "video-display" hdmi-output-6: HDMI / DisplayPort 7 (priority 5300, latency offset 0 usec, available: no) properties: device.icon_name = "video-display" This is what I have tried that does not resolve the issue: echo "0000:0b:00.1" > /sys/bus/pci/drivers/snd_hda_intel/unbind modprobe -r snd_hda_intel modprobe snd_hda_intel probe_mask=0x103 echo "0000:0b:00.1" > /sys/bus/pci/drivers/snd_hda_intel/unbind modprobe -r snd_hda_intel modprobe snd_hda_intel probe_mask=0xff I found the error message in "hda_intel.c" on line 2004 and then I saw this, not sure how related is (I am not a kernel hacker) on line 2067: /* Denylist for skipping the whole probe: * some HD-audio PCI entries are exposed without any codecs, and such devices * should be ignored from the beginning. */ static const struct pci_device_id driver_denylist[] = { { PCI_DEVICE_SUB(0x1022, 0x1487, 0x1043, 0x874f) }, /* ASUS ROG Zenith II / Strix */ { PCI_DEVICE_SUB(0x1022, 0x1487, 0x1462, 0xcb59) }, /* MSI TRX40 Creator */ { PCI_DEVICE_SUB(0x1022, 0x1487, 0x1462, 0xcb60) }, /* MSI TRX40 */ {} }; "modprobe snd_hda_intel probe_mask=0xff" - I got 0xff by seeing line 1639 Really, I merely scanned through the file in desparate attempts to find a solution or a work-around to get my sound card properly detected even with custom mods to the source so I was looking at anything that sounds related. Don't blame me if my findings are irrelevant to the error, like I said, I haven't worked on the kernel before. I found this: https://bugzilla.kernel.org/show_bug.cgi?id=211273 which sounds kind of related to my issue but didn't get much traction so I thought I create a new post and according to AsRock's specs, my motherboard features: "7.1 CH HD Audio (Realtek ALC1220 Audio Codec)", link here: https://www.asrock.com/MB/AMD/B550%20Taichi/index.asp. I am happy to test/compile whatever needs to be tested done.
If you need more details, please let me know, I will collect relevant log files.
------------------------------------------------------------------------------ Attaching Output of "lspci -nn" showing Subsystem Info: ------------------------------------------------------------------------------ 0d:00.4 Audio device [0403]: Advanced Micro Devices, Inc. [AMD] Starship/Matisse HD Audio Controller [1022:1487] Subsystem: ASRock Incorporation Starship/Matisse HD Audio Controller [1849:2225] Flags: bus master, fast devsel, latency 0, IRQ 126 Memory at fcc00000 (32-bit, non-prefetchable) [size=32K] Capabilities: <access denied> Kernel driver in use: snd_hda_intel Kernel modules: snd_hda_intel
Created attachment 297193 [details] lspci -nnv
There have been a few reports showing the similar symptom (no codecs found) on the recent AMD boards, but unfortunately we have no clue why this can't work. It's pretty much hardware specific, and only the hardware vendor might know.
Thanks for responding Takashi, highly appreciated. If you or anyone else needs something very specific such as hardware debug logs or specific values / data sent to or outputted by the hardware and then the data returned from it, I am happy to do what I can from my end. I have been studying "hda_intel.c" extensively trying to make sense the last few days and while at it, I saw line 1619: "#define AZX_FORCE_CODEC_MASK 0x100" So I gave it a go with "modprobe snd_hda_intel probe_mask=0x100" because further down, I can see the code refers to it in check_probe_mask(chip, dev): /* check forced option */ if (chip->codec_probe_mask != -1 && (chip->codec_probe_mask & AZX_FORCE_CODEC_MASK)) { azx_bus(chip)->codec_mask = chip->codec_probe_mask & 0xff; dev_info(chip->card->dev, "codec_mask forced to 0x%x\n", (int)azx_bus(chip)->codec_mask); } I was specifically interested in the "codec_mask forced to 0x%x\n"" statement to see what it will output so looking at that, I did: $ echo "0000:0b:00.1" > /sys/bus/pci/drivers/snd_hda_intel/unbind $ modprobe -r snd_hda_intel $ modprobe snd_hda_intel probe_mask=0x100 and then: $ dmesg | grep codec_mask [ 2809.952659] snd_hda_intel 0000:0b:00.1: codec_mask forced to 0x0 "codec_mask forced to 0x0" <-- It is null, I don't know if that indicates anything to you or anyone else. Here is the full output: [ 2809.952646] snd_hda_intel 0000:0b:00.1: Disabling MSI [ 2809.952657] snd_hda_intel 0000:0b:00.1: Handle vga_switcheroo audio client [ 2809.952659] snd_hda_intel 0000:0b:00.1: codec_mask forced to 0x0 [ 2809.957297] snd_hda_intel 0000:0b:00.1: no codecs initialized [ 2809.957447] snd_hda_intel 0000:0d:00.4: no codecs found! Upon further analyzing my original post, I can now see my comment about 0xFF "modprobe snd_hda_intel probe_mask=0xff" makes absolutely no sense, sorry for that! At the time I hadn't analyzed anything properly the same applies with 0x103 (and I got that off a random post I found). So, as per line 1619 and AZX_FORCE_CODEC_MASK being 0x100, the modprobe invoke does trigger "check_probe_mask(chip, dev)" and codec_mask is forced to null. I don't know if that indicates some sort of error. By the way, I can see there is reference to vga_switcheroo and I just want to clarify that I only have one discrete graphics card so no integrated graphics in my setup. I am trying to trace everything step by step while reproducing the error one step at a time and and adding my own debug statements which help me trace where I am and what's running.
I experience similar problems on my machine for some time now. However today I encountered a machine check exception that may be related. I'm reporting it here in hope that it might help to pinpoint the issue. ------------------------------------------------------------------------------ journalctl -b ------------------------------------------------------------------------------ Mar 29 16:16:39 localhost kernel: [Hardware Error]: Corrected error, no action required. Mar 29 16:16:39 localhost kernel: [Hardware Error]: CPU:1 (19:21:2) MC17_STATUS[-|CE|-|-|-|-|-|-|-]: 0x800000012268f163 Mar 29 16:16:39 localhost kernel: [Hardware Error]: IPID: 0x0000000000000000 Mar 29 16:16:39 localhost kernel: [Hardware Error]: Bank 17 is reserved. Mar 29 16:16:39 localhost kernel: [Hardware Error]: cache level: L3/GEN, tx: INSN Mar 29 16:16:39 localhost pulseaudio[2716]: ALSA woke us up to write new data to the device, but there was actually nothing to write. Mar 29 16:16:39 localhost pulseaudio[2716]: Most likely this is a bug in the ALSA driver 'snd_usb_audio'. Please report this issue to the ALSA developers. Mar 29 16:16:39 localhost pulseaudio[2716]: We were woken up with POLLOUT set -- however a subsequent snd_pcm_avail() returned 0 or another value < min_avail. ------------------------------------------------------------------------------ ------------------------------------------------------------------------------ sudo dmesg -T | grep snd_hda ------------------------------------------------------------------------------ [Wed Mar 29 09:06:40 2023] snd_hda_intel 0000:2d:00.1: enabling device (0000 -> 0002) [Wed Mar 29 09:06:40 2023] snd_hda_intel 0000:2d:00.1: Disabling MSI [Wed Mar 29 09:06:40 2023] snd_hda_intel 0000:2d:00.1: Handle vga_switcheroo audio client [Wed Mar 29 09:06:40 2023] snd_hda_intel 0000:2f:00.4: enabling device (0000 -> 0002) [Wed Mar 29 09:06:40 2023] snd_hda_intel 0000:2f:00.4: no codecs found! ------------------------------------------------------------------------------ ------------------------------------------------------------------------------ Motherboard: MSI MEG X570S ACE MAX CPU: AMD Ryzen 5950x kernel: 5.19.0-38-generic #39~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC OS: Ubuntu 22.04.2 LTS ------------------------------------------------------------------------------