1
0
Fork 0

MLK-23701-3 ASoc: fsl: Fill pcm_io_frames and sampling_rate

Get samplerate and consumed data from dsp when call
snd_compr_ops.pointer.

Signed-off-by: Zhang Peng <peng_zhang_8@nxp.com>
5.4-rM2-2.2.x-imx-squashed
Zhang Peng 2020-03-30 16:11:24 +08:00 committed by Zhang Peng
parent d235be4b28
commit 92d77a4619
2 changed files with 17 additions and 3 deletions

View File

@ -350,13 +350,26 @@ static int dsp_platform_compr_pointer(struct snd_compr_stream *cstream,
struct snd_soc_component *component = snd_soc_rtdcom_lookup(rtd, FSL_DSP_COMP_NAME);
struct fsl_dsp *dsp_priv = snd_soc_component_get_drvdata(component);
struct dsp_data *drv = &dsp_priv->dsp_data;
struct xf_get_param_msg g_param[2];
int ret;
g_param[0].id = XA_RENDERER_CONFIG_PARAM_SAMPLE_RATE;
g_param[1].id = XA_RENDERER_CONFIG_PARAM_CONSUMED;
ret = xaf_comp_get_config(drv->client, &drv->component[1], 2, &g_param);
if (ret) {
dev_err(component->dev,
"get param[cmd:0x%x|val:0x%x] error, err = %d\n",
g_param[0].id, g_param[0].mixData.value, ret);
goto out;
}
tstamp->copied_total = drv->client->input_bytes;
tstamp->byte_offset = drv->client->input_bytes;
tstamp->pcm_frames = 0x900;
tstamp->pcm_io_frames = 0,
tstamp->sampling_rate = 48000;
tstamp->pcm_io_frames = g_param[0].mixData.value,
tstamp->sampling_rate = g_param[1].mixData.value;
out:
return 0;
}

View File

@ -154,7 +154,8 @@ enum xa_config_param_renderer {
XA_RENDERER_CONFIG_PARAM_CHANNELS = 3,
XA_RENDERER_CONFIG_PARAM_SAMPLE_RATE = 4,
XA_RENDERER_CONFIG_PARAM_FRAME_SIZE = 5,
XA_RENDERER_CONFIG_PARAM_NUM = 6,
XA_RENDERER_CONFIG_PARAM_CONSUMED = 6,
XA_RENDERER_CONFIG_PARAM_NUM = 7,
};
#endif /* FSL_DSP_XAF_API_H */