lkml.org 
[lkml]   [2016]   [Apr]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] ASoC: pcm: allow changing the playback/capture rates for symmetric links
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.
[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2016-04-27 18:41    [W:0.092 / U:0.424 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site