Sound not working after commit bbf7d3b1c4f40eb02dd1dffb500ba00b0bff0303 on Amlogic A311D device

Péter Ujfalusi peter.ujfalusi at linux.intel.com
Tue Jul 12 10:00:30 CEST 2022



On 11/07/2022 17:33, Pierre-Louis Bossart wrote:
> 
> 
> On 7/9/22 06:19, Alex Natalsson wrote:
>>>> +       if (!fe_substream) {
>>>> +               dev_err(fe->dev, "%s: fe_substream not initialized\n",
>>>> __func__);
>>>> +               return -EINVAL;
>>>> +       }
>>>> +       if (!be_substream) {
>>>> +               dev_err(be->dev, "%s: be_substream not initialized\n",
>>>> __func__);
>>>> +               return -EINVAL;
>>>> +       }
>>>> +
>>
>> Will be this in upstream or needing bugzilla reporting message?
> I created a patch based on this, see
> https://github.com/thesofproject/linux/pull/3735
> 
> I am not sure however if this is the 'right' fix. There was a comment
> from Peter Ujfalusi that a BE substream may be initialized later, but if
> that's the case then the atomicity check that was introduced is done in
> the wrong location.

fwiw, the dpcm_apply_symmetry() have this check at line 1822:

/* A backend may not have the requested substream */
if (!be_substream)
	continue;

both dpcm_be_connect() and dpcm_apply_symmetry() are called via
dpcm_fe_dai_open() line 2736-2739:

/* calculate valid and active FE <-> BE dpcms */
dpcm_process_paths(fe, stream, &list, 1);

ret = dpcm_fe_dai_startup(fe_substream);

dpcm_fe_dai_open -> dpcm_process_paths -> dpcm_add_paths > dpcm_be_connect

dpcm_fe_dai_open -> dpcm_fe_dai_startup -> dpcm_apply_symmetry

If the check was added by
6246f283d5e02 ("ASoC: dpcm: skip missing substream while applying symmetry")

It looks like that it is not uncommon to not have be_substream at this
point...

> Takashi, we could use your guidance here.
> Thanks
> -Pierre

-- 
Péter


More information about the Alsa-devel mailing list