All of lore.kernel.org
 help / color / mirror / Atom feed
From: Arnaud Mouiche <arnaud.mouiche@invoxia.com>
To: Caleb Crome <caleb@crome.org>,
	Roberto Fichera <kernel@tekno-soft.it>,
	Markus Pargmann <mpa@pengutronix.de>,
	Fabio Estevam <fabio.estevam@freescale.com>,
	"shawn.guo@linaro.org" <shawn.guo@linaro.org>,
	alsa-devel@alsa-project.org, broonie@kernel.org,
	lgirdwood@gmail.com
Cc: Arnaud Mouiche <arnaud.mouiche@invoxia.com>
Subject: [PATCH v2 4/6] ASoC: fsl_ssi: Fix samples being dropped as Playback startup
Date: Thu, 26 Nov 2015 16:05:39 +0100	[thread overview]
Message-ID: <1448550341-11765-5-git-send-email-arnaud.mouiche@invoxia.com> (raw)
In-Reply-To: <1448550341-11765-1-git-send-email-arnaud.mouiche@invoxia.com>

If the capture is already running while playback is started, it is highly
probable (>80% in a 8 channels scenario) that samples are lost between
the DMA and TX fifo.

The reason is that SIER.TDMAE is set before STCR.TFEN0, leaving a time
window where the FIFO doesn't receive the samples written by the DMA.

This particular case happened only if capture is already enabled as
SCR.SSIEN is already set at the playback startup instant.

Signed-off-by: Arnaud Mouiche <arnaud.mouiche@invoxia.com>
---
 sound/soc/fsl/fsl_ssi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/soc/fsl/fsl_ssi.c b/sound/soc/fsl/fsl_ssi.c
index 243c9af..78ea6e1 100644
--- a/sound/soc/fsl/fsl_ssi.c
+++ b/sound/soc/fsl/fsl_ssi.c
@@ -404,9 +404,9 @@ static void fsl_ssi_config(struct fsl_ssi_private *ssi_private, bool enable,
 	 * (online configuration)
 	 */
 	if (enable) {
-		regmap_update_bits(regs, CCSR_SSI_SIER, vals->sier, vals->sier);
 		regmap_update_bits(regs, CCSR_SSI_SRCR, vals->srcr, vals->srcr);
 		regmap_update_bits(regs, CCSR_SSI_STCR, vals->stcr, vals->stcr);
+		regmap_update_bits(regs, CCSR_SSI_SIER, vals->sier, vals->sier);
 	} else {
 		u32 sier;
 		u32 srcr;
-- 
1.9.1

  parent reply	other threads:[~2015-11-26 15:06 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-26 15:05 [PATCH v2 0/6] ASoC: fsl_ssi: Fixing various channel slips and bad samples insertions Arnaud Mouiche
2015-11-26 15:05 ` [PATCH v2 1/6] ASoC: fsl_ssi: Real hardware channels max number is 32 Arnaud Mouiche
2015-12-07 12:44   ` Fabio Estevam
2016-05-13 12:26   ` Applied "ASoC: fsl_ssi: Real hardware channels max number is 32" to the asoc tree Mark Brown
2015-11-26 15:05 ` [PATCH v2 2/6] ASoC: fsl_ssi: The IPG/5 limitation concerns the bitclk, not the sysclk Arnaud Mouiche
2015-11-26 15:05 ` [PATCH v2 3/6] ASoC: fsl_ssi: Save a dev reference for dev_err() purpose Arnaud Mouiche
2015-11-26 15:05 ` Arnaud Mouiche [this message]
2015-11-26 15:05 ` [PATCH v2 5/6] ASoC: fsl_ssi: Fix channel slipping in Playback at startup Arnaud Mouiche
2016-05-13 12:25   ` Applied "ASoC: fsl_ssi: Fix channel slipping in Playback at startup" to the asoc tree Mark Brown
2015-11-26 15:05 ` [PATCH v2 6/6] ASoC: fsl_ssi: Fix channel slipping on capture (or playback) restart in full duplex Arnaud Mouiche
2015-12-07 12:41 ` [PATCH v2 0/6] ASoC: fsl_ssi: Fixing various channel slips and bad samples insertions arnaud.mouiche
2015-12-07 16:46   ` Caleb Crome

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=1448550341-11765-5-git-send-email-arnaud.mouiche@invoxia.com \
    --to=arnaud.mouiche@invoxia.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=caleb@crome.org \
    --cc=fabio.estevam@freescale.com \
    --cc=kernel@tekno-soft.it \
    --cc=lgirdwood@gmail.com \
    --cc=mpa@pengutronix.de \
    --cc=shawn.guo@linaro.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.