From: Daniel Baluta <daniel.baluta@gmail.com>
To: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Cc: Linux-ALSA <alsa-devel@alsa-project.org>,
Kai Vehmanen <kai.vehmanen@linux.intel.com>,
Daniel Baluta <daniel.baluta@oss.nxp.com>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
Liam Girdwood <lgirdwood@gmail.com>,
Mark Brown <broonie@kernel.org>,
Ranjani Sridharan <ranjani.sridharan@linux.intel.com>,
Takashi Iwai <tiwai@suse.com>,
Daniel Baluta <daniel.baluta@nxp.com>
Subject: Re: [PATCH] ASoC: SOF: compr: Add compress ops implementation
Date: Tue, 18 Jan 2022 20:26:58 +0200 [thread overview]
Message-ID: <CAEnQRZBsJbcdx_H9ChcPTGEbe+Ok8mVGG+1wVYe2pDF+9RqbQA@mail.gmail.com> (raw)
In-Reply-To: <9b3d28f3-aa2b-ade9-4160-752b349bdeab@linux.intel.com>
Thanks Pierre for comments.
On Sat, Jan 15, 2022 at 1:01 AM Pierre-Louis Bossart
<pierre-louis.bossart@linux.intel.com> wrote:
>
>
> 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.
Will do.
>
> > +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).
This is on my TODO list. I think there is some more work needed to be
done in FW.
>
> 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.
Very good observations here.
>
> > +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;
> }
There is no need for a SOF specific definition. I think we can use
that for now. We can change it later if we
need new fields.
prev parent reply other threads:[~2022-01-18 18:28 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-13 16:13 [PATCH] ASoC: SOF: compr: Add compress ops implementation Daniel Baluta
2022-01-14 15:49 ` Cezary Rojewski
2022-01-18 17:59 ` Daniel Baluta
2022-01-14 17:55 ` Pierre-Louis Bossart
2022-01-18 18:26 ` Daniel Baluta [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAEnQRZBsJbcdx_H9ChcPTGEbe+Ok8mVGG+1wVYe2pDF+9RqbQA@mail.gmail.com \
--to=daniel.baluta@gmail.com \
--cc=alsa-devel@alsa-project.org \
--cc=broonie@kernel.org \
--cc=daniel.baluta@nxp.com \
--cc=daniel.baluta@oss.nxp.com \
--cc=kai.vehmanen@linux.intel.com \
--cc=lgirdwood@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=pierre-louis.bossart@linux.intel.com \
--cc=ranjani.sridharan@linux.intel.com \
--cc=tiwai@suse.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).