From: Tony Lindgren <tony@atomide.com>
To: Peter Ujfalusi <peter.ujfalusi@ti.com>
Cc: alsa-devel@alsa-project.org,
"Ivaylo Dimitrov" <ivo.g.dimitrov.75@gmail.com>,
"Aaro Koskinen" <aaro.koskinen@iki.fi>,
"Liam Girdwood" <lgirdwood@gmail.com>,
"Sebastian Reichel" <sre@kernel.org>,
"Mark Brown" <broonie@kernel.org>,
"Jarkko Nikula" <jarkko.nikula@linux.intel.com>,
"Pavel Machel" <pavel@ucw.cz>,
"Pali Rohár" <pali.rohar@gmail.com>,
linux-omap@vger.kernel.org
Subject: Re: [PATCH] ASoC: omap-mcbsp: Add PM QoS support for McBSP to prevent glitches
Date: Wed, 31 Aug 2016 12:41:07 -0700 [thread overview]
Message-ID: <20160831194107.wijnbmdns2jjvzkv@atomide.com> (raw)
In-Reply-To: <eef88aa4-b829-1889-f083-eb0359c0dac6@ti.com>
* Peter Ujfalusi <peter.ujfalusi@ti.com> [160831 11:34]:
> On 08/31/16 19:59, Tony Lindgren wrote:
> > * Tony Lindgren <tony@atomide.com> [160831 07:14]:
> >> * Peter Ujfalusi <peter.ujfalusi@ti.com> [160831 04:38]:
> >>> If we have McBSP w/o FIFO there is no need for the qos AFAIK.
> >>> I'm fine with the 30ms, if you have done the testing on OMAP3.McBSP2, probably
> >>> setting 30ms for McBSP with 1280 FIFO, 3ms for 128 FIFO and no qos for McBSP
> >>> w/o FIFO might be better. Or:
> >>>
> >>> latency = mcbsp->pdata->buffer_size * 23; /* 29.44ms on omap3's mcbsp2 */
> >>>
> >>> if (latency)
> >>> pm_qos_add_request(&mcbsp->pm_qos_req, PM_QOS_CPU_DMA_LATENCY,
> >>> latency);
> >>
> >> OK let me run some tests with that and mcbsp2 fifo set to 128. My guess
> >> is that things already work for that case with no patches with the existing
> >> fifo based snd_pcm_hw_constraint_step() setting limits low enough so
> >> we never enter deeper idle states, but let's see :)
> >
> > Well not quite so :) The fixed limit of 30 ms also works with fifo
> > set to 128, but we still have audio fail without any patches.
>
> does it fail at start time or later?
> At start time we will have ~10 DMA bursts of 128 words to fill the FIFO on McBSP2.
The problems start only later on, about 10 seconds into playing of
course depending on things like console activity etc.
> > @@ -1064,6 +1072,16 @@ int omap_mcbsp_init(struct platform_device *pdev)
> > mcbsp->max_tx_thres = max_thres(mcbsp) - 0x10;
> > mcbsp->max_rx_thres = max_thres(mcbsp) - 0x10;
> >
> > + /*
> > + * Prevent device from hitting deeper idle states between
> > + * DMA fifo loads. On omap3 mcbsp2 we have a larger FIFO of
> > + * 1280 bytes instead of the usual 128 bytes, and the measured
>
> not bytes, but words. The word size does not matter, it can be 8, 16 or
> 32bits, but we have 1280 or 128 of these words.
Oh OK, will fix.
> > + * max latency we can tolerate is somewhere below 40 ms. To be
> > + * safe, use a fixed value of 30 ms to block off idle on omap3
> > + * while still allowing retention idle.
> > + */
> > + mcbsp->latency = 30 * 1000;
>
> were there issue with calculating the latency like
> mcbsp->latency = max_thres(mcbsp) * 23;
Yes, we're not hitting retention idle at all during play with FIFO set
to 128 words.
Regards,
Tony
next prev parent reply other threads:[~2016-08-31 19:41 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-08-29 18:27 [PATCH] ASoC: omap-mcbsp: Add PM QoS support for McBSP to prevent glitches Tony Lindgren
[not found] ` <201608300739.JrTVlIyd%fengguang.wu@intel.com>
2016-08-30 18:38 ` Tony Lindgren
2016-08-31 17:24 ` Mark Brown
2016-08-31 17:42 ` Tony Lindgren
2016-08-31 11:37 ` Peter Ujfalusi
2016-08-31 14:13 ` Tony Lindgren
2016-08-31 16:59 ` Tony Lindgren
2016-08-31 18:33 ` Peter Ujfalusi
2016-08-31 19:41 ` Tony Lindgren [this message]
2016-09-01 6:57 ` Peter Ujfalusi
2016-09-01 14:50 ` Tony Lindgren
2016-09-02 7:30 ` Peter Ujfalusi
2016-09-02 14:56 ` Tony Lindgren
2016-09-02 19:38 ` Peter Ujfalusi
2016-09-02 20:40 ` Tony Lindgren
2016-09-05 7:53 ` Peter Ujfalusi
2016-09-06 20:16 ` Tony Lindgren
2016-09-07 14:31 ` Peter Ujfalusi
2016-09-08 3:53 ` Tony Lindgren
2016-09-08 10:41 ` Peter Ujfalusi
2016-09-08 10:49 ` Peter Ujfalusi
2016-09-08 14:48 ` Tony Lindgren
2016-09-09 6:51 ` Peter Ujfalusi
2016-09-09 23:45 ` Tony Lindgren
2016-09-13 11:45 ` Peter Ujfalusi
2016-09-13 13:45 ` Tony Lindgren
2016-09-02 15:54 ` Pavel Machek
2016-09-02 19:45 ` Peter Ujfalusi
2016-09-02 20:09 ` Tony Lindgren
2016-09-03 16:08 ` Sebastian Reichel
2016-09-06 20:08 ` Tony Lindgren
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=20160831194107.wijnbmdns2jjvzkv@atomide.com \
--to=tony@atomide.com \
--cc=aaro.koskinen@iki.fi \
--cc=alsa-devel@alsa-project.org \
--cc=broonie@kernel.org \
--cc=ivo.g.dimitrov.75@gmail.com \
--cc=jarkko.nikula@linux.intel.com \
--cc=lgirdwood@gmail.com \
--cc=linux-omap@vger.kernel.org \
--cc=pali.rohar@gmail.com \
--cc=pavel@ucw.cz \
--cc=peter.ujfalusi@ti.com \
--cc=sre@kernel.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