Bug 426258 - alsa backend not working for AMD 4000 (renoir) soundcard - (possible mixer name collision)
Summary: alsa backend not working for AMD 4000 (renoir) soundcard - (possible mixer na...
Status: RESOLVED FIXED
Alias: None
Product: kmix
Classification: Applications
Component: Soundcard specific (show other bugs)
Version: unspecified
Platform: Gentoo Packages Linux
: NOR major
Target Milestone: ---
Assignee: Christian Esken
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-09-06 18:31 UTC by adam.mikulic
Modified: 2021-05-20 18:05 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description adam.mikulic 2020-09-06 18:31:54 UTC
SUMMARY
Unable to choose alsa mixer/card (hw1,0) due to possible collision with mixer/card (hw0) which has identical name, this applies only to this specific audio hardware:

 lspci | grep -i audio
03:00.1 Audio device: Advanced Micro Devices, Inc. [AMD/ATI] Device 1637
03:00.5 Multimedia controller: Advanced Micro Devices, Inc. [AMD] Raven/Raven2/FireFlight/Renoir Audio Processor (rev 01)
03:00.6 Audio device: Advanced Micro Devices, Inc. [AMD] Family 17h (Models 10h-1fh) HD Audio Controller

STEPS TO REPRODUCE

# aplay -l
card 0: Generic [HD-Audio Generic], device 3: HDMI 0 [HDMI 0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: Generic [HD-Audio Generic], device 7: HDMI 1 [HDMI 1]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: Generic_1 [HD-Audio Generic], device 0: Generic Analog [Generic Analog]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

# kmixremote list
ALSA__HD_Audio_Generic_1
ALSA__HD_Audio_Generic_1
MPRIS2__Playback_Streams_1

# kmixremote list ALSA__HD_Audio_Generic_1
IEC958_0
IEC958_1
# kmixremote list ALSA__HD_Audio_Generic_1
IEC958_0
IEC958_1

EXPECTED RESULT
Actually, the second mixer/card contains mixer controls for audio channels, but it cannot be selected. I can't read c++ but I've checked the sources and I guess card names comes from alsalib, apparently they are not unique and there may be some confusion when controls for mixer/card are enumerated when called by card "name" so it always return 2 hdmi IEC958 controls of the first card (alsa card hw0). It seems to me mixers/cards are detected correctly, because in GUI when I click configure kmix, volume control tab, where I see basically output of 'kmixremote list', both mixers/cards with name "HD-Audio Generic" has different icons, the second correct card has icon like volume slider, so the kmix internal pointers to cards may be correct, but controls of the cards may be enumerated by its name which is not unique, so always controls of first card are returned - but this is only my speculation.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: latest kernel 5.8.5
KDE Plasma Version: plasma 5.19.4, kmix 20.08.1
KDE Frameworks Version: 5.73.0
Qt Version: 5.15.0

ADDITIONAL INFORMATION
Following system-wide alsa configuration is necessary for audio to work, so the soundcard works correctly, alsamixer works as expected, only kmix is not usable because it only shows sound muted icon and no actual mixer controls can be selected.
#cat /etc/asound.conf 
pcm.!default {
        type plug
        slave {
                pcm "hw:1,0"
        }
}

ctl.!default {
        type hw
        card 1
}

I would be happy to test possible patch because it requires access to this specific hardware.
Comment 1 adam.mikulic 2021-05-20 18:05:40 UTC
Finally, switching soundcard indexes alsa way was what was needed, i.e. in my distro at /etc/modprobe.d/alsa.conf adding "options snd_hda_intel index=1,0". Now kmix works as expected ( ~/.config/kmixrc has to be deleted and configured again, and in my case also asound.conf where I have as default soundard the one with index 1).