From: Peter Ujfalusi <peter.ujfalusi@ti.com>
To: Mark Brown <broonie@kernel.org>, Liam Girdwood <lgirdwood@gmail.com>
Cc: alsa-devel@alsa-project.org, lars@metafoo.de, nsekhar@ti.com,
Jyri Sarha <jsarha@ti.com>,
zonque@gmail.com
Subject: [PATCH v2 3/4] ASoC: davinci-mcasp: Constraint on the period and buffer size based on FIFO usage
Date: Fri, 14 Mar 2014 16:42:47 +0200 [thread overview]
Message-ID: <1394808168-32608-4-git-send-email-peter.ujfalusi@ti.com> (raw)
In-Reply-To: <1394808168-32608-1-git-send-email-peter.ujfalusi@ti.com>
We need to place constraint on the period and buffer size if the read
or write AFIFO is enabled and it is configured for more than one word
otherwise the DMA will fail in buffer configuration where the sizes
are not aligned with the requested FIFO configuration.
Some application (like mplayer) needs the constraint placed on the
buffer size as well. If only period size is constrained they might
fail to figure out the allowed buffer configuration.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
---
sound/soc/davinci/davinci-mcasp.c | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/sound/soc/davinci/davinci-mcasp.c b/sound/soc/davinci/davinci-mcasp.c
index a01ae97c90aa..3ca6e8c4568a 100644
--- a/sound/soc/davinci/davinci-mcasp.c
+++ b/sound/soc/davinci/davinci-mcasp.c
@@ -720,6 +720,7 @@ static int davinci_mcasp_startup(struct snd_pcm_substream *substream,
struct snd_soc_dai *dai)
{
struct davinci_mcasp *mcasp = snd_soc_dai_get_drvdata(dai);
+ int afifo_numevt;
if (mcasp->version == MCASP_VERSION_4)
snd_soc_dai_set_dma_data(dai, substream,
@@ -727,6 +728,21 @@ static int davinci_mcasp_startup(struct snd_pcm_substream *substream,
else
snd_soc_dai_set_dma_data(dai, substream, mcasp->dma_params);
+ if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
+ afifo_numevt = mcasp->txnumevt;
+ else
+ afifo_numevt = mcasp->rxnumevt;
+
+ if (afifo_numevt > 1) {
+ snd_pcm_hw_constraint_step(substream->runtime, 0,
+ SNDRV_PCM_HW_PARAM_PERIOD_SIZE,
+ afifo_numevt);
+
+ snd_pcm_hw_constraint_step(substream->runtime, 0,
+ SNDRV_PCM_HW_PARAM_BUFFER_SIZE,
+ afifo_numevt);
+ }
+
return 0;
}
--
1.9.0
next prev parent reply other threads:[~2014-03-14 14:43 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-14 14:42 [PATCH v2 0/4] ASoC: davinci: edma dmaengine PCM and mcasp preparation Peter Ujfalusi
2014-03-14 14:42 ` [PATCH v2 1/4] ASoC: davinci: Add edma dmaengine platform driver Peter Ujfalusi
2014-03-16 10:54 ` Lars-Peter Clausen
2014-03-17 16:20 ` Mark Brown
2014-03-14 14:42 ` [PATCH v2 2/4] ASoC: davinci-mcasp: Provide correct filter_data for dmaengine for non-DT boot Peter Ujfalusi
2014-03-17 16:21 ` Mark Brown
2014-03-14 14:42 ` Peter Ujfalusi [this message]
2014-03-16 11:18 ` [PATCH v2 3/4] ASoC: davinci-mcasp: Constraint on the period and buffer size based on FIFO usage Lars-Peter Clausen
2014-03-17 13:28 ` Peter Ujfalusi
2014-03-17 16:52 ` Mark Brown
2014-03-18 12:35 ` Peter Ujfalusi
2014-03-18 12:42 ` Mark Brown
2014-03-14 14:42 ` [PATCH v2 4/4] ASoC: davinci-mcasp: Assign the dma_data earlier in dai_probe callback Peter Ujfalusi
2014-03-17 16:44 ` 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=1394808168-32608-4-git-send-email-peter.ujfalusi@ti.com \
--to=peter.ujfalusi@ti.com \
--cc=alsa-devel@alsa-project.org \
--cc=broonie@kernel.org \
--cc=jsarha@ti.com \
--cc=lars@metafoo.de \
--cc=lgirdwood@gmail.com \
--cc=nsekhar@ti.com \
--cc=zonque@gmail.com \
/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