* [PATCH] ASoC: soc-pcm: skip dpcm path checking with incapable/unready FE
@ 2014-11-17 8:02 Qiao Zhou
2014-11-21 19:32 ` Mark Brown
0 siblings, 1 reply; 3+ messages in thread
From: Qiao Zhou @ 2014-11-17 8:02 UTC (permalink / raw)
To: lgirdwood, broonie, tiwai, perex, alsa-devel; +Cc: Qiao Zhou
Skip dpcm path checking for playback or capture, if corresponding FE
doesn't support playback or capture, or currently is not ready. It
can reduce the unnecessary cost to search connected widgets.
Signed-off-by: Qiao Zhou <zhouqiao@marvell.com>
---
sound/soc/soc-pcm.c | 16 ++++++++++++++--
1 file changed, 14 insertions(+), 2 deletions(-)
diff --git a/sound/soc/soc-pcm.c b/sound/soc/soc-pcm.c
index 002311a..3b068d4 100644
--- a/sound/soc/soc-pcm.c
+++ b/sound/soc/soc-pcm.c
@@ -2248,7 +2248,13 @@ int soc_dpcm_runtime_update(struct snd_soc_card *card)
fe->dai_link->name);
/* skip if FE doesn't have playback capability */
- if (!fe->cpu_dai->driver->playback.channels_min)
+ if (!fe->cpu_dai->driver->playback.channels_min
+ || !fe->codec_dai->driver->playback.channels_min)
+ goto capture;
+
+ /* skip if FE doesn't do playback */
+ if (!fe->cpu_dai->playback_active
+ || !fe->codec_dai->playback_active)
goto capture;
paths = dpcm_path_get(fe, SNDRV_PCM_STREAM_PLAYBACK, &list);
@@ -2278,7 +2284,13 @@ int soc_dpcm_runtime_update(struct snd_soc_card *card)
dpcm_path_put(&list);
capture:
/* skip if FE doesn't have capture capability */
- if (!fe->cpu_dai->driver->capture.channels_min)
+ if (!fe->cpu_dai->driver->capture.channels_min
+ || !fe->codec_dai->driver->capture.channels_min)
+ continue;
+
+ /* skip if FE doesn't do capture */
+ if (!fe->cpu_dai->capture_active
+ || !fe->codec_dai->capture_active)
continue;
paths = dpcm_path_get(fe, SNDRV_PCM_STREAM_CAPTURE, &list);
--
1.7.9.5
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] ASoC: soc-pcm: skip dpcm path checking with incapable/unready FE
2014-11-17 8:02 [PATCH] ASoC: soc-pcm: skip dpcm path checking with incapable/unready FE Qiao Zhou
@ 2014-11-21 19:32 ` Mark Brown
2014-11-24 1:44 ` Qiao Zhou
0 siblings, 1 reply; 3+ messages in thread
From: Mark Brown @ 2014-11-21 19:32 UTC (permalink / raw)
To: Qiao Zhou; +Cc: tiwai, alsa-devel, lgirdwood
[-- Attachment #1.1: Type: text/plain, Size: 570 bytes --]
On Mon, Nov 17, 2014 at 04:02:57PM +0800, Qiao Zhou wrote:
> Skip dpcm path checking for playback or capture, if corresponding FE
> doesn't support playback or capture, or currently is not ready. It
> can reduce the unnecessary cost to search connected widgets.
Applied, but I did change...
> + /* skip if FE doesn't do playback */
> + if (!fe->cpu_dai->playback_active
> + || !fe->codec_dai->playback_active)
...this and the corresponding capture comment to say "isn't currently
playing" - it's not if the front end can play, it's if it is playing
right now.
[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 473 bytes --]
[-- Attachment #2: Type: text/plain, Size: 0 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] ASoC: soc-pcm: skip dpcm path checking with incapable/unready FE
2014-11-21 19:32 ` Mark Brown
@ 2014-11-24 1:44 ` Qiao Zhou
0 siblings, 0 replies; 3+ messages in thread
From: Qiao Zhou @ 2014-11-24 1:44 UTC (permalink / raw)
To: Mark Brown
Cc: tiwai@suse.de, alsa-devel@alsa-project.org, lgirdwood@gmail.com
On 11/22/2014 03:32 AM, Mark Brown wrote:
> On Mon, Nov 17, 2014 at 04:02:57PM +0800, Qiao Zhou wrote:
>> Skip dpcm path checking for playback or capture, if corresponding FE
>> doesn't support playback or capture, or currently is not ready. It
>> can reduce the unnecessary cost to search connected widgets.
>
> Applied, but I did change...
>
>> + /* skip if FE doesn't do playback */
>> + if (!fe->cpu_dai->playback_active
>> + || !fe->codec_dai->playback_active)
>
> ...this and the corresponding capture comment to say "isn't currently
> playing" - it's not if the front end can play, it's if it is playing
> right now.
>
Mark,
Thanks for the correction.
--
Best Regards
Qiao
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2014-11-24 1:44 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-11-17 8:02 [PATCH] ASoC: soc-pcm: skip dpcm path checking with incapable/unready FE Qiao Zhou
2014-11-21 19:32 ` Mark Brown
2014-11-24 1:44 ` Qiao Zhou
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.