All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mark Brown <broonie@opensource.wolfsonmicro.com>
To: Dong Aisheng <b29396@freescale.com>
Cc: alsa-devel@alsa-project.org, s.hauer@pengutronix.de, lrg@ti.com,
	linux-arm-kernel@lists.infradead.org, w.sang@pengutronix.de
Subject: Re: [PATCH 1/1] ASoC: soc-core: check rate for symmetry only when pcm is ongoing
Date: Wed, 24 Aug 2011 10:19:03 +0100	[thread overview]
Message-ID: <20110824091902.GR9232@opensource.wolfsonmicro.com> (raw)
In-Reply-To: <1314172640-26972-1-git-send-email-b29396@freescale.com>

On Wed, Aug 24, 2011 at 03:57:20PM +0800, Dong Aisheng wrote:

> Now we only check rate for symmetry when the pcm is really ongoing
> which seems more sensible.

There's a genuine issue here due to the raciness of the ALSA APIs -
we're not enforcing constraints and we should be.  If the two programs
end up setting incompatible rates we need to handle that.

>  	/* Symmetry data - only valid if symmetry is being enforced */
>  	unsigned int rate;
> +	unsigned int ongoing;

This isn't a clear name, I don't understand it.

> @@ -209,6 +212,7 @@ static int soc_pcm_open(struct snd_pcm_substream *substream)
>  	cpu_dai->active++;
>  	codec_dai->active++;
>  	rtd->codec->active++;
> +	rtd->ongoing = 1;
>  	mutex_unlock(&rtd->pcm_mutex);
>  	return 0;
>  
> @@ -322,6 +326,7 @@ static int soc_pcm_close(struct snd_pcm_substream *substream)
>  			SND_SOC_DAPM_STREAM_STOP);
>  	}
>  
> +	rtd->ongoing = 0;

What happens when the stream in one direction is stopped but not the
other?  For example, capture stops but playback continues.

WARNING: multiple messages have this Message-ID (diff)
From: broonie@opensource.wolfsonmicro.com (Mark Brown)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 1/1] ASoC: soc-core: check rate for symmetry only when pcm is ongoing
Date: Wed, 24 Aug 2011 10:19:03 +0100	[thread overview]
Message-ID: <20110824091902.GR9232@opensource.wolfsonmicro.com> (raw)
In-Reply-To: <1314172640-26972-1-git-send-email-b29396@freescale.com>

On Wed, Aug 24, 2011 at 03:57:20PM +0800, Dong Aisheng wrote:

> Now we only check rate for symmetry when the pcm is really ongoing
> which seems more sensible.

There's a genuine issue here due to the raciness of the ALSA APIs -
we're not enforcing constraints and we should be.  If the two programs
end up setting incompatible rates we need to handle that.

>  	/* Symmetry data - only valid if symmetry is being enforced */
>  	unsigned int rate;
> +	unsigned int ongoing;

This isn't a clear name, I don't understand it.

> @@ -209,6 +212,7 @@ static int soc_pcm_open(struct snd_pcm_substream *substream)
>  	cpu_dai->active++;
>  	codec_dai->active++;
>  	rtd->codec->active++;
> +	rtd->ongoing = 1;
>  	mutex_unlock(&rtd->pcm_mutex);
>  	return 0;
>  
> @@ -322,6 +326,7 @@ static int soc_pcm_close(struct snd_pcm_substream *substream)
>  			SND_SOC_DAPM_STREAM_STOP);
>  	}
>  
> +	rtd->ongoing = 0;

What happens when the stream in one direction is stopped but not the
other?  For example, capture stops but playback continues.

  reply	other threads:[~2011-08-24  9:19 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-24  7:57 [PATCH 1/1] ASoC: soc-core: check rate for symmetry only when pcm is ongoing Dong Aisheng
2011-08-24  7:57 ` Dong Aisheng
2011-08-24  9:19 ` Mark Brown [this message]
2011-08-24  9:19   ` Mark Brown
2011-08-24 10:30   ` Dong Aisheng-B29396
2011-08-24 10:30     ` Dong Aisheng-B29396
2011-08-24  9:24 ` Lars-Peter Clausen
2011-08-24  9:24   ` [alsa-devel] " Lars-Peter Clausen
2011-08-24 10:39   ` Dong Aisheng-B29396
2011-08-24 10:39     ` Dong Aisheng-B29396
2011-08-24 11:01     ` Lars-Peter Clausen
2011-08-24 11:01       ` [alsa-devel] " Lars-Peter Clausen

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=20110824091902.GR9232@opensource.wolfsonmicro.com \
    --to=broonie@opensource.wolfsonmicro.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=b29396@freescale.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=lrg@ti.com \
    --cc=s.hauer@pengutronix.de \
    --cc=w.sang@pengutronix.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.