From: timur@freescale.com (Timur Tabi)
To: linux-arm-kernel@lists.infradead.org
Subject: [alsa-devel] [RFC v2 PATCH 1/1] ASoC: soc-core: symmetry checking for each DAIs separately
Date: Thu, 1 Sep 2011 13:58:51 -0500 [thread overview]
Message-ID: <4E5FD5EB.50009@freescale.com> (raw)
In-Reply-To: <4E5E264B.8000004@metafoo.de>
Lars-Peter Clausen wrote:
> Without the patch for example 'aplay -r 8000 ... & arecrod -r 16000 ...' would
> result in playback running twice as fast as it is supposed to.
I'm not sure I can reproduce the problem. Executing the above command either
plays audio at the proper rate (with or without your patch), doesn't play
anything at all (it just sits there), or gives me this error message:
soc-audio soc-audio: set sample size in capture stream first
(sometimes it says "playback" instead of "capture").
This message is generated by this code in fsl_ssi.c:
/* This is the second stream open, so we need to impose sample
* rate and maybe sample size constraints. Note that this can
* cause a race condition if the second stream is opened before
* the first stream is fully initialized.
*
* We provide some protection by checking to make sure the first
* stream is initialized, but it's not perfect. ALSA sometimes
* re-initializes the driver with a different sample rate or
* size. If the second stream is opened before the first stream
* has received its final parameters, then the second stream may
* be constrained to the wrong sample rate or size.
*
* FIXME: This code does not handle opening and closing streams
* repeatedly. If you open two streams and then close the first
* one, you may not be able to open another stream until you
* close the second one as well.
*/
struct snd_pcm_runtime *first_runtime =
ssi_private->first_stream->runtime;
if (!first_runtime->sample_bits) {
dev_err(substream->pcm->card->dev,
"set sample size in %s stream first\n",
substream->stream == SNDRV_PCM_STREAM_PLAYBACK
? "capture" : "playback");
return -EAGAIN;
}
I don't think I've ever actually tested this code, and it's pretty old, so I
don't even know if the comment is actually valid any more. I think the FIXME is
actually fixed, but I've forgotten the mental exercise that prompted me to
create this code in the first place.
--
Timur Tabi
Linux kernel developer at Freescale
next prev parent reply other threads:[~2011-09-01 18:58 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-08-29 9:15 [RFC v2 PATCH 1/1] ASoC: soc-core: symmetry checking for each DAIs separately Dong Aisheng
2011-08-29 20:34 ` [alsa-devel] " Tabi Timur-B04825
2011-08-30 2:54 ` Dong Aisheng-B29396
2011-08-31 10:52 ` Liam Girdwood
2011-08-31 11:55 ` Tabi Timur-B04825
2011-08-31 12:17 ` Lars-Peter Clausen
2011-09-01 18:58 ` Timur Tabi [this message]
2011-09-01 19:32 ` Lars-Peter Clausen
2011-09-01 20:35 ` Timur Tabi
2011-09-16 3:02 ` Dong Aisheng
2011-09-02 14:44 ` Wolfram Sang
2011-09-21 14:59 ` Mark Brown
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=4E5FD5EB.50009@freescale.com \
--to=timur@freescale.com \
--cc=linux-arm-kernel@lists.infradead.org \
/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).