Linux on ARM based TI OMAP SoCs
 help / color / mirror / Atom feed
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>,
	"Kristo, Tero" <t-kristo@ti.com>,
	"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: Thu, 8 Sep 2016 07:48:34 -0700	[thread overview]
Message-ID: <20160908144834.i722j3afyztk6vhh@atomide.com> (raw)
In-Reply-To: <9452a3c6-9bf9-818f-6e8d-455193839e94@ti.com>

* Peter Ujfalusi <peter.ujfalusi@ti.com> [160908 03:49]:
> > 
> > I managed to get time for this and it looks like that we only need to block
> > core OFF for audio. I don't know why C6 ("MPU OFF + CORE RET") with it's 3000
> > + 8500 exit latency not causing issues when we have less time from the DMA
> > request to empty FIFO...

Right, the wakeup event should be the fifo threshold and the dma trigger
line.. But there must some other thing we're not accounting for.

> > My findings so far:
> > w/o the QoS patch we will hit core OFF even if we are in element mode in McBSP:
> > # cat /sys/devices/platform/68000000.ocp/49022000.mcbsp/dma_op_mode
> > [element] threshold
> > 
> > If I start the playback we will hit core OFF even if the we have DMA request
> > coming at every sample (every 0.02ms).

I think that's because we still have windows without pm qos where dma
is not active and we hit idle and there's nothing in hardware blocking
off mode.

> > We hit C6, but when the DMA request comes we have 16 words in the FIFO (8
> > samples, 0.16ms of audio). C6 should take 11.5ms to exit...

So maybe we have the C6 latency for 36xx wrong, and it's much faster than
for 34xx? I wonder what happens on the original beagleboard, not the
xm variant.. I don't have one though.

> > Based on my experiments the FIFO threshold does not matter as even if we
> > should not be able to leave from a C state in time, we do leave from the state :o

Yes that's a mystery :)

> > The patch generates the following warning when the playback is stopped:
...
> > [  115.996002] [<c0155b74>] (__cancel_work_timer) from [<c0199ad8>]
> > (pm_qos_remove_request+0x28/0x1c8)
> > [  116.005523] [<c0199ad8>] (pm_qos_remove_request) from [<c0684634>]
> > (omap_mcbsp_dai_trigger+0x70/0x8c)
> > [  116.015197] [<c0684634>] (omap_mcbsp_dai_trigger) from [<c067baa8>]
> > (soc_pcm_trigger+0xd0/0x11c)
> > [  116.024414] [<c067baa8>] (soc_pcm_trigger) from [<c0663be0>]
> > (snd_pcm_do_stop+0x50/0x54)
> > [  116.032928] [<c0663be0>] (snd_pcm_do_stop) from [<c06639c4>]
> > (snd_pcm_action_single+0x38/0x80)

Hmm OK I wonder why have not seen that one, I've been just hitting ctrl-c
to stop the playback.

> > There is one more issue: if we have playback and capture running at the same
> > time and you stop one of them. It will remove the QoS and the remaining stream
> > might break.
> 
> it is better to place the QoS in omap_mcbsp_request() and remove it in
> omap_mcbsp_free(). This way we retain the QoS for the time the McBSP is in
> active use.

OK makes sense.

Regards,

Tony

  reply	other threads:[~2016-09-08 14:48 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
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 [this message]
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=20160908144834.i722j3afyztk6vhh@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 \
    --cc=t-kristo@ti.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