alsa-project alsa-ucm : Audio endpoint is not switching when external mic connected

Jaroslav Kysela perex at perex.cz
Wed Jun 3 13:05:20 CEST 2020


Dne 03. 06. 20 v 12:32 Mukunda, Vijendar napsal(a):
> 
> 
>> -----Original Message-----
>> From: Takashi Iwai <tiwai at suse.de>
>> Sent: Wednesday, June 3, 2020 3:05 PM
>> To: Hui Wang <hui.wang at canonical.com>
>> Cc: Jaroslav Kysela <perex at perex.cz>; Mukunda, Vijendar
>> <Vijendar.Mukunda at amd.com>; alsa-devel at alsa-project.org
>> Subject: Re: alsa-project alsa-ucm : Audio endpoint is not switching when
>> external mic connected
>>
>> On Wed, 03 Jun 2020 02:36:25 +0200,
>> Hui Wang wrote:
>>>
>>>
>>> On 2020/6/3 上午3:39, Jaroslav Kysela wrote:
>>>> Dne 02. 06. 20 v 19:57 Mukunda, Vijendar napsal(a):
>>>>> We recently up streamed ACP PDM driver for Renoir APU.
>>>>>
>>>>> Our ACP IP has an internal PDM Decoder block where DMIC is directly
>>>>> connected.
>>>>> There are no KControls defined for PDM Driver.
>>>>>
>>>>> Our platform supports on board DMIC and South bridge Azalia (HD
>>>>> Audio ) endpoint .
>>>>> By default, DMIC endpoint is used as audio input device.
>>>>> When Headset Mic jack connected, it's not switching to External Mic.
>>>>
>>>> Make sure that the Headset Mic priority port in pulseaudio is is
>>>> greater than the one for DMIC.
>>>>
>>>>> How does audio endpoint will switch in gnome when external mic is
>>>>> connected?
>>>>>>  From our understanding, UCM conf file for HDA driver is also
>>>>>> required for
>>>>> configuring mixer controls for HD Audio capture device.
>>>>> Similarly when External Mic is removed , it has to switch to
>>>>> internal dmic .
>>>>
>>>> An configuration example for UCM (DMIC connected to DSP, HDA codec
>>>> for rest):
>>>>
>>>>
>> https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub
>> .com%2Falsa-project%2Falsa-ucm-conf%2Ftree%2Fmaster%2Fucm2%2Fsof-
>> hda-
>> dsp&data=02%7C01%7CVijendar.Mukunda%40amd.com%7C5fbb3a516d5
>> 24c73568d08d807a157a1%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C
>> 0%7C637267736827671946&sdata=0aO7dbLATuW%2BIeJsjWoWCGOaYEO
>> WQaVwI9izppB3v7k%3D&reserved=0
>>>>
>>>> If you need a help to create a new configuration for your hardware,
>>>> show the output from the alsa-info.sh script, please.
>>>>
>>>>                      Jaroslav
>>>
>>> This audio design is  a bit different from sof-hda-dsp, the dmic is on
>>> a standalone sound card. Please see the alsa-info.txt:
>>>
>>>
>> https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fpasteb
>> in.ubuntu.com%2Fp%2F4kprhDZYbg%2F&data=02%7C01%7CVijendar.Mu
>> kunda%40amd.com%7C5fbb3a516d524c73568d08d807a157a1%7C3dd8961fe4
>> 884e608e11a82d994e183d%7C0%7C0%7C637267736827671946&sdata=Q
>> 50xNbF1KSqasNa0UyKzUFAzOc9KPIguBjgYHr1XSbg%3D&reserved=0
>>
>> And that's an interesting case.  Can we manage multiple cards in a
>> single UCM profile?
>>
>>
>> Takashi
> 
> I am not much familiar with UCM files creation.
> As per my understanding, UCM entries will program the mixer controls
> depending up on the use case and selected device.
> 
> But for PDM sound card there are no mixer controls defined.
> Do we still need to add UCM entries for PDM sound card  along with UCM entries for
> HD Audio sound card ?
> For example mentioning the pcm device for PDM sound card,
> even we don't program any specific kcontrols ?

UCM describes the verbs (profiles), devices (ports in PA) in verbs and the 
enable/disable/transition settings. So it's not only about the kcontrols.

Basically, for your case, you need to configure pulseaudio correctly for the 
legacy probe ALSA soundcard mechanism (priorities). PA should switch to the 
profile/port with the highest priority when available. There is also some 
gnome code which handles the shared mic/headset mic inputs where the hardware 
cannot detect the connected device (it may not work for your case correctly).

Or, you may create one UCM verb with the devices from multiple ALSA soundcards 
(and the PA will handle this in the one profile like one legacy soundcard).

					Jaroslav

-- 
Jaroslav Kysela <perex at perex.cz>
Linux Sound Maintainer; ALSA Project; Red Hat, Inc.


More information about the Alsa-devel mailing list