Re: [alsa-devel] [PATCH] ASoC: Intel: kbl_rt5663_rt5514_max98927: Add dmic format constraint

From: Pierre-Louis Bossart
Date: Fri Sep 13 2019 - 13:28:16 EST

please don't top-post on public mailing lists, thanks.

On 9/13/19 9:45 AM, Yu-Hsuan Hsu wrote:
Thanks for the review! If I'm not mistaken, the microphone is attached to external codec(rt5514) instead of PCH on Kabylake platform. So there should be a TDM between DMICs and PCH. We can see in the kabylake_ssp0_hw_paramsÂfunction, there are some operations about settingÂtdm slot_width to 16 bits. Therefore, I think it only supports S16_LE format for DMICs. Is it correct?

Ah yes, ok. we have other machine drivers where dmic refers to the PCH attached case, thanks for the precision.

I am still not clear on the problem, you are adding this constraint to a front-end, so in theory the copier element in the firmware should take care of converting from 16-bits recorded on the TDM link to the 24 bits used by the application. Is this not the case? is this patch based on an actual error and if yes can you share more information to help check where the problem happens, topology maybe?

Pierre-Louis Bossart <pierre-louis.bossart@xxxxxxxxxxxxxxx <mailto:pierre-louis.bossart@xxxxxxxxxxxxxxx>> æ 2019å9æ12æ éå ä å9:02åéï

On 9/11/19 9:27 PM, Yu-Hsuan Hsu wrote:
> 24 bits recording from DMIC is not supported for KBL platform because
> the TDM slot between PCH and codec is 16 bits only. We should add a
> constraint to remove that unsupported format.

Humm, when you use DMICs they are directly connected to the PCH with a
standard 1-bit PDM. There is no notion of TDM or slot.

It could very well be that the firmware/topology only support 16 bit (I
vaguely recall another case where 24 bits was added), but the
description in the commit message would need to be modified to make the
reason for this change clearer.

> Signed-off-by: Yu-Hsuan Hsu <yuhsuan@xxxxxxxxxxxx
> ---
>Â Âsound/soc/intel/boards/kbl_rt5663_rt5514_max98927.c | 3 +++
>Â Â1 file changed, 3 insertions(+)
> diff --git a/sound/soc/intel/boards/kbl_rt5663_rt5514_max98927.c
> index 74dda8784f1a01..67b276a65a8d2d 100644
> --- a/sound/soc/intel/boards/kbl_rt5663_rt5514_max98927.c
> +++ b/sound/soc/intel/boards/kbl_rt5663_rt5514_max98927.c
> @@ -400,6 +400,9 @@ static int kabylake_dmic_startup(struct
snd_pcm_substream *substream)
>Â Â Â Âsnd_pcm_hw_constraint_list(runtime, 0,
>Â Â Â Â Â Â Â Â Â Â Â Âdmic_constraints);
> +Â Â Âruntime->hw.formats = SNDRV_PCM_FMTBIT_S16_LE;
> +Â Â Âsnd_pcm_hw_constraint_msbits(runtime, 0, 16, 16);
> +
>Â Â Â Âreturn snd_pcm_hw_constraint_list(substream->runtime, 0,
>Â Â Â Â Â Â Â Â Â Â Â ÂSNDRV_PCM_HW_PARAM_RATE, &constraints_rates);
>Â Â}