alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
From: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
To: Curtis Malainey <cujomalainey@google.com>
Cc: Curtis Malainey <cujomalainey@chromium.org>,
	ALSA development <alsa-devel@alsa-project.org>
Subject: Re: [alsa-devel] [RFC 00/15] Add Samus Hotwording for RT5677
Date: Fri, 6 Sep 2019 17:13:00 -0500	[thread overview]
Message-ID: <b1de1190-d809-9cb3-3560-97595df895d3@linux.intel.com> (raw)
In-Reply-To: <CAOReqxgJQaW=XAsD4o9hq_iU1faJBK3d9Rg8FCp_4Mrx3UX-oQ@mail.gmail.com>

On 9/6/19 4:09 PM, Curtis Malainey wrote:
> 
> 
> Curtis Malainey | Software Engineer | cujomalainey@google.com 
> <mailto:cujomalainey@google.com> | 650-898-3849
> 
> 
> On Fri, Sep 6, 2019 at 1:41 PM Pierre-Louis Bossart 
> <pierre-louis.bossart@linux.intel.com 
> <mailto:pierre-louis.bossart@linux.intel.com>> wrote:
>  >
>  > On 9/6/19 2:46 PM, Curtis Malainey wrote:
>  > > This patch series adds the hotwording implementation used in the
>  > > Pixelbook on the RT5677 driver.
>  > >
>  > > Known Issues:
>  > > There is a known issue where the system will fail to detect a 
> hotword if
>  > > suspended while the stream is open. This is due to the fact that the
>  > > haswell-dsp suspends its I2S MCLK before the RT5677 suspends which
>  > > causes the writes and reads to become corrupted as a result. Any
>  > > recommendations to correct this behaviour would be appreciated.
>  >
>  > I don't get what 'suspend' and 'stream' refer to. is this pm_runtime,
>  > s2idle, system capture, SPI capture?
>  >
>  > Can you elaborate on the sequence?
> Definitely can,
> 
>  1. open hotwording pcm with arecord in non-blocking mode
>       * Codec won't send any data over SPI until the hotword is detected
>  2. put system into S3 (see order of callbacks as follows)

Before we start digging into dependencies below, is it really possible 
to enter S3 with the hotwording open? I vaguely remember being told that 
such cases would be trapped by the Chrome userspace and the PCM would be 
closed. I don't think anyone on the SOF team testing this case for newer 
platform, so that case on an old platform makes me nervous.

>      1. HSW DSP suspended which suspends stops I2S MCLK
>      2. RT5677 suspended, all pm writes are lost due to the fact that
>         the codec is still in DSP mode but has no clock

there's no real dependency or parent-child relationship between the two 
drivers, is there? so I am wondering if this order is intentional or 
just accidental.
The only thing I can think of is that there are multiple steps during 
the system suspend and maybe we can play with .suspend_late instead of 
.suspend?

>  3. System resumes and fails to restore the RT5677 due to the fact that
>     the regmap is now out of sync
> 
> The rt5677 needs to suspend before the haswell dsp but I am not sure how 
> to schedule that appropriately. The reason this worked in Samus is 
> because it launched with a 3.14 kernel which did not 
> have 0d2135ecadb0b2eec5338a7587ba29724ddf612b ("ASoC: Intel: Work around 
> to fix HW D3 potential crash issue") which powers down the MCLK when the 
> haswell DSP is not in use.
> 
> Hope that clears things up.

_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
https://mailman.alsa-project.org/mailman/listinfo/alsa-devel

  reply	other threads:[~2019-09-06 22:14 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-06 19:46 [alsa-devel] [RFC 00/15] Add Samus Hotwording for RT5677 Curtis Malainey
2019-09-06 19:46 ` [alsa-devel] [RFC 01/15] ASoC: rt5677: Remove magic number register writes Curtis Malainey
2019-09-09 10:07   ` [alsa-devel] Applied "ASoC: rt5677: Remove magic number register writes" to the asoc tree Mark Brown
2019-09-06 19:46 ` [alsa-devel] [RFC 02/15] ASoC: rt5677: keep analog power register at SND_SOC_BIAS_OFF Curtis Malainey
2019-09-09  9:54   ` Mark Brown
2019-09-09 15:50     ` Curtis Malainey
2019-09-09 12:23   ` [alsa-devel] Applied "ASoC: rt5677: keep analog power register at SND_SOC_BIAS_OFF" to the asoc tree Mark Brown
2019-09-06 19:46 ` [alsa-devel] [RFC 03/15] ASoC: rt5677: Add a PCM device for streaming hotword via SPI Curtis Malainey
2019-09-06 19:46 ` [alsa-devel] [RFC 04/15] ASoC: rt5677: Load firmware " Curtis Malainey
2019-09-11 10:24   ` Mark Brown
2019-09-06 19:46 ` [alsa-devel] [RFC 05/15] ASoC: rt5677: Auto enable/disable DSP for hotwording Curtis Malainey
2019-09-11 10:25   ` Mark Brown
2019-09-11 20:22     ` Curtis Malainey
2019-09-12  9:26       ` Mark Brown
2019-09-16 21:29         ` Curtis Malainey
2019-09-16 21:55           ` Mark Brown
2019-09-06 19:46 ` [alsa-devel] [RFC 06/15] ASoC: bdw-rt5677: Add a DAI link for rt5677 SPI PCM device Curtis Malainey
2019-09-09  0:18   ` Kuninori Morimoto
2019-09-09 16:53     ` Curtis Malainey
2019-09-06 19:46 ` [alsa-devel] [RFC 07/15] ASoC: rt5677: Enable jack detect while DSP is running Curtis Malainey
2019-09-06 19:46 ` [alsa-devel] [RFC 08/15] ASoC: rt5677: Use delayed work for DSP firmware load Curtis Malainey
2019-09-11 10:28   ` Mark Brown
2019-09-06 19:46 ` [alsa-devel] [RFC 09/15] ASoC: rt5677: Add DAPM audio path for hotword stream Curtis Malainey
2019-09-06 19:46 ` [alsa-devel] [RFC 10/15] ASoC: rt5677: Mark reg RT5677_PWR_ANLG2 as volatile Curtis Malainey
2019-09-06 19:46 ` [alsa-devel] [RFC 11/15] ASoC: rt5677: Stop and restart DSP over suspend/resume Curtis Malainey
2019-09-06 19:46 ` [alsa-devel] [RFC 12/15] ASoC: rt5677: Transfer one period at a time over SPI Curtis Malainey
2019-09-11 10:54   ` Mark Brown
2019-09-11 18:09     ` Curtis Malainey
2019-09-06 19:46 ` [alsa-devel] [RFC 13/15] ASoC: rt5677: Disable irq at suspend Curtis Malainey
2019-09-06 19:46 ` [alsa-devel] [RFC 14/15] ASoC: rt5677: Allow VAD to be shut on/off at all times Curtis Malainey
2019-09-06 19:46 ` [alsa-devel] [RFC 15/15] ASoC: rt5677: Turn on MCLK1 for DSP via DAPM Curtis Malainey
2019-09-06 20:40 ` [alsa-devel] [RFC 00/15] Add Samus Hotwording for RT5677 Pierre-Louis Bossart
2019-09-06 21:09   ` Curtis Malainey
2019-09-06 22:13     ` Pierre-Louis Bossart [this message]
2019-09-09 16:52       ` Curtis Malainey

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=b1de1190-d809-9cb3-3560-97595df895d3@linux.intel.com \
    --to=pierre-louis.bossart@linux.intel.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=cujomalainey@chromium.org \
    --cc=cujomalainey@google.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;
as well as URLs for NNTP newsgroup(s).