All of lore.kernel.org
 help / color / mirror / Atom feed
From: Patrick Lai <plai@codeaurora.org>
To: Liam Girdwood <lrg@ti.com>
Cc: alsa-devel <alsa-devel@alsa-project.org>
Subject: Back-end state transition query
Date: Thu, 25 Oct 2012 00:40:34 -0700	[thread overview]
Message-ID: <5088ECF2.8010007@codeaurora.org> (raw)

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?
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()?

Thanks
Patrick

-- 
Sent by an employee of the Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.

             reply	other threads:[~2012-10-25  7:40 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-25  7:40 Patrick Lai [this message]
2012-10-25 17:59 ` Back-end state transition query Liam Girdwood
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=5088ECF2.8010007@codeaurora.org \
    --to=plai@codeaurora.org \
    --cc=alsa-devel@alsa-project.org \
    --cc=lrg@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 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.