From: Lars-Peter Clausen <lars@metafoo.de>
To: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: Liam Girdwood <lrg@slimlogic.co.uk>,
alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/5] ASoC: Call snd_soc_new_widgets() after registering cards DAPM widgets
Date: Wed, 13 Apr 2011 21:26:54 +0200 [thread overview]
Message-ID: <4DA5F8FE.6000105@metafoo.de> (raw)
In-Reply-To: <20110413173249.GC18008@opensource.wolfsonmicro.com>
On 04/13/2011 07:32 PM, Mark Brown wrote:
> On Wed, Apr 13, 2011 at 02:32:35PM +0200, Lars-Peter Clausen wrote:
>
>> But snd_soc_dapm_new_widgets also calls dapm_power_widgets which operates on
>> the passed dapm_context, will it be without any effect on the DAPM context,
>> when it is called on a newly allocated context?
>
> Yup.
Ok. I'll add a snd_soc_dapm_init_widgets(struct snd_soc_card *card) which will
basically do what snd_soc_dapm_new_widgets does except for calling
dapm_power_widgets.
>
>> Otherwise I would say call snd_soc_dapm_new_widgets once for the cards
>> dapm_context and snd_soc_dapm_sync for each codec context.
>
> There's no point in repeatedly syncing - it may cause audible issues if
> we power things off due to incomplete information. If the sync isn't
> propagating over the entire system we should fix that.
The dapm context is really only used to see if it is widget-less context. In
which case the event type is used to see whether it should be powered or not.
But I wonder if that shouldn't really be done for all widget less contexts.
Since widget-less contexts dev_power is not set to 0 at the beginning of
dapm_power_widgets and all dapm contexts are forced into the same power state,
effectively that cause a system with a widget-less context to be stuck in a
powered state.
Since right now the cards dapm context is almost always widget-less this would
affect almost all systems.
This is what happens on such a system:
Playback starts, codec is powered up, card dapm context is forced to on,
playback stops, codec is powered down but card context is still on and will
force the codec on again.
And it is also used for passing the update struct around. But is there any
reason as to why to pass as a member of the dapm context instead of as a simple
parameter for dapm_power_widgets()? If not I would like to change it to the latter.
- Lars
next prev parent reply other threads:[~2011-04-13 19:26 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-04-12 17:31 [PATCH 1/5] ASoC: Make struct snd_soc_card's dapm_widgets and dapm_routes const Lars-Peter Clausen
2011-04-12 17:31 ` [PATCH 2/5] ASoC: Call snd_soc_new_widgets() after registering cards DAPM widgets Lars-Peter Clausen
2011-04-13 0:38 ` Mark Brown
2011-04-13 12:32 ` Lars-Peter Clausen
2011-04-13 17:32 ` Mark Brown
2011-04-13 19:26 ` Lars-Peter Clausen [this message]
2011-04-12 17:31 ` [PATCH 3/5] ASoC: JZ4740: Convert qi_lb60 codec to table based DAPM setup Lars-Peter Clausen
2011-04-12 17:31 ` [PATCH 4/5] ASoC: JZ4740: qi_lb60: Use gpio_request_array to request and setup gpios Lars-Peter Clausen
2011-04-12 17:31 ` [PATCH 5/5] ASoC: JZ4740: qi_lb60: Use the SND_SOC_DAPM_EVENT_OFF for the speakers status Lars-Peter Clausen
2011-04-13 7:39 ` [alsa-devel] [PATCH 1/5] ASoC: Make struct snd_soc_card's dapm_widgets and dapm_routes const Liam Girdwood
2011-04-13 17:36 ` 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=4DA5F8FE.6000105@metafoo.de \
--to=lars@metafoo.de \
--cc=alsa-devel@alsa-project.org \
--cc=broonie@opensource.wolfsonmicro.com \
--cc=linux-kernel@vger.kernel.org \
--cc=lrg@slimlogic.co.uk \
/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).