alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
From: Kai Vehmanen <kai.vehmanen@linux.intel.com>
To: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Cc: alsa-devel@alsa-project.org,
	Kai Vehmanen <kai.vehmanen@linux.intel.com>,
	ranjani.sridharan@linux.intel.com,
	pierre-louis.bossart@linux.intel.com, broonie@kernel.org,
	digetx@gmail.com
Subject: Re: [PATCH] ASoC: soc-pcm: Revert "call snd_soc_component_open/close() once"
Date: Fri, 28 Feb 2020 14:23:22 +0200 (EET)	[thread overview]
Message-ID: <alpine.DEB.2.21.2002281404580.2957@eliteleevi.tm.intel.com> (raw)
In-Reply-To: <87zhd35eko.wl-kuninori.morimoto.gx@renesas.com>

Hey,

catching up with the thread :)

On Fri, 28 Feb 2020, Kuninori Morimoto wrote:

> > > 	start(substream-A); <=
> > > 	start(substream-B);
> > > 	start(substream-C);
> > >
> > > 	stop(substream-Z);  <=
> > > 	stop(substream-B);
> > > 	stop(substream-C);
[snip]
> I don't want to have substream list on each components,
> and keep simple code as much as possible.
[snip]
> My current idea is using ID. What do you think ?
> It is not super simple though...

Hmm, I think then we end up with new problems managing the IDs.
Specifically:

> 	int soc_pcm_open(...)
> 	{
> 		static u8 id;
> 
> 		/* update ID */
> 		id++;
> 		if (id == 0)
> 			id++;

... this really isn't solid. If you have a complex scenario and something 
goes wrong, debugging the ids is going to be painful if they are assigned 
this way.

I think in the end we should go back to this:

int snd_soc_component_open(struct snd_soc_component *component,
»       »       »          struct snd_pcm_substream *substream)

... this essentially creates new state by assigning a new substream to the 
component, and we should explicitly track it. I know you wanted to avoid 
this, but I think in the end it's the cleanest solution and aligned to 
rest of ALSA. Aside cleaning up implementation of close(), this will help 
also in other methods, like e.g.:

int snd_soc_component_prepare(struct snd_soc_component *component,
»       »       »             struct snd_pcm_substream *substream)
{
»       if (component->driver->prepare)
»       »       return component->driver->prepare(component, substream);
»       return 0;
}

.. if prepare() is called with a substream that is not opened for this 
component, we could catch it here if we were tracking substreams.

Br, Kai

  reply	other threads:[~2020-02-28 12:24 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-19 18:26 [PATCH] ASoC: soc-pcm: Revert "call snd_soc_component_open/close() once" Kai Vehmanen
2020-02-19 18:53 ` Kai Vehmanen
2020-02-19 19:27   ` Pierre-Louis Bossart
2020-02-19 19:37 ` Dmitry Osipenko
2020-02-20  0:42 ` Kuninori Morimoto
2020-02-20  0:59   ` [PATCH][RFC] ASoC: soc-component: count snd_soc_component_open/close() Kuninori Morimoto
2020-02-20  1:25     ` Sridharan, Ranjani
2020-02-20  1:41       ` Kuninori Morimoto
2020-02-20  1:57         ` Sridharan, Ranjani
2020-02-20  3:01           ` Kuninori Morimoto
2020-02-20  9:33   ` [PATCH] ASoC: soc-pcm: Revert "call snd_soc_component_open/close() once" Kai Vehmanen
2020-02-21  1:13     ` Kuninori Morimoto
2020-02-21 11:09       ` Kai Vehmanen
2020-02-25  0:41         ` Kuninori Morimoto
2020-02-26  0:55           ` Kuninori Morimoto
2020-02-26 17:36             ` Mark Brown
2020-02-27  0:11               ` Kuninori Morimoto
2020-02-27  9:41             ` Kai Vehmanen
2020-02-28  0:46               ` Kuninori Morimoto
2020-02-28  6:27                 ` Kuninori Morimoto
2020-02-28  7:57                   ` Kuninori Morimoto
2020-02-28 12:23                     ` Kai Vehmanen [this message]
2020-03-02  0:29                       ` Kuninori Morimoto
2020-03-02 18:22                         ` Kai Vehmanen
2020-03-03  0:43                           ` Kuninori Morimoto
2020-03-03 19:48                             ` Kai Vehmanen
2020-03-04  0:11                               ` Kuninori Morimoto

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=alpine.DEB.2.21.2002281404580.2957@eliteleevi.tm.intel.com \
    --to=kai.vehmanen@linux.intel.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=digetx@gmail.com \
    --cc=kuninori.morimoto.gx@renesas.com \
    --cc=pierre-louis.bossart@linux.intel.com \
    --cc=ranjani.sridharan@linux.intel.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).