Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ACP6x: PulseAudio profiles different (from the legacy probe) #215

Open
sebastianst opened this issue Sep 20, 2022 · 14 comments
Open

ACP6x: PulseAudio profiles different (from the legacy probe) #215

sebastianst opened this issue Sep 20, 2022 · 14 comments

Comments

@sebastianst
Copy link

My Ryzen 6000 laptop has an AMD audio coprocessor driving the microphone with the ACP6x kernel module. #138 added initial support for this, but me and some other people on different Ryzen 6000 laptops have issues with alsa-ucm not configuring the microphone properly. We have to disable alsa-ucm to get any sound input or output working with pulseaudio, see https://bbs.archlinux.org/viewtopic.php?pid=2058087#p2058087 for the relevant discussion. Note that we first had to add our laptops to some quirk table of the kernel module to get it working at all.

Any idea how to fix this?

@superm1
Copy link
Contributor

superm1 commented Sep 20, 2022

Sound input should be fixed via https://lore.kernel.org/alsa-devel/[email protected]/

@travisghansen
Copy link

As a heads up I'm running wireplumber with the same setup and everything appears to 'just work' in my setup (after applying the quirk patch that is).

@sebastianst
Copy link
Author

Sound input should be fixed via https://lore.kernel.org/alsa-devel/[email protected]/

I know, I'm running a 6.0 kernel with this patch applied. My bug report relates to the fact that it seems that no correct alsa-ucm configuration is loaded because pulseaudio suddenly shows all devices with the generic "HiFi Stereo" profile and no sound input or output works at all, unless alsa-ucm is disabled in the pulseaudio configuration.

@perexg
Copy link
Member

perexg commented Sep 22, 2022

Could you attach alsaucm -c hw:0 dump text output? Replace 0 with the HDA card number (aplay -l).

@sebastianst
Copy link
Author

$ aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: Generic [HD-Audio Generic], device 3: HDMI 0 [DELL S2722QC]
  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: ALC257 Analog [ALC257 Analog]
  Subdevices: 0/1
  Subdevice #0: subdevice #0
$ alsaucm -c hw:1 dump text
Verb.HiFi {
	Comment "Play HiFi quality Music"
	Device.Mic1 {
		Comment "Digital Microphone"
		Values {
			CaptureCTL "_ucm0001.hw:Generic_1"
			CaptureMixerElem "Mic ACP LED"
			CapturePCM "_ucm0001.hw:acp6x"
			CapturePriority 100
			CaptureSwitch "Mic ACP LED Capture Switch"
			PlaybackCTL "_ucm0001.hw:Generic_1"
			TQ HiFi
		}
	}
	Device.Headphones {
		Comment Headphones
		Values {
			CaptureCTL "_ucm0001.hw:Generic_1"
			JackControl "Headphone Jack"
			PlaybackCTL "_ucm0001.hw:Generic_1"
			PlaybackMasterElem Master
			PlaybackMixerElem Headphone
			PlaybackPCM "_ucm0001.hw:Generic_1"
			PlaybackPriority 200
			PlaybackSwitch "Headphone Playback Switch"
			PlaybackVolume "Headphone Playback Volume"
			TQ HiFi
		}
	}
	Device.Speaker {
		Comment Speaker
		Values {
			CaptureCTL "_ucm0001.hw:Generic_1"
			PlaybackCTL "_ucm0001.hw:Generic_1"
			PlaybackMasterElem Master
			PlaybackMixerElem Speaker
			PlaybackPCM "_ucm0001.hw:Generic_1"
			PlaybackPriority 100
			PlaybackSwitch "Speaker Playback Switch"
			PlaybackVolume "Speaker Playback Volume"
			TQ HiFi
		}
	}
	Device.Mic2 {
		Comment "Headphones Stereo Microphone"
		Values {
			CaptureCTL "_ucm0001.hw:Generic_1"
			CaptureMasterElem "Mic Boost"
			CaptureMixerElem Capture
			CapturePCM "_ucm0001.hw:Generic_1"
			CapturePriority 200
			CaptureSwitch "Capture Switch"
			CaptureVolume "Capture Volume"
			JackControl "Mic Jack"
			PlaybackCTL "_ucm0001.hw:Generic_1"
			TQ HiFi
		}
	}
}

And for completeness

$ arecord -l
**** List of CAPTURE Hardware Devices ****
card 1: Generic_1 [HD-Audio Generic], device 0: ALC257 Analog [ALC257 Analog]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 2: acp6x [acp6x], device 0: DMIC capture dmic-hifi-0 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0

card 2 is the mic and alsaucm -c hw:2 dump text is empty.

@sebastianst
Copy link
Author

Maybe also interesting

$ lspci -nn | grep Audio
04:00.1 Audio device [0403]: Advanced Micro Devices, Inc. [AMD/ATI] Rembrandt Radeon High Definition Audio Controller [1002:1640]
04:00.5 Multimedia controller [0480]: Advanced Micro Devices, Inc. [AMD] ACP/ACP3X/ACP6x Audio Coprocessor [1022:15e2] (rev 60)
04:00.6 Audio device [0403]: Advanced Micro Devices, Inc. [AMD] Family 17h/19h HD Audio Controller [1022:15e3]

The second Audio Coprocessor is the mic.

@perexg
Copy link
Member

perexg commented Sep 22, 2022

I don't see an obvious error here. Could you attach the pulseaudio debug log?

https://fedoraproject.org/wiki/How_to_debug_PulseAudio_problems

@sebastianst
Copy link
Author

sebastianst commented Sep 22, 2022

  • pa-no-ucm.log - pulseaudio daemon output with alsa-ucm disabled in /etc/pulse/default.pa using line load-module module-udev-detect use_ucm=0 -> inputs and outputs visible in pavucontrol
  • pa-ucm.log - daemon output with ucm enabled -> no inputs or outputs visible in pavucontrol

@perexg
Copy link
Member

perexg commented Sep 22, 2022

The wrong comment in the PA config broke everything (duplicate whole line and comment out the use_ucm=0 version):

Failed to load module "module-udev-detect" (argument: "#use_ucm=0"): initialization failed.

@sebastianst
Copy link
Author

oops sorry! pa-ucm.log

@perexg
Copy link
Member

perexg commented Sep 22, 2022

If you select the 'Speaker' device, then there is no sound ? Could you attach output from amixer -c Generic_1 contents command when the playback using the UCM device is active?

@sebastianst
Copy link
Author

Here are the contents with pulseaudio running with and without the use_ucm=0 settings
amixer-contents-ucm.txt
amixer-contents-no-ucm.txt
Basically the same output, just the Speaker Playback Volume is 0,0 in one case and 71,71 in the other.

Maybe I didn't make the problem clear in my first post, I do still hear audio even with UCM. The problem is just that pulseaudio only shows the generic profiles Play HiFi quality Music for all cards. So it wouldn't know about 5.1 HDMI etc. With ucm disabled in pa, it shows proper profiles, not the generic ones. Or when the mic kernel module is not loaded but ucm is enabled, pa also shows proper profiles.

@perexg
Copy link
Member

perexg commented Sep 23, 2022

UCM describes the hardware in a different way than the legacy PA probe, thus there are some differences. I am aware about it (missing multichannel configs). On the other hand, you can use multiple HDMI stereo outputs with UCM (impossible with the default PA probe) and UCM combines the analog i/o (HDA codec) and digital mic (ACP) to one logical internal soundcard.

Do you use another configuration for HDMI out than stereo at the time ?

@perexg perexg changed the title ACP6x: UCM not working ACP6x: PulseAudio profiles different (from the legacy probe) Sep 23, 2022
@ashixu
Copy link

ashixu commented May 6, 2023

I am very glad to find solutions to the audio problem I'm facing now. It seems I should change the audio codex and reset the kernel. But due to my lack of knowledge and I'm not good at English, I don't know how to complete the steps. I hope you can give me a detailed guidance. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants