From: Nicolin Chen <nicoleotsuka@gmail.com>
To: Daniel Baluta <daniel.baluta@nxp.com>
Cc: "broonie@kernel.org" <broonie@kernel.org>,
"festevam@gmail.com" <festevam@gmail.com>,
"timur@kernel.org" <timur@kernel.org>,
"tiwai@suse.com" <tiwai@suse.com>,
"alsa-devel@alsa-project.org" <alsa-devel@alsa-project.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
dl-linux-imx <linux-imx@nxp.com>,
"S.j. Wang" <shengjiu.wang@nxp.com>
Subject: Re: [PATCH v2] ASoC: fsl: sai: Fix underrrun for playback stream start
Date: Fri, 8 Mar 2019 12:58:06 -0800 [thread overview]
Message-ID: <20190308205805.GA8912@Asurada-Nvidia.nvidia.com> (raw)
In-Reply-To: <20190308173904.27298-1-daniel.baluta@nxp.com>
On Fri, Mar 08, 2019 at 05:39:30PM +0000, Daniel Baluta wrote:
> @@ -542,6 +544,11 @@ static int fsl_sai_trigger(struct snd_pcm_substream *substream, int cmd,
> case SNDRV_PCM_TRIGGER_START:
> case SNDRV_PCM_TRIGGER_RESUME:
> case SNDRV_PCM_TRIGGER_PAUSE_RELEASE:
> + for (i = 0; tx && i < channels; i++)
> + regmap_write(sai->regmap, FSL_SAI_TDR, 0x0);
Though it could reduce underrrun for sure, I don't feel it's a
thorough fix, especially when dealing with a duplex case where
RX is the first stream while the driver enables both TE and RE
at the same time. So the transmitter might have started before
TX DMA request gets enabled.
We actually have something similar in the ESAI driver as that
one is well documented. But SAI is apparently more tricky at
the trigger() function. And the paragraph you pasted from the
RM doesn't explicitly sound like we should do this.
Btw, Instead of writing dummy data, have you tried polling the
WFP pointer of the TFR0 register to make sure data is copied
by the DMA?
> + if (tx)
> + udelay(10);
Any justification for the delay? Missing a line of comments? I
guess it's to address the 3-bit clocks timing. However, putting
it before enabling DMA request doesn't make much sense to me.
> +
> regmap_update_bits(sai->regmap, FSL_SAI_xCSR(tx),
> FSL_SAI_CSR_FRDE, FSL_SAI_CSR_FRDE);
>
> --
> 2.17.1
>
next prev parent reply other threads:[~2019-03-08 20:58 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-03-08 17:39 [PATCH v2] ASoC: fsl: sai: Fix underrrun for playback stream start Daniel Baluta
2019-03-08 20:58 ` Nicolin Chen [this message]
2019-03-11 7:23 ` Daniel Baluta
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=20190308205805.GA8912@Asurada-Nvidia.nvidia.com \
--to=nicoleotsuka@gmail.com \
--cc=alsa-devel@alsa-project.org \
--cc=broonie@kernel.org \
--cc=daniel.baluta@nxp.com \
--cc=festevam@gmail.com \
--cc=linux-imx@nxp.com \
--cc=linux-kernel@vger.kernel.org \
--cc=shengjiu.wang@nxp.com \
--cc=timur@kernel.org \
--cc=tiwai@suse.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