[alsa-devel] How to correct params_format on DPCM ?
Kuninori Morimoto
kuninori.morimoto.gx at renesas.com
Fri Apr 10 09:12:28 CEST 2015
Hi Mark
> > rsnd: SNDRV_PCM_FMTBIT_S24_LE | SNDRV_PCM_FMTBIT_S16_LE
> > ak4642: SNDRV_PCM_FMTBIT_S16_LE
(snip)
> I'm not sure what exactly was intended here but this seems to need
> fixing in the core - I think the assumption in the DPCM code is that
> the sort of hardware that uses it will have rewriting support that makes
> the back end constraints irrelevant to the front end. I think what we
> want here is some way to signal to the framework that the front end
> constraints aren't used and it should use the back end ones instead -
> perhaps just omit the constraints that aren't rewritten and then have
> the framework take those from the backend instead.
Now I'm debuging about this issue, but it is very complex.
I need your help. where should I check/debug ?
My problem is...
In non-DPCM case
cpu : rsnd : SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S24_LE
codec: ak4642: SNDRV_PCM_FMTBIT_S16_LE
-----------------------------------------
SNDRV_PCM_FMTBIT_S16_LE is used, this is OK
In DPCM case
FE cpu : rsnd : SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S24_LE
FE codec: dummy : SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S24_LE | ...
BE cpu : dummy : SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S24_LE | ...
BE codec: ak4642: SNDRV_PCM_FMTBIT_S16_LE
SNDRV_PCM_FMTBIT_S24_LE is used on FE,
SNDRV_PCM_FMTBIT_S16_LE is used on BE.
this means FE send S24 data, but BE can't use it.
Which function/method controls format ?
I guess it is doning some kind of
format = cpu->formats & codec->formats;
DPCM case need to care about FE/BE, and maybe this is lost item.
format = fe_cpu->formats & fe_codec->formats &
be_cpu->formats & be_codec->formats;
I guess it is done before hw_param() (?),
or snd_soc_instantiate_card() timing. but I couldn't find it.
It is very confusable/complex. which function is doing this ?
Best regards
---
Kuninori Morimoto
More information about the Alsa-devel
mailing list