From: srv_kaichieh.chaung <srv_kaichieh.chuang@mediatek.com>
To: alsa-devel@alsa-project.org
Cc: kaichieh.chuang@mediatek.com
Subject: DPCM: skip DAPM_STREAM_STOP event to BE, if still used by other FE
Date: Tue, 24 May 2016 13:06:30 +0800 [thread overview]
Message-ID: <1464066390.30335.1.camel@mtkswgap22> (raw)
Hi,
Let me illustrate the system first.
FE1 -----+----> BE
|
FE2 -----+
When there is multi-FE stream to a single BE, the BE will receive
SND_SOC_DAPM_STREAM_STOP if one of the FE shutdown.
However, the BE is stilled used by another, this will let BE cpu_dai and
codec_dai think they are inactive. The later power check will go wrong.
I have check the latest linux version, and didn't find any related
change.
The following is my change to address this, and will re-send a formal
patch if it's ok.
diff --git a/sound/soc/soc-pcm.c b/sound/soc/soc-pcm.c
index 70e8088..9c2d159 100644
--- a/sound/soc/soc-pcm.c
+++ b/sound/soc/soc-pcm.c
@@ -163,6 +163,13 @@ int dpcm_dapm_stream_event(struct
snd_soc_pcm_runtime *fe, int dir,
dev_dbg(be->dev, "ASoC: BE %s event %d dir %d\n",
be->dai_link->name, event, dir);
+ /* don't sent stop event if this BE is used by other FE */
+ if (event == SND_SOC_DAPM_STREAM_STOP &&
+ be->dpcm[dir].users >= 1) {
+ pr_warn("kc, %s(), be->dai_link->name %s skip stop event\n",
__func__, be->dai_link->name);
+ continue;
+ }
+
snd_soc_dapm_stream_event(be, dir, event);
}
Sincerely,
Kai Chieh
next reply other threads:[~2016-05-24 5:06 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-05-24 5:06 srv_kaichieh.chaung [this message]
-- strict thread matches above, loose matches on Subject: below --
2016-05-24 5:13 DPCM: skip DAPM_STREAM_STOP event to BE, if still used by other FE Chuang Eric
2016-05-31 5:45 Kai Chieh Chuang
2016-06-03 0:18 ` Mark Brown
2016-06-05 6:58 Kai Chieh Chuang
[not found] ` <1466749294.16718.1.camel@mtkswgap22>
2016-06-29 19:04 ` Mark Brown
2016-06-29 19:08 ` Mark Brown
[not found] ` <1467599214.21156.2.camel@mtkswgap22>
2016-07-04 9:11 ` Mark Brown
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=1464066390.30335.1.camel@mtkswgap22 \
--to=srv_kaichieh.chuang@mediatek.com \
--cc=alsa-devel@alsa-project.org \
--cc=kaichieh.chuang@mediatek.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).