All of lore.kernel.org
 help / color / mirror / Atom feed
From: Liam Girdwood <lrg@ti.com>
To: Patrick Lai <plai@codeaurora.org>
Cc: alsa-devel <alsa-devel@alsa-project.org>
Subject: Re: Back-end state transition query
Date: Thu, 25 Oct 2012 18:59:16 +0100	[thread overview]
Message-ID: <50897DF4.1020402@ti.com> (raw)
In-Reply-To: <5088ECF2.8010007@codeaurora.org>

Hi Patrick,

On 25/10/12 08:40, Patrick Lai wrote:
> Hi Liam,
> 
> I am facing an issue related to how DPCM manages state of back-end
> substream. Here is description of problem:
> 
> When front-end PCM substream is in paused state, back-end PCM substream
> will be put in paused state as well if given front-end PCM substream is
> the only client of given back-end. Based on current implementation of
> DPCM, when application closes front-end PCM substream, DPCM framework
> will not allow back-end enter HW_FREE state so back-end will never get
> shutdown completely as well.
> 
> refer to function soc_dpcm_be_dai_hw_free(), here is the check for states
> 
>     if ((be->dpcm[stream].state != SND_SOC_DPCM_STATE_HW_PARAMS) &&
>         (be->dpcm[stream].state != SND_SOC_DPCM_STATE_PREPARE) &&
>         (be->dpcm[stream].state != SND_SOC_DPCM_STATE_HW_FREE) &&
>         (be->dpcm[stream].state != SND_SOC_DPCM_STATE_STOP))
>                         continue;
> 
> Can't DPCM also allow back-end hardware being freed in STATE_PAUSED?

This seems like a bug. We should hw_free() the BE here.

> Even if DPCM expects trigger stop coming to update back-end state to STATE_STOP, the following condition check will never allow back-end enter stop state anyway
> 
> Refer to soc_dpcm_be_dai_trigger()
> 
>   case SNDRV_PCM_TRIGGER_STOP:
>      if (be->dpcm[stream].state != SND_SOC_DPCM_STATE_START)
>                                 continue;
> 
> Can you please take a look and recommend the appropriate state transition or it would be okay to allow PAUSED state in soc_dpcm_be_dai_hw_free()?

It should be OK to allow the paused state in hw_free(), but I'm thinking we should probably see the trigger stop when we close the FE (although I'm not 100% certain atm of seeing the STOP as I've not traced this PAUSE -> CLOSE sequence). I assume you have a patch that allows this ?

Thanks

Liam

  reply	other threads:[~2012-10-25 17:59 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-25  7:40 Back-end state transition query Patrick Lai
2012-10-25 17:59 ` Liam Girdwood [this message]
2012-10-29  0:24   ` Patrick Lai

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=50897DF4.1020402@ti.com \
    --to=lrg@ti.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=plai@codeaurora.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 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.