From: Mark Brown <broonie@kernel.org>
To: Peter Rosin <peda@axentia.se>
Cc: alsa-devel@alsa-project.org, Liam Girdwood <lgirdwood@gmail.com>,
Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.de>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] ASoC: pcm: allow changing the playback/capture rates for symmetric links
Date: Wed, 27 Apr 2016 17:15:04 +0100 [thread overview]
Message-ID: <20160427161504.GZ3217@sirena.org.uk> (raw)
In-Reply-To: <1461746959-11443-1-git-send-email-peda@axentia.se>
[-- Attachment #1: Type: text/plain, Size: 1164 bytes --]
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.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 473 bytes --]
next prev parent reply other threads:[~2016-04-27 16:15 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-27 8:49 Peter Rosin
2016-04-27 16:15 ` Mark Brown [this message]
2016-04-27 20:45 ` Peter Rosin
2016-04-28 10:38 ` Mark Brown
2016-04-28 11:03 ` Takashi Iwai
2016-04-28 11:10 ` Mark Brown
2016-04-28 11:26 ` Takashi Iwai
2016-04-28 11:41 ` Mark Brown
2016-04-28 12:02 ` Takashi Iwai
2016-04-28 17:13 ` Mark Brown
2016-05-02 7:43 ` Peter Rosin
2016-05-04 16:49 ` Mark Brown
2016-05-09 12:17 ` [alsa-devel] " Takashi Iwai
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=20160427161504.GZ3217@sirena.org.uk \
--to=broonie@kernel.org \
--cc=alsa-devel@alsa-project.org \
--cc=lgirdwood@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=peda@axentia.se \
--cc=perex@perex.cz \
--cc=tiwai@suse.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®