Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1389311

Re: [PATCH] ASoC: pcm: allow changing the playback/capture rates for symmetric links

From Mark Brown <broonie@kernel.org>
Newsgroups linux.kernel
Subject Re: [PATCH] ASoC: pcm: allow changing the playback/capture rates for symmetric links
Date 2016-04-27 18:20 +0200
Message-ID <rsAlY-41b-15@gated-at.bofh.it> (permalink)
References <rstDQ-779-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


[Multipart message — attachments visible in raw view] - view raw

On Wed, Apr 27, 2016 at 10:49:19AM +0200, Peter Rosin wrote:

> The below program fails on a dai link with symmetric rates without this
> patch. The patch makes it work.

You've not articulated the problem you're trying to fix here, what in
concrete terms is the program trying to accomplish and why should it
succeed?

>     if ((fd = open("/dev/dsp", O_WRONLY, 0)) == -1) {
>             perror("open");
>             return 1;
>     }

This is using the OSS interfaces which really haven't ever been
especially supported for ASoC.

> +	if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
> +		if (!cpu_dai->capture_active)
> +			return 0;
> +	} else if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) {
> +		if (!cpu_dai->playback_active)
> +			return 0;
> +	}
> +
>  	rate = params_rate(params);
>  	channels = params_channels(params);
>  	sample_bits = snd_pcm_format_physical_width(params_format(params));

This means we've opened up a race where the stream is configured but not
started where the opposite direction can configure a different setup.
Since starting both directions very close together is a common operation
it seems likely to cause issues.

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH] ASoC: pcm: allow changing the playback/capture rates for symmetric links Peter Rosin <peda@axentia.se> - 2016-04-27 11:10 +0200
  Re: [PATCH] ASoC: pcm: allow changing the playback/capture rates for  symmetric links Mark Brown <broonie@kernel.org> - 2016-04-27 18:20 +0200
    Re: [PATCH] ASoC: pcm: allow changing the playback/capture rates for  symmetric links Peter Rosin <peda@axentia.se> - 2016-04-27 22:50 +0200

csiph-web