I took a look at this thread and the two instances of the alsa diagnostic script (ie first instance and second instance). The sound card device number changed (as was pointed out in this thread) from initially card-0 and card-2 (ignoring the USB webcam which was card-1) to card-0 and card-1 in the second instance (ignoring the USB webcam which was card-2 in this instance).
Sometimes if both devices run different instances of the same kernel module alsa driver (which is ‘snd_hda_intel’ ) that change in device order can happen, and that can cause confusion in trying to reliably get (and reliably test) sound.
I assume its the analog sound (Realtek ALC887-VD that comes with your Gigabyte AB350M-DS3H-CF motherboard) that you are trying to use.
I also assume you had sound working previous under Tumbleweed (based on your initial post) and originally you had no sound issues. When you lost sound, was that after a Tumbleweed upgrade? I note you have a 5.15.2 kernel, and I was reading on a Lenovo GNU/Linux forum that 5.15.2 has caused a number of issues with Lenovo users, where the newer 5.15.3 appears to have addressed many.
If it were me, trying to debug this, I would disconnect the Webcam, as it can insert a sound device, confusing the issue. Once I had sound working, I would plug th webcam back in.
Also note that by default, openSUSE sound will go to card-0, which for both the two alsa instances noted above, are HDMI in your case. Ergo that (sound) needs to be redirected to card-1 or card-2, dependent on which of those (card-1 or 2) is your Realtek ALC887-VD. Most of us do this with the application ‘pavucontrol’ (pulse audio volume control).
One qualification on this post of mine - I don’t sufficiently understand the inter relationships between pulse audio and pipewire, to say if the tests/changes (?) you have done have helped, or made things worse, or provided useful information.
I do note thou, that the also level testing should work.
Did you try suspending pulse audio for your ‘aplay’ sound tests? For example, if your webcam is removed from before you boot (to avoid the complexity and do not re-insert USB webcam) and assuming your analog audio is hw:1,0 and hw:1,2 (you need to check to confirm this), then did you try this test?
For hw:1,0
pasuspender -- aplay -D hw:1,0 -vv /usr/share/sounds/alsa/test.wav
.
and for hw:1,2
pasuspender -- aplay -D hw:1,2 -vv /usr/share/sounds/alsa/test.wav
Obviously if your Realtek ALC887-VD is hw:0,0 and hw:0,2 you will need to use those instead in the command.
Please try as both a regular user and with root permissions. When you try with root permissions, use sudo (for this test). The idea of using sudo, is to test this as a regular user with elevated permissions (ie not to test as root).
Also, if using external speakers, please check the obvious … ie check cables, make certain speakers actually turned on (if an on/off switch) and that volume turned up (if speakers have a volume knob). My apologies for typing the obvious, but sometimes that even simple things like that catches me when I have an issue, and for a while I forget while I recheck basics.
Also, I note you have your headphones muted (which is why your headphone tests failed) … Out of curiousity, did you ever try to unmute the headphones, plug in headphones, and then test the audio (ie the aplay command) with headphones plugged in? I recommend you do a headphone test.
… This could simply be the 5.15.2 kernel (as noted above wrt Lenovo forum) and you may wish to try the 5.15.3 if its available.
.