AMD 5700G + ASUS Prime B550-Plus: Sound

I have a machine with the hardware in the title. I am getting no sound off the motherboard (Realtek ALC 887). It seems openSuSE wants to use the HDMI sound from the integrated GPU in the CPU. I have tried Leap 15.5 and Tumbleweed. The following (from Tumbleweed) seems to show that the Realtek is not detected or ignored:

gem300@5700G+ALC887:~> aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: Generic_1 [HD-Audio Generic], device 3: HDMI 0 [LG FHD]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: Generic_1 [HD-Audio Generic], device 7: HDMI 1 [LG FHD]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

gem300@5700G+ALC887:~> inxi -Axx
Audio:
  Device-1: AMD Renoir Radeon High Definition Audio vendor: ASUSTeK
    driver: snd_hda_intel v: kernel pcie: speed: 8 GT/s lanes: 16
    bus-ID: 07:00.1 chip-ID: 1002:1637
  Device-2: AMD Family 17h/19h HD Audio vendor: ASUSTeK
    driver: snd_hda_intel v: kernel pcie: speed: 8 GT/s lanes: 16
    bus-ID: 07:00.6 chip-ID: 1022:15e3
  API: ALSA v: k6.8.8-1-default status: kernel-api with: aoss
    type: oss-emulator
  Server-1: PipeWire v: 1.0.5 status: active with: 1: pipewire-pulse
    status: active 2: wireplumber status: active 3: pipewire-alsa type: plugin

Any ideas?

First thing that comes to mind is that the snd_hda_intel kernel module needs a specific model option to recognize your hw (ASUS have an history of unique audio setups…)
Try this page and search for “asus”, there are 48 models listed and maybe one sounds familiar to you.

Or look for “ALC88x” and see if anything familiar is to be found there.

There are some things there that are perhaps pertinent to the problem, in particular the descriptions of the back panel jacks on asus-mobo as a:6stack-digout 6-jack with a SPDIF outwhich is exactly what is on the mobo. There is also asus-mobo Pin configs for ASUS mobo with 5.1/SPDIF out

However, I don’t understand what I’m looking at. I have not read all the documentation. Do these short phrases serve as arguments in the boot loader kernel parameters section?

To test those options you can add to the kernel command line something like:

snd-hda-intel.model=6stack-digout

or

snd-hda-intel.model=asus-mobo

(just press “E” at the grub boot menu and look for the line beginning with linuxefi).
Since your mobo provides two sound “cards”, you may have to add a comma to skip configuration of the HDMI “card” and address the ALC887, like in:

snd-hda-intel.model=,6stack-digout

When you find a working config, you may permanently add that to the kernel boot parameters (you may use YaST Bootloader) or add a config file to modprobe, say /etc/modprobe.d/50-asus-mobo-hda-fix.conf with a line reading:

options snd-hda-intel model=,6stack-digout

I spent some time yesterday trying every combination possible of those 2 parameters, both in the yast bootloader kernel parameters section and by adding a file containing options in /etc/modprobe.d . No change so far. In your above post there are

snd-hda-intel.model=(parameter) and snd-hda-intel model=(parameter) .

I assume the latter is the correct one? I tried both anyway.

that above is the form to be added to the kernel command line, while

the latter is the form to be used in /etc/modprobe.d/ config files.
Is there anything to enable the two “sound cards” in the BIOS/EFI firmware?

Anything relevant looking at:

dmesg |grep snd_hda

That was one of the first things I checked. The only entry is for the Realtek HD audio controller, a simple Enable / Disable choice. It has been enabled throughout all of this.

See below.

with no additional file in /etc/modprobe.d:

gem300@5700G+ALC887:/etc/modprobe.d> ls
50-nfs.conf  50-yast.conf  README  tuned.conf

reboot

gem300@5700G+ALC887:~> aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: Generic_1 [HD-Audio Generic], device 3: HDMI 0 [LG FHD]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: Generic_1 [HD-Audio Generic], device 7: HDMI 1 [LG FHD]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
gem300@5700G+ALC887:~> inxi -Axx
Audio:
  Device-1: AMD Renoir Radeon High Definition Audio vendor: ASUSTeK
    driver: snd_hda_intel v: kernel pcie: speed: 8 GT/s lanes: 16
    bus-ID: 07:00.1 chip-ID: 1002:1637
  Device-2: AMD Family 17h/19h HD Audio vendor: ASUSTeK
    driver: snd_hda_intel v: kernel pcie: speed: 8 GT/s lanes: 16
    bus-ID: 07:00.6 chip-ID: 1022:15e3
  Sound API: ALSA v: k5.14.21-150500.55.62-default running: yes
  Sound Server-1: PulseAudio v: 15.0 running: yes
  Sound Server-2: PipeWire v: 0.3.64 running: no
gem300@5700G+ALC887:~> sudo dmesg | grep snd_hda
[sudo] password for root: 
[    6.644686] snd_hda_intel 0000:07:00.1: enabling device (0000 -> 0002)
[    6.644944] snd_hda_intel 0000:07:00.1: Handle vga_switcheroo audio client
[    6.645089] snd_hda_intel 0000:07:00.6: enabling device (0000 -> 0002)
[    6.651765] snd_hda_intel 0000:07:00.6: no codecs found!
[    6.653369] snd_hda_intel 0000:07:00.1: bound 0000:07:00.0 (ops amdgpu_dm_audio_component_bind_ops [amdgpu])
gem300@5700G+ALC887:~> 

create /etc/modprobe.d/50-asus-mobo-hda-fix.conf:

gem300@5700G+ALC887:~> cd /etc/modprobe.d
gem300@5700G+ALC887:/etc/modprobe.d> sudo vim 50-asus-mobo-hda-fix.conf
gem300@5700G+ALC887:/etc/modprobe.d> ls
50-asus-mobo-hda-fix.conf  50-nfs.conf  50-yast.conf  README  tuned.conf
gem300@5700G+ALC887:/etc/modprobe.d> cat 50-asus-mobo-hda-fix.conf
options snd-hda-intel model=,6stack-digout
gem300@5700G+ALC887:/etc/modprobe.d> 

reboot

gem300@5700G+ALC887:~> aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: Generic_1 [HD-Audio Generic], device 3: HDMI 0 [LG FHD]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: Generic_1 [HD-Audio Generic], device 7: HDMI 1 [LG FHD]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
gem300@5700G+ALC887:~> cat /etc/modprobe.d/50-asus-mobo-hda-fix.conf
options snd-hda-intel model=,6stack-digout
gem300@5700G+ALC887:~> inxi -Axx
Audio:
  Device-1: AMD Renoir Radeon High Definition Audio vendor: ASUSTeK
    driver: snd_hda_intel v: kernel pcie: speed: 8 GT/s lanes: 16
    bus-ID: 07:00.1 chip-ID: 1002:1637
  Device-2: AMD Family 17h/19h HD Audio vendor: ASUSTeK
    driver: snd_hda_intel v: kernel pcie: speed: 8 GT/s lanes: 16
    bus-ID: 07:00.6 chip-ID: 1022:15e3
  Sound API: ALSA v: k5.14.21-150500.55.62-default running: yes
  Sound Server-1: PulseAudio v: 15.0 running: yes
  Sound Server-2: PipeWire v: 0.3.64 running: no
gem300@5700G+ALC887:~> sudo dmesg | grep snd-hda
[sudo] password for root: 
gem300@5700G+ALC887:~> 

No output from dmesg | grep snd-hda

No sound

change 50-asus-mobo-hda-fix.conf:

gem300@5700G+ALC887:~> cd /etc/modprobe.d
gem300@5700G+ALC887:/etc/modprobe.d> sudo vim 50-asus-mobo-hda-fix.conf
[sudo] password for root: 
gem300@5700G+ALC887:/etc/modprobe.d> ls
50-asus-mobo-hda-fix.conf  50-nfs.conf  50-yast.conf  README  tuned.conf
gem300@5700G+ALC887:/etc/modprobe.d> cat 50-asus-mobo-hda-fix.conf
options snd-hda-intel model=,asus-mobo
gem300@5700G+ALC887:/etc/modprobe.d> 

reboot

gem300@5700G+ALC887:~> aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: Generic_1 [HD-Audio Generic], device 3: HDMI 0 [LG FHD]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: Generic_1 [HD-Audio Generic], device 7: HDMI 1 [LG FHD]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
gem300@5700G+ALC887:~> inxi -Axx
Audio:
  Device-1: AMD Renoir Radeon High Definition Audio vendor: ASUSTeK
    driver: snd_hda_intel v: kernel pcie: speed: 8 GT/s lanes: 16
    bus-ID: 07:00.1 chip-ID: 1002:1637
  Device-2: AMD Family 17h/19h HD Audio vendor: ASUSTeK
    driver: snd_hda_intel v: kernel pcie: speed: 8 GT/s lanes: 16
    bus-ID: 07:00.6 chip-ID: 1022:15e3
  Sound API: ALSA v: k5.14.21-150500.55.62-default running: yes
  Sound Server-1: PulseAudio v: 15.0 running: yes
  Sound Server-2: PipeWire v: 0.3.64 running: no
gem300@5700G+ALC887:~> sudo dmesg | grep snd-hda
[sudo] password for root: 
gem300@5700G+ALC887:~> 
gem300@5700G+ALC887:~> cat /etc/modprobe.d/50-asus-mobo-hda-fix.conf
options snd-hda-intel model=,asus-mobo
gem300@5700G+ALC887:~> 

No output from dmesg | grep snd-hda

No sound.

This is the problem (no codecs found!). Now things get a bit messy.

Your last test was apparently done in Leap 15.5. Even if many new features are backported to the 5.14 kernel by SUSE, it is best to do further tests on Tumbleweed updated to the latest kernel (6.8.9 at the moment) to be sure of using the latest drivers and avoid confusion.

The “6stack-digout” option is reported for the ALC880. I don’t know what are the differences between the ALC880 and the ALC887, but generally speaking options for one model might not work for another.
Maybe look at the options reported for ALC88x/… for something relevant.
Also, seeing no output from dmesg means something basic is wrong with that configuration file (and of course you get no sound if you see no snd-hda… in dmesg).

The “asus-mobo” option is for a completely different codec ( STAC92HD73*) so no surprise that it doesn’t work.

On a side note, are you sure that the mobo is equipped with an ALC887? We have no confirmation so far from system output.
Can you post the result of:

sudo lsmod |grep snd

if (as is likely) snd_hda_codec_realtek doesn’t show up, can you try:

sudo modprobe -v snd_hda_codec_realtek

and post here any error message?

OK, good! Finding the problem is the first step.

Yes, it is Leap 15.5. I reinstalled Leap15.5. I couldn’t live with Tumbleweed. Chromium was constantly generating “Ah,Snap!” errors and the filesystem didn’t make me a member of the “Users” group. All my files on my boot drive were owner $USER and group $USER, which was different from all my data files (2TB worth) on a non-boot drive. Confusing. Among other less important things.

I know it would be best to test on Tumbleweed because of the kernel version, and the use of Pipewire (exclusively?) for sound.

I will continue to look over the HDA sections on kernel.org. I realized there were basic errors by looking at /var/log/messages:

modprobe[705]: libkmod: kmod_config_parse: /etc/modprobe.d/50-asus-mobo-hda-fix.conf line 1: ignoring bad line starting with 'options=snd-hda-intel'

That is repeated throughout /var/log/messages many times, one for each reboot presumably.

Good! One less thing to worry about = 1/2 the work and reboots. :slight_smile:

Direct quote from the mobo manual:

PRIME B550-PLUS specifications summary
Audio
Realtek ALC 887 7.1-Channel High Definition Audio CODEC
Supports Jack detection, Multi-streaming, Front Panel Jack-retasking
Supports up to 24-Bit/192 kHz playback

gem300@5700G+ALC887:~> sudo lsmod | grep snd
[sudo] password for root: 
snd_hda_codec_hdmi     77824  1
snd_hda_intel          57344  2
snd_intel_dspcfg       32768  1 snd_hda_intel
snd_intel_sdw_acpi     20480  1 snd_intel_dspcfg
snd_hda_codec         176128  2 snd_hda_codec_hdmi,snd_hda_intel
snd_hda_core          110592  3 snd_hda_codec_hdmi,snd_hda_intel,snd_hda_codec
snd_hwdep              16384  1 snd_hda_codec
snd_pcm               176128  4 snd_hda_codec_hdmi,snd_hda_intel,snd_hda_codec,snd_hda_core
snd_timer              40960  1 snd_pcm
snd                   118784  10 snd_hda_codec_hdmi,snd_hwdep,snd_hda_intel,snd_hda_codec,snd_timer,snd_pcm
soundcore              16384  1 snd

No Realtek.

gem300@5700G+ALC887:~> sudo modprobe -v snd_hda_codec_realtek
insmod /lib/modules/5.14.21-150500.55.62-default/kernel/drivers/leds/trigger/ledtrig-audio.ko.zst 
insmod /lib/modules/5.14.21-150500.55.62-default/kernel/sound/pci/hda/snd-hda-codec-generic.ko.zst 
insmod /lib/modules/5.14.21-150500.55.62-default/kernel/sound/pci/hda/snd-hda-codec-realtek.ko.zst 
gem300@5700G+ALC887:~> 

Is the last file the long-lost Realtek driver?

gem300@5700G+ALC887:/lib/modules/5.14.21-150500.55.62-default/kernel/sound/pci/hda> ll *realtek*
-rw-r--r-- 1 root root 88517 2024-05-08 07:33 snd-hda-codec-realtek.ko.zst

OK, we must trust ASUS for the ALC887 and keep Leap 15.5 for further testing.

“options=…” is wrong, but apparently you changed to the correct “options snd-hda-intel …” afterwards?

As long as no Realtek module shows up I doubt that fiddling with “model=…” options does anything, so after:

does anything change in:

dmesg | grep snd_hda
aplay -l
inxi -Axx

and yes, the last file is the long-lost Realtek driver.
On a side note I found the following kernel bug that might be somewhat related, just for future reference:
https://bugzilla.kernel.org/show_bug.cgi?id=211555#c7

I am hoping this can be made to work in Leap 15.5. Despite testing with Tumbleweed, the problem persisted.

Yes, that is one of many messages that contains that string. I did away with my additions to /etc/modprobe.d, leaving only what openSuSE put there.

I agree.

Let me see if I understand this.

According to this, modprobe has used insmod to make the kernel use these 3 drivers and indeed that seems to be true for at least one of them, since:

gem300@5700G+ALC887:~> sudo lsmod |grep realtek
[sudo] password for root: 
snd_hda_codec_realtek   172032  0
snd_hda_codec_generic    98304  1 snd_hda_codec_realtek
snd_hda_codec         176128  4 snd_hda_codec_generic,snd_hda_codec_hdmi,snd_hda_intel,snd_hda_codec_realtek
snd_hda_core          110592  5 snd_hda_codec_generic,snd_hda_codec_hdmi,snd_hda_intel,snd_hda_codec,snd_hda_codec_realtek
realtek                36864  1
snd                   118784  12 snd_hda_codec_generic,snd_hda_codec_hdmi,snd_hwdep,snd_hda_intel,snd_hda_codec,snd_hda_codec_realtek,snd_timer,snd_pcm
libphy                159744  3 r8169,mdio_devres,realtek

However, the kernel is not doing anything with snd_hda_codec_realtek, since:

No:

andy@qomolangma:~> sudo dmesg | grep snd_hda
[sudo] password for root: 
[    6.596994] snd_hda_intel 0000:07:00.1: enabling device (0000 -> 0002)
[    6.597114] snd_hda_intel 0000:07:00.1: Handle vga_switcheroo audio client
[    6.597245] snd_hda_intel 0000:07:00.6: enabling device (0000 -> 0002)
[    6.601887] snd_hda_intel 0000:07:00.6: no codecs found!
[    6.605782] snd_hda_intel 0000:07:00.1: bound 0000:07:00.0 (ops amdgpu_dm_audio_component_bind_ops [amdgpu])
andy@qomolangma:~> aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: Generic_1 [HD-Audio Generic], device 3: HDMI 0 [LG FHD]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: Generic_1 [HD-Audio Generic], device 7: HDMI 1 [LG FHD]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
andy@qomolangma:~> inxi -Axx
Audio:
  Device-1: AMD Renoir Radeon High Definition Audio vendor: ASUSTeK
    driver: snd_hda_intel v: kernel pcie: speed: 8 GT/s lanes: 16
    bus-ID: 07:00.1 chip-ID: 1002:1637
  Device-2: AMD Family 17h/19h HD Audio vendor: ASUSTeK
    driver: snd_hda_intel v: kernel pcie: speed: 8 GT/s lanes: 16
    bus-ID: 07:00.6 chip-ID: 1022:15e3
  Sound API: ALSA v: k5.14.21-150500.55.62-default running: yes
  Sound Server-1: PulseAudio v: 15.0 running: yes
  Sound Server-2: PipeWire v: 0.3.64 running: yes

So somewhere between detection of the ALC887 and actually booting to a running system, the ALC887 is lost. Which is presumably due to a missing options= line in the information modprobe gives to the kernel.

Something to bear in mind.

On a side note, modprobe passes .zst archives to the kernel? Extraction happens on the fly? Thus slowing down the boot process? After extraction:

snd-hda-codec-realtek.ko      349152 2024-05-17
snd-hda-codec-realtek.ko.zst   88517 2024-05-08

Yes, you should find all of them with plain “sudo lsmod”.

Apparently that is part of the problem: the ALC887 does not “ask” the kernel to load the snd_hda_codec_realtek module and even loading it manually doesn’t cause it to connect to the ALC887.
I wonder if the ALC887 is being detected at all, so it is likely not “lost” during boot but simply not detected.
Please be aware that “options=” is wrong, no “=” sign should be used either on the kernel command line or a modprobe.d config file.

Yes, external kernel modules are compressed, forget about it.

If no HW/sound guru steps in with better ideas, maybe filing a bug report at bugzilla.opensuse.org is the way to reach for kernel/hda developers.

I worry about gaffes like that if I’m going to file a bug report.

It’s strange. All of this hardware has been around for a couple of years or more, so I did not anticipate a problem of this magnitude. Has no one ever put an AMD 5700G on an Asus Prime B550-Plus mobo and installed Linux?

Incidentally, I had a spare SATA slot and SSD, so I did a quick install of Linux Mint. Exactly the same problem occurs, including the output of aplay -l, inxi -Axx and dmesg | grep snd_hda.

Hints at a kernel problem, not an openSUSE specific one. We are lucky to have a kernel / sound system developer at SUSE, so a bug report at bugzilla.opensuse.org should attract his attention :wink:

Bugzilla – Bug 1224457 Submitted

Kernel: Sound: AMD cpu with graphics + ASUS motherboard with ALC 887

Link: boo 1224457

Have you followed this bug by any chance? The last message is a bit over my head.

The easy part is adding “snd_hda_intel.probe_mask=,0x101” (without quotes and mind the comma) to the kernel command line and boot (just press “E” at the boot screen, adding permanently is not needed until you find out what works).
Repeat with the other codes through 0x180 until you find one that works (if any).

To install kernels from tiwai: repo find the .rpm file, copy the URL and use in zypper, as an example for the 5.14 kernel:

zypper install --oldpackage https://download.opensuse.org/repositories/home:/tiwai:/kernel:/5.14/backport/x86_64/kernel-default-5.14.15-lp153.1.1.g2ba76d0.x86_64.rpm