alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
From: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
To: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>, broonie@kernel.org
Cc: alsa-devel@alsa-project.org, ckeepax@opensource.cirrus.com,
	linux-kernel@vger.kernel.org, tiwai@suse.com,
	lgirdwood@gmail.com, vkoul@kernel.org
Subject: Re: [PATCH 10/11] ASoC: qdsp6-dai: add gapless support
Date: Wed, 8 Jul 2020 11:58:21 -0500	[thread overview]
Message-ID: <b0aa1cff-33c9-a44d-b17b-d2e4e42d60f1@linux.intel.com> (raw)
In-Reply-To: <e6d10009-d01e-d506-1aa3-a915ef42a693@linaro.org>


>> right, but the key point is 'switch between streams'. That means a 
>> more complex/capable implementation that should be advertised as such 
>> to applications. This is not the default behavior assumed initially: 
>> to allow for minimal implementations in memory-constrained devices, we 
>> assumed gapless was supported with a single decoder.
>>
>> Maybe the right way to do this is extend the snd_compr_caps structure:
>>
>> /**
>>   * struct snd_compr_caps - caps descriptor
>>   * @codecs: pointer to array of codecs
>>   * @direction: direction supported. Of type snd_compr_direction
>>   * @min_fragment_size: minimum fragment supported by DSP
>>   * @max_fragment_size: maximum fragment supported by DSP
>>   * @min_fragments: min fragments supported by DSP
>>   * @max_fragments: max fragments supported by DSP
>>   * @num_codecs: number of codecs supported
>>   * @reserved: reserved field
>>   */
>> struct snd_compr_caps {
>>      __u32 num_codecs;
>>      __u32 direction;
>>      __u32 min_fragment_size;
>>      __u32 max_fragment_size;
>>      __u32 min_fragments;
>>      __u32 max_fragments;
>>      __u32 codecs[MAX_NUM_CODECS];
>>      __u32 reserved[11];
>> } __attribute__((packed, aligned(4)));
>>
>>
>> and use a reserved field to provide info on capabilities, and filter 
>> the set_codec_params() addition based this capability - i.e. return 
>> -ENOTSUP in 'traditional' implementations based on a single 
>> 'stream'/decoder instance.

I think this is also what Mark was referring to earlier.

> Sounds good!
> I will give it a go and see how it ends up!

Glad to see this discussion progressing.

We may also want to document the 3 possible ways of supporting gapless 
playback while we are at it:
a) with the existing single decoder assumption
b) with your suggested solution with a switch at the DSP level
c) with 2 streams at the userspace level and a switch/x-fade at the DSP 
level - which may simplify userspace quite a bit and was the initial 
design in a non-Linux OS.

  reply	other threads:[~2020-07-08 16:59 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-07 16:36 [PATCH 00/11] ASoC: qdsp6: add gapless compressed audio support Srinivas Kandagatla
2020-07-07 16:36 ` [PATCH 01/11] ASoC: q6asm: add command opcode to timeout error report Srinivas Kandagatla
2020-07-07 16:36 ` [PATCH 02/11] ASoC: q6asm: rename misleading session id variable Srinivas Kandagatla
2020-07-07 16:36 ` [PATCH 03/11] ASoC: q6asm: make commands specific to streams Srinivas Kandagatla
2020-07-07 16:52   ` Pierre-Louis Bossart
2020-07-08  9:44     ` Srinivas Kandagatla
2020-07-08 13:13       ` Mark Brown
2020-07-08 15:26         ` Srinivas Kandagatla
2020-07-07 16:36 ` [PATCH 04/11] ASoC: q6asm: use flags directly from asm-dai Srinivas Kandagatla
2020-07-07 16:36 ` [PATCH 05/11] ASoC: q6asm: add length to write command token Srinivas Kandagatla
2020-07-07 16:36 ` [PATCH 06/11] ASoC: q6asm: add support to remove intial and trailing silence Srinivas Kandagatla
2020-07-07 16:55   ` Pierre-Louis Bossart
2020-07-08  9:44     ` Srinivas Kandagatla
2020-07-07 16:36 ` [PATCH 07/11] ASoC: q6asm: add support to gapless flag in asm open Srinivas Kandagatla
2020-07-07 16:57   ` Pierre-Louis Bossart
2020-07-08  9:44     ` Srinivas Kandagatla
2020-07-07 16:36 ` [PATCH 08/11] ASoC: q6asm-dai: add next track metadata support Srinivas Kandagatla
2020-07-07 16:36 ` [PATCH 09/11] ASoC: qdsp6: use dev_err instead of pr_err Srinivas Kandagatla
2020-07-07 16:36 ` [PATCH 10/11] ASoC: qdsp6-dai: add gapless support Srinivas Kandagatla
2020-07-07 17:07   ` Pierre-Louis Bossart
2020-07-08  9:44     ` Srinivas Kandagatla
2020-07-08 13:32       ` Pierre-Louis Bossart
2020-07-08 13:42         ` Mark Brown
2020-07-08 15:23         ` Srinivas Kandagatla
2020-07-08 16:58           ` Pierre-Louis Bossart [this message]
2020-07-07 16:36 ` [PATCH 11/11] ASoC: q6asm-dai: add support to copy callback Srinivas Kandagatla
2020-07-08 13:32 ` [PATCH 00/11] ASoC: qdsp6: add gapless compressed audio support Mark Brown
2020-07-08 15:24   ` Srinivas Kandagatla
2020-07-08 16:59 ` Mark Brown

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=b0aa1cff-33c9-a44d-b17b-d2e4e42d60f1@linux.intel.com \
    --to=pierre-louis.bossart@linux.intel.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=ckeepax@opensource.cirrus.com \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=srinivas.kandagatla@linaro.org \
    --cc=tiwai@suse.com \
    --cc=vkoul@kernel.org \
    /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).