All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Ujfalusi <peter.ujfalusi@ti.com>
To: Jarkko Nikula <jarkko.nikula@bitmer.com>
Cc: alsa-devel <alsa-devel@alsa-project.org>,
	Grazvydas Ignotas <notasas@gmail.com>
Subject: Re: system suspend and live audio streams
Date: Mon, 16 Apr 2012 13:40:41 +0300	[thread overview]
Message-ID: <4F8BF729.20906@ti.com> (raw)
In-Reply-To: <4F8B1EF3.9040802@bitmer.com>

Hi,

On 04/15/2012 10:18 PM, Jarkko Nikula wrote:
> On 04/14/2012 06:40 PM, Grazvydas Ignotas wrote:
>> Hi,
>>
>> Currently on OMAP the system fails to suspend properly if there are
>> audio streams active (PER and CORE don't enter low power states). I
>> wonder if this is expected to be handled by the driver and can be
>> considered a bug, or is it audio daemon's/system's responsibility to
>> stop all audio streams before kernel to is asked to start suspending?

Did the suspend/resume worked in the past during audio activity?

>>
> Hmm.. this is actually something which is not implemented.
> 
> Before arch/arm/plat-omap/mcbsp: omap_mcbsp_request used to enable
> clocks and keep them active until omap_mcbsp_free. I.e.
> omap_mcbsp_stop/_start which are called during suspend-resume cycle
> don't change the clock state.
> 
> I don't actually remember why it used to be so. Might be related to SPI
> mode use on OMAP1?

We need to have the clocks enabled in order to change McBSP registers.
We do register writes in several places after startup (prepare,
hw_params, clock configuration).

> But as now the SPI support is dropped (no users and not supported in
> later omaps) and mcbsp is merged with omap-mcbsp (no other users than
> audio) I don't see why the clocks (or runtime pm) should be active
> before omap_mcbsp_start.

Because we need to write registers (configure McPBSP).

> I don't know immediately does this require any major changes for McBSP
> register access that are done in function calls before omap_mcbsp_start
> (IRCC hwmod might set already ICLK gating for register access) but some
> code is needed to deal with McBSP register cache restore (due OMAP
> OFFMODE that might be hit) and most probably for McBSP FIFO draining as
> well.

What we need to do is to have proper register store/restore for McBSP to
support suspend during audio activity. But. Even with that if the McBSP
is hitting OFF mode we will loose the McBSP FIFO content (invalidated).
This means we are going to have missing samples. Probably the user will
not going to notice it, but it is going to happen.
I'm sure this issue present on other platforms as well. The pm_runtime
is handled by the core, we should have suspend/resume checked in ASoC
core, if there's an issue we need to fix it. After that the McBSP
store/restore need to be implemented.

-- 
Péter
_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

  reply	other threads:[~2012-04-16 10:40 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-14 15:40 system suspend and live audio streams Grazvydas Ignotas
2012-04-15 19:18 ` Jarkko Nikula
2012-04-16 10:40   ` Peter Ujfalusi [this message]
2012-04-16 12:24     ` Mark Brown
2012-04-16 16:10     ` Jarkko Nikula
2012-04-17 10:21     ` Grazvydas Ignotas

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=4F8BF729.20906@ti.com \
    --to=peter.ujfalusi@ti.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=jarkko.nikula@bitmer.com \
    --cc=notasas@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 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.