Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 797658 - >=media-libs/alsa-ucm-conf-1.2.4: no audio on AMD Renoir using PulseAudio
Summary: >=media-libs/alsa-ucm-conf-1.2.4: no audio on AMD Renoir using PulseAudio
Status: RESOLVED UPSTREAM
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: AMD64 Linux
: Normal normal with 1 vote (vote)
Assignee: Gentoo ALSA team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-06-22 22:25 UTC by Thymo van Beers
Modified: 2021-11-26 18:29 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
pacmd list-sinks (pacmd_list-sinks,10.23 KB, text/plain)
2021-06-22 22:26 UTC, Thymo van Beers
Details
pulseaudio --log-target=stderr --log-level=debug 2>&1 >/dev/null | (trap '' INT; exec tee pulse-debug.log) (pulse-debug.log,412.64 KB, text/plain)
2021-06-23 19:44 UTC, Thymo van Beers
Details
pulseaudio-13.99.1-debug.log (pulseaudio-13.99.1-debug.log,852.42 KB, text/x-log)
2021-06-25 14:39 UTC, Thymo van Beers
Details
pulseaudio-13.99.2-debug.log (pulseaudio-13.99.2-debug.log,966.31 KB, text/x-log)
2021-06-25 14:40 UTC, Thymo van Beers
Details
PulseAudio 14 debug log (pulseaudio-14.0-debug.log,792.99 KB, text/x-log)
2021-06-26 20:58 UTC, Thymo van Beers
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Thymo van Beers 2021-06-22 22:25:43 UTC
After upgrading alsa-lib and alsa-ucm-conf to >=1.2.4 audio on PulseAudio no longer works.

This bug was encountered on Arch in October and was supposedly fixed upstream: 
Upstream issue: https://github.com/alsa-project/alsa-ucm-conf/issues/54
Nevertheless upgrading to 1.2.4 on Gentoo breaks internal speaker audio on my system.



Reproducible: Always

Steps to Reproduce:
1. Have a system on AMD Renoir (Thinkpad T14 in this case)
2. Upgrade alsa-lib and alsa-ucm-conf to 1.2.4
3. pulseaudio -k
4. Audio breaks



Logs:
Jun 23 00:08:46 apollo pulseaudio[10221]: [pulseaudio] module-alsa-card.c: Failed to find a working profile.
Jun 23 00:08:46 apollo pulseaudio[10221]: [pulseaudio] module.c: Failed to load module "module-alsa-card" (argument: "device_id="1" name="pci-0000_07_00.6" card_name="alsa_card.pci-0000_07_00.6" namereg_fail=false tsched=yes fixed_latency_range=no ignore_dB=no deferred_volume=yes use_ucm=yes avoid_resampling=no card_properties="module-udev-detect.discovered=1""): initialization failed.

ALSA devices:
thymo@apollo ~ $ aplay -l
**** List of PLAYBACK Hardware Devices ****
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 0: Generic [HD-Audio Generic], device 8: HDMI 2 [HDMI 2]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: Generic_1 [HD-Audio Generic], device 0: ALC257 Analog [ALC257 Analog]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 3: S7 [SteelSeries Arctis 7], device 0: USB Audio [USB Audio]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 3: S7 [SteelSeries Arctis 7], device 1: USB Audio [USB Audio #1]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
Comment 1 Thymo van Beers 2021-06-22 22:26:38 UTC
Created attachment 717744 [details]
pacmd list-sinks
Comment 2 Thymo van Beers 2021-06-22 22:27:55 UTC
Forgot to past the URL to the Arch bug:
https://bugs.archlinux.org/task/68324
Comment 3 Igor V. Kovalenko 2021-06-23 09:21:19 UTC
(In reply to Thymo van Beers from comment #0)
> After upgrading alsa-lib and alsa-ucm-conf to >=1.2.4 audio on PulseAudio no
> longer works.
> 
> This bug was encountered on Arch in October and was supposedly fixed
> upstream: 
> Upstream issue: https://github.com/alsa-project/alsa-ucm-conf/issues/54
> Nevertheless upgrading to 1.2.4 on Gentoo breaks internal speaker audio on
> my system.
That is reportedly fixed indeed, but there may be other issues.

> Jun 23 00:08:46 apollo pulseaudio[10221]: [pulseaudio] module-alsa-card.c:
> Failed to find a working profile.
Could you please attach verbose log, need to see what happened just before 'Failed to find a working profile'
Comment 4 Igor V. Kovalenko 2021-06-23 11:18:28 UTC
(In reply to Thymo van Beers from comment #0)
> After upgrading alsa-lib and alsa-ucm-conf to >=1.2.4 audio on PulseAudio no
> longer works.
..
> 1. Have a system on AMD Renoir (Thinkpad T14 in this case)

We got a confirmation that ThinkPad T14 Gen 1 indeed works with up-to-date alsa-lib, alsa-ucm-conf and sof-firmware, please double-check if you have sof-firmware installed and everything alsa is otherwise up-to-date.
Comment 5 Thymo van Beers 2021-06-23 19:44:20 UTC
Created attachment 718305 [details]
pulseaudio --log-target=stderr --log-level=debug 2>&1 >/dev/null | (trap '' INT; exec tee pulse-debug.log)
Comment 6 Thymo van Beers 2021-06-23 19:47:49 UTC
sof-firmware is installed. Audio was working before but only broke after the alsa upgrade.

thymo@apollo /tmp $ qlist -Iv | grep -e sof-firmware -e alsa -e pulse
media-libs/alsa-lib-1.2.4
media-libs/alsa-topology-conf-1.2.4
media-libs/alsa-ucm-conf-1.2.4
media-libs/pulseaudio-qt-1.2
media-plugins/alsa-plugins-1.2.2
media-sound/alsa-utils-1.2.4
media-sound/pulseaudio-13.0-r1
sys-firmware/sof-firmware-1.6.1

I've attached a debug log. The lines at the 1.894 timestamp are interesting:
(   1.894|   0.000) D: [pulseaudio] alsa-util.c: Trying hw:Generic,7 with SND_PCM_NO_AUTO_FORMAT ...
(   1.894|   0.000) I: [pulseaudio] alsa-util.c: Error opening PCM device hw:Generic,7: Device or resource busy
(   1.894|   0.000) D: [pulseaudio] alsa-mixer.c: Profile set 0x55caa1b612b0, auto_profiles=no, probed=yes, n_mappings=0, n_profiles=0, n_decibel_fixes=0
(   1.894|   0.000) E: [pulseaudio] module-alsa-card.c: Failed to find a working profile.
(   1.894|   0.000) E: [pulseaudio] module.c: Failed to load module "module-alsa-card" (argument: "device_id="1" name="pci-0000_07_00.6" card_name="alsa_card.pci-0000_07_00.6" namereg_fail=false tsched=yes fixed_latency_range=no ignore_dB=no deferred_volume=yes use_ucm=yes avoid_resampling=no card_properties="module-udev-detect.discovered=1""): initialization failed.
(   1.894|   0.000) I: [pulseaudio] module-udev-detect.c: Card /devices/pci0000:00/0000:00:08.1/0000:07:00.6/sound/card1 (alsa_card.pci-0000_07_00.6) failed to load module.
Comment 7 Igor V. Kovalenko 2021-06-23 22:18:25 UTC
(In reply to Thymo van Beers from comment #6)
> I've attached a debug log. The lines at the 1.894 timestamp are interesting:
> (   1.894|   0.000) D: [pulseaudio] alsa-util.c: Trying hw:Generic,7 with
> SND_PCM_NO_AUTO_FORMAT ...
> (   1.894|   0.000) I: [pulseaudio] alsa-util.c: Error opening PCM device
> hw:Generic,7: Device or resource busy

alsa-ucm-conf-1.2.4 added a few HiFi configurations, so maybe what happens is pulseaudio started to process UCM for device 'pci-0000_07_00.6' after upgrade.

There was at least one fix preventing double opening of a device (which could lead to busy error) e.g. https://cgit.freedesktop.org/pulseaudio/pulseaudio/commit/?id=3bd7c70c518d66707cbfde138ab7dcc505e463ac

That would not apply cleanly to 13.0 but it may be easy to copy ebuild file to pulseaudio-13.99.1.ebuild and give it a go.

Alternatively please try the latest pulseaudio-14.99.2_pre1 but you will need to make a backup of your ~/.config/pulse just in case you plan to go back to 13.0 afterwards.
Comment 8 Thymo van Beers 2021-06-23 22:46:23 UTC
Unmasking pulseaudio-14.99.2_pre1 resulted in HDMI being the only working output. USB also became unavailable due to missing profiles. Perhaps that's just a dependency issue though.

Tomorrow I'll patch the ebuild to test with 13.99.1 and let you know if that fixes it.
Comment 9 Thymo van Beers 2021-06-25 14:39:50 UTC
Created attachment 719250 [details]
pulseaudio-13.99.1-debug.log
Comment 10 Thymo van Beers 2021-06-25 14:40:20 UTC
Created attachment 719253 [details]
pulseaudio-13.99.2-debug.log
Comment 11 Thymo van Beers 2021-06-25 14:40:56 UTC
Same issue persists on pulseaudio 13.99.1 and 13.99.2.
Comment 12 Igor V. Kovalenko 2021-06-25 16:16:00 UTC
(In reply to Thymo van Beers from comment #11)
> Same issue persists on pulseaudio 13.99.1 and 13.99.2.
I found matching alsa tracker item for "Lenovo t14s amd" https://github.com/alsa-project/alsa-ucm-conf/issues/61

That suggests the issue is fixed in pulseaudio-14.0, could you please try that?
Should be the same procedure you used to try 13.99.1 or 13.99.2 but with 14.0
Comment 13 Thymo van Beers 2021-06-26 20:56:12 UTC
Same exact issue on 14.0. I did a bisect on alsa-ucm-conf and the bug triggers on the same commit.
Comment 14 Thymo van Beers 2021-06-26 20:58:50 UTC
Created attachment 719484 [details]
PulseAudio 14 debug log
Comment 15 Igor V. Kovalenko 2021-06-26 21:32:03 UTC
(In reply to Thymo van Beers from comment #14)
> Created attachment 719484 [details]
> PulseAudio 14 debug log
Comparing your log to this one https://github.com/alsa-project/alsa-ucm-conf/files/5781377/pa14.log I see your variant fails to open UCM configuration for acp_pdm_mach device. This makes pulseaudio process acp_pdm_mach device, so that becomes busy leading to hw:acp probe error later in the log.

Could you please double-check alsa-lib and alsa-ucm-conf versions, also if /usr/share/alsa/ucm2/ is not modified somehow, and if you have anything related to acp in your asoundrc.
Comment 16 Thymo van Beers 2021-06-26 21:52:10 UTC
(In reply to Igor V. Kovalenko from comment #15)
> Could you please double-check alsa-lib and alsa-ucm-conf versions, also if
> /usr/share/alsa/ucm2/ is not modified somehow, and if you have anything
> related to acp in your asoundrc.

Both alsa-lib and alsa-ucm-conf are on 1.2.4 I unmerged and emerged them again to make sure the files are consistent after I bisected. I don't use an asoundrc.
Comment 17 Igor V. Kovalenko 2021-06-26 22:24:58 UTC
This is weird, but looks like there are lots of T14 AMD variants https://forums.lenovo.com/t5/ThinkPad-T400-T500-and-newer-T-series-Laptops/T14s-AMD-no-HDMI-audio-on-Linux/m-p/5081195?page=4#5339842

Which model do you have, and have you looked into updating your BIOS?
Comment 18 Thymo van Beers 2021-06-27 20:34:31 UTC
(In reply to Igor V. Kovalenko from comment #17)
> This is weird, but looks like there are lots of T14 AMD variants
> https://forums.lenovo.com/t5/ThinkPad-T400-T500-and-newer-T-series-Laptops/
> T14s-AMD-no-HDMI-audio-on-Linux/m-p/5081195?page=4#5339842
> 
> Which model do you have, and have you looked into updating your BIOS?

The model number is 20UES06X00 (https://pcsupport.lenovo.com/us/en/products/laptops-and-netbooks/thinkpad-t-series-laptops/thinkpad-t14-type-20ud-20ue/20ue/20ues06x00/parts/display/model)
My BIOS was in fact out of date, so I upgraded it. It did not solve any audio related issues unfortunately.
Comment 19 Igor V. Kovalenko 2021-06-27 21:08:35 UTC
Not much turned out for 20UES06X00 model on the net.

You probably can get your mic back if you append "use_ucm=0" to module-udev-detect in /etc/pulse/default.pa

- If that helps, there may be a problem with alsa UCM. Let's try to get pulseaudio-14.99.2_pre1 running to rule out existing fixes on pulseaudio side.

- If that does not help, let's check if device works with alsa.
  1. Can you record mic audio from any alsa device?
  2. Please check if there are any errors related to 'acp' or 'acp_pdm_mach' in dmesg or journal
Comment 20 Igor V. Kovalenko 2021-07-04 19:15:01 UTC
(In reply to Thymo van Beers from comment #18)
> (In reply to Igor V. Kovalenko from comment #17)
> > This is weird, but looks like there are lots of T14 AMD variants
> > https://forums.lenovo.com/t5/ThinkPad-T400-T500-and-newer-T-series-Laptops/
> > T14s-AMD-no-HDMI-audio-on-Linux/m-p/5081195?page=4#5339842
> > 
> > Which model do you have, and have you looked into updating your BIOS?
> 
> The model number is 20UES06X00
> (https://pcsupport.lenovo.com/us/en/products/laptops-and-netbooks/thinkpad-t-
> series-laptops/thinkpad-t14-type-20ud-20ue/20ue/20ues06x00/parts/display/
> model)
> My BIOS was in fact out of date, so I upgraded it. It did not solve any
> audio related issues unfortunately.
We were able to establish that this issue is somewhat related to sound drivers being built-in as opposed to be built as modules, which looks like kernel driver bug. Running with modular sound drivers does not expose the original bug, and while not all reasons of that are clear we have what we have here.

Could you please confirm these findings?
Comment 21 Thymo van Beers 2021-08-11 21:15:30 UTC
I went through this again with Igor and we confirmed the issue was having sound drivers built-in to the kernel. Building Device Drivers->Sound Card support as module resolved the issue.

I'll ask on alsa-devel if anything can be done about this or if built-in sound drivers are even supported by then. For now I'll close this issue as it is outside Gentoo's purview and post an update when I get a reply from alsa-devel
Comment 22 Erik Quaeghebeur 2021-09-20 12:54:12 UTC
(In reply to Thymo van Beers from comment #21)
> I went through this again with Igor and we confirmed the issue was having
> sound drivers built-in to the kernel. Building Device Drivers->Sound Card
> support as module resolved the issue.
I have a very similar issue: On my T14 AMD, my internal speakers stopped working some time ago (I usually use a bluetooth headset, so it wasn't an issue before). However, I do not have sound card support built in to my kernel, but have it as modules. I guess I may be missing a module or option in my kernel config.

Would it be OK if I contact you directly by mail to try and fix this issue for me? Otherwise (or in any case), if you know which module(s) or kernel options are related to the ALC257 card?
Comment 23 Thymo van Beers 2021-09-20 13:01:57 UTC
Below are all options I have set related to sound. This also contains stuff like USB audio so you might not need everything. CONFIG_SND_SOC_AMD_* you definitely want.

thymo@apollo ~ $ grep -e "^CONFIG_SND" /boot/config-5.13.0-mainline-t14+
CONFIG_SND=m
CONFIG_SND_TIMER=m
CONFIG_SND_PCM=m
CONFIG_SND_HWDEP=m
CONFIG_SND_SEQ_DEVICE=m
CONFIG_SND_RAWMIDI=m
CONFIG_SND_JACK=y
CONFIG_SND_JACK_INPUT_DEV=y
CONFIG_SND_PCM_TIMER=y
CONFIG_SND_HRTIMER=m
CONFIG_SND_DYNAMIC_MINORS=y
CONFIG_SND_MAX_CARDS=32
CONFIG_SND_PROC_FS=y
CONFIG_SND_VERBOSE_PROCFS=y
CONFIG_SND_VMASTER=y
CONFIG_SND_DMA_SGBUF=y
CONFIG_SND_CTL_LED=m
CONFIG_SND_SEQUENCER=m
CONFIG_SND_SEQ_HRTIMER_DEFAULT=y
CONFIG_SND_SEQ_MIDI_EVENT=m
CONFIG_SND_SEQ_MIDI=m
CONFIG_SND_DRIVERS=y
CONFIG_SND_PCI=y
CONFIG_SND_HDA=m
CONFIG_SND_HDA_GENERIC_LEDS=y
CONFIG_SND_HDA_INTEL=m
CONFIG_SND_HDA_HWDEP=y
CONFIG_SND_HDA_CODEC_REALTEK=m
CONFIG_SND_HDA_CODEC_HDMI=m
CONFIG_SND_HDA_GENERIC=m
CONFIG_SND_HDA_POWER_SAVE_DEFAULT=0
CONFIG_SND_HDA_CORE=m
CONFIG_SND_HDA_COMPONENT=y
CONFIG_SND_HDA_PREALLOC_SIZE=0
CONFIG_SND_INTEL_NHLT=y
CONFIG_SND_INTEL_DSP_CONFIG=m
CONFIG_SND_INTEL_SOUNDWIRE_ACPI=m
CONFIG_SND_USB=y
CONFIG_SND_USB_AUDIO=m
CONFIG_SND_USB_AUDIO_USE_MEDIA_CONTROLLER=y
CONFIG_SND_SOC=m
CONFIG_SND_SOC_AMD_ACP3x=m
CONFIG_SND_SOC_AMD_RENOIR=m
CONFIG_SND_SOC_AMD_RENOIR_MACH=m
CONFIG_SND_SOC_I2C_AND_SPI=m
CONFIG_SND_SOC_DMIC=m
Comment 24 Igor V. Kovalenko 2021-11-26 18:29:11 UTC
As reported on gentoo irc, possibly minimal set of what has to be modular to make this work as of linux-5.10.76

  snd_acp3x_pdm_dma
  snd_acp3x_rn
  snd_rn_pci_acp3x
  snd_pci_acp3x