[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <9b3d28f3-aa2b-ade9-4160-752b349bdeab@linux.intel.com>
Date: Fri, 14 Jan 2022 11:55:31 -0600
From: Pierre-Louis Bossart <pierre-louis.bossart@...ux.intel.com>
To: Daniel Baluta <daniel.baluta@....nxp.com>, broonie@...nel.org,
alsa-devel@...a-project.org
Cc: kai.vehmanen@...ux.intel.com, lgirdwood@...il.com,
linux-kernel@...r.kernel.org, tiwai@...e.com,
ranjani.sridharan@...ux.intel.com, daniel.baluta@....com
Subject: Re: [PATCH] ASoC: SOF: compr: Add compress ops implementation
Thanks for starting this work Daniel.
> +int sof_compr_get_params(struct snd_soc_component *component,
> + struct snd_compr_stream *cstream, struct snd_codec *params)
> +{
> + return 0;
> +}
You should probably add a statement along the lines of:
/* TODO: we don't query the supported codecs for now, if the application
asks for an unsupported codec the set_params() will fail
*/
.get_codec_caps is also missing, it should be documented as something we
want to add.
> +static int sof_compr_pointer(struct snd_soc_component *component,
> + struct snd_compr_stream *cstream,
> + struct snd_compr_tstamp *tstamp)
> +{
> + struct snd_compr_runtime *runtime = cstream->runtime;
> + struct sof_compr_stream *sstream = runtime->private_data;
> +
> + tstamp->sampling_rate = sstream->sample_rate;
> + tstamp->copied_total = sstream->copied_total;
Humm, this doesn't return any information on how many PCM samples were
generated (pcm_frames) or rendered (pcm_io_frames).
I don't think the existing SOF firmware has this level of detail for
now, you should at least document it as to be added in the future.
In addition, the .pointer callback can be used at different times, and
for added precision the information should be queried from the firmware
via IPC or by looking up counters in the SRAM windows.
I don't think it's good enough to update the information on a fragment
elapsed event. It will work for sure in terms of reporting compressed
data transfers, but it's not good enough for an application to report
time elapsed.
> +struct sof_compr_stream {
> + unsigned int copied_total;
> + unsigned int sample_rate;
> + size_t posn_offset;
> +};
do you need an SOF-specific definition? This looks awfully similar to
snd_compr_tstamp:
struct snd_compr_tstamp {
__u32 byte_offset;
__u32 copied_total;
__u32 pcm_frames;
__u32 pcm_io_frames;
__u32 sampling_rate;
}
Powered by blists - more mailing lists