All of lore.kernel.org
 help / color / mirror / Atom feed
From: Keyon Jie <yang.jie@linux.intel.com>
To: Takashi Iwai <tiwai@suse.de>, "Yang, Libin" <libin.yang@intel.com>
Cc: "liam.r.girdwood@linux.intel.com"
	<liam.r.girdwood@linux.intel.com>,
	"Lin, Mengdong" <mengdong.lin@intel.com>,
	"alsa-devel@alsa-project.org" <alsa-devel@alsa-project.org>,
	"broonie@kernel.org" <broonie@kernel.org>,
	Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Subject: Re: [RFC PATCH v2 1/2] ASoC: refine ASoC hdmi audio suspend/resume
Date: Mon, 14 Jan 2019 09:16:02 +0800	[thread overview]
Message-ID: <1a7ffff2-4249-f2a0-ba7e-549910ad49b9@linux.intel.com> (raw)
In-Reply-To: <s5hk1jajp89.wl-tiwai@suse.de>



On 2019/1/12 下午3:43, Takashi Iwai wrote:
> On Sat, 12 Jan 2019 02:46:33 +0100,
> Yang, Libin wrote:
>>
>> Hi Takashi,
>>
>>>>>
>>>>> On Fri, 11 Jan 2019 06:20:23 +0100,
>>>>> Yang, Libin wrote:
>>>>>>
>>>>>> The below patch may have a small confliction that the trigger will
>>>>>> be called twice as our SOF has already call snd_pcm_suspend() in
>>>>>> card suspend.
>>>>>
>>>>> It should be no problem, snd_pcm_suspend() can be called multiple
>>>>> times.  If it's already suspended, just nothing happens.
>>>>
>>>> Thinking of this problem again, does a patch like below work instead?
>>>> This looks like a better and more generic solution.
>>>>
>>>> What I'm not quite sure is whether the device suspend order between
>>>> PCM device and HD-audio codec device is guaranteed.  I guess yes,
>>>> because the PCM device is registered always after the codec.  But ASoC
>>>> might have another weirdness :)
>>
>> The suspend order is always a quite hard issue for me. I have to spend
>> a lot time checking the parent-child relationship. And if they don't have
>> such relationship, I don't know how to find the order.
>>
>> My initial idea to get rid of such dependency is: do the pcm suspend before
>> suspend(), for example put it in prepare(). And set device clk off and power
>> off in suspend(). This can make sure pcm is always properly suspended.
>> But, I'm not sure prepare() is a right place because it seems prepare() is not
>> designed to do such things and prepare() may impact the suspend/resume
>> sequence based on its return value. If your below patch works, I think it will
>> be a best solution which can handle such things in ALSA level. I think we
>> may need to do a lot of test because the different cards drivers are
>> extremely different.
> 
> As mentioned below, ASoC is another thing.  Its PM sequence is found
> in snd_soc_suspend().
> 
> 
> Takashi

This is an interesting topic, it worth to do a surgery to remove those 
ASoC snd_pcm_suspend_all() invoking and do unified PCM suspend in ALSA 
PCM level?

Thanks,
~Keyon


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

  reply	other threads:[~2019-01-14  1:14 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-07  2:22 [RFC PATCH v2 1/2] ASoC: refine ASoC hdmi audio suspend/resume libin.yang
2019-01-07  2:22 ` [RFC PATCH v2 2/2] ASoC: add asoc hdmi audio trigger handler libin.yang
2019-01-07 16:58 ` [RFC PATCH v2 1/2] ASoC: refine ASoC hdmi audio suspend/resume Pierre-Louis Bossart
2019-01-08  7:53   ` Yang, Libin
2019-01-08 11:14     ` Takashi Iwai
2019-01-09  8:16       ` Yang, Libin
2019-01-09  8:29         ` Takashi Iwai
2019-01-09  9:13           ` Takashi Iwai
2019-01-10  5:30             ` Yang, Libin
2019-01-10 12:16               ` Takashi Iwai
2019-01-11  5:20                 ` Yang, Libin
2019-01-11 13:34                   ` Takashi Iwai
2019-01-11 14:24                     ` Takashi Iwai
2019-01-11 15:43                       ` Takashi Iwai
2019-01-12  1:46                         ` Yang, Libin
2019-01-12  7:43                           ` Takashi Iwai
2019-01-14  1:16                             ` Keyon Jie [this message]
2019-01-14  6:44                               ` Takashi Iwai
2019-01-11 14:35                     ` Yang, Libin

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=1a7ffff2-4249-f2a0-ba7e-549910ad49b9@linux.intel.com \
    --to=yang.jie@linux.intel.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=liam.r.girdwood@linux.intel.com \
    --cc=libin.yang@intel.com \
    --cc=mengdong.lin@intel.com \
    --cc=pierre-louis.bossart@linux.intel.com \
    --cc=tiwai@suse.de \
    /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.