Re: Question about Tegra UCMs

From: Dmitry Osipenko
Date: Wed May 19 2021 - 09:15:49 EST


19.05.2021 14:13, Jaroslav Kysela пишет:
> Dne 19. 05. 21 v 0:31 Dmitry Osipenko napsal(a):
>> Mark, could you please help me to understand the UCM naming scheme that ALSA uses..
>>
>> About a year ago I tried to complain to Jaroslav Kysela in a comment to the UCM change [1] that it should be breaking the naming scheme of Tegra UCMs, but haven't got a meaningful reply and moved on to other things.
>>
>> [1] https://github.com/alsa-project/alsa-ucm-conf/commit/8ff2d50745efbb6959324f672460e413f0b618b8
>
> I'm sorry about that, but it's better to create a tracked ticket (issue or
> pull request).
>
>> Today I noticed that the naming scheme changed again and I still don't understand what to do about it.
>>
>> I have two devices:
>>
>> 1. Acer Picasso tablet that uses "Acer Iconia Tab A500 WM8903" for the card model name.
>>
>> 2. Google Nexus 7 that uses "ASUS Google Nexus 7 ALC5642".
>>
>> Previously UCMs were picked up by pulseaudio from these paths:
>>
>> 1. /usr/share/alsa/ucm2/Acer Iconia Tab A500 WM8903/
>> 2. /usr/share/alsa/ucm2/ASUS Google Nexus 7 ALC5642/
>>
>> Now the lookup paths are changed to:
>>
>> 1. /usr/share/alsa/ucm2/Acer_Iconia_Tab/
>> 2. /usr/share/alsa/ucm2/ASUS_Google_Nex/
>
> Yes, it's based on the driver name (which is incorrectly set /or not set/ in
> your case).
>
> Lookup paths (with description):
>
> https://github.com/alsa-project/alsa-ucm-conf/blob/master/ucm2/ucm.conf
>
> The latest scheme is even different - lookups were moved to ucm2/conf.d with
> redirection to the more descriptive layered configuration tree structure, so
> the other developers can immediately identify the hardware which is
> configured. See Qualcomm examples. The long card names does not help us so much.
>
>> Strace shows that pulseaudio searches UCMs only at these paths.
>>
>> The output of /proc/asound/cards:
>>
>> 0 [WM8903 ]: Acer_Iconia_Tab - Acer Iconia Tab A500 WM8903
>> Acer Iconia Tab A500 WM8903
>>
>> 0 [ALC5642 ]: ASUS_Google_Nex - ASUS Google Nexus 7 ALC5642
>> ASUS Google Nexus 7 ALC5642
>
> Fields are explained in:
>
> https://github.com/alsa-project/alsa-ucm-conf/blob/master/ucm2/README.md
>
>> Is there anything on the kernel side that I could change to get a working naming scheme? If yes, I may try to do something about it in the v2, thanks in advance.
>
> Try to set a meaningful driver name (usually the code handling the ASoC card
> creation). It should be very close to the kernel module name (but more user
> friendly). The current code for your hardware use the auto-generated driver
> name from the ALSA long name.

The current name isn't auto-generated, it's specified via the
nvidia,model device-tree property.

> Then try to reuse the existing configs - for example your Nexus 7 config has
> many blocks from codecs/rt5640/* .
>
> Anyway, create a PR so we can discuss the details.

I will create the PR, thank you very much. It's important problem which
can't be postponed anymore since sound doesn't work without UCMs on
Tegra devices.