[PATCH v4 10/23] ASoC: simple-card: Wrong daifmt for CPU end of DPCM DAI link

Sameer Pujar spujar at nvidia.com
Mon Jun 29 18:06:49 CEST 2020



On 6/29/2020 6:26 AM, Kuninori Morimoto wrote:
> External email: Use caution opening links or attachments
>
>
> Hi Sameer
>
>>   simple-audio-card,dai-link at xxx {
>>       format = "i2s";
>>       bitclock-master=<&cpu1>;
>>       frame-master=<&cpu1>;
>>
>>       cpu1: cpu at 0 {
>>           ...
>>       };
>>
>>       codec at 0 {
>>           ...
>>       };
>>
>>       ...
>>   };
>>
>> In above case CPU is expected to be configured as a master and Codec as
>> a slave device. But both CPU/Codec are being configured as slave devices.
>> This happens because asoc_simple_parse_daifmt() uses Codec reference and
>> sets up the 'dai_link->dai_fmt' accordingly while parsing both CPU and
>> Codec.
> I'm sorry but I don't 100% understand about this case...
> asoc_simple_parse_daifmt() should work in this case
>
> The reason why it needs codec node is that
> SND_SOC_DAIFMT_CBx_CFx are "Codec" base Master/Slave.

Currently soc-core has following code snippet,

/snd_soc_runtime_set_dai_fmt() {//
//     ...//
//
//     if (cpu_dai->component->driver->non_legacy_dai_naming)//
//         fmt = inv_dai_fmt;//
//
//     ...//
// }/

Above flips polarity for 'cpu_dai' if 'non_legacy_dai_naming' flag is set.

1. Hence example mentioned in the commit message does not work if my 
'cpu_dai' driver does not have this flag set.

2. While it is true that we consider reference of 'Codec' mode for 
simple CPU<->Codec DAI links, for DPCM this does not seem flexible. For 
DPCM links CPU and Codec are not directly connected (CPU<->Dummy or 
Dummy<->Codec). Please consider, for example, if the DAI link has 
multiple CPU/Codecs. Which 'Codec' reference needs to be considered? 
Isn't it better if we explicitly mention which DAI we want to operate as 
'Master'?

>
> Thank you for your help !!
>
> Best regards
> ---
> Kuninori Morimoto



More information about the Alsa-devel mailing list