[alsa-devel] Disabling DAPM from ASoC framework

Santhosh N M santo4ul at gmail.com
Tue Apr 22 06:47:35 CEST 2014

Hi Mark,

Thanks for your email.

>>>>>Why do you not want to do power management?

It is because of the following reasons,

1) Due the complication in hardware (where codec is inbuilt to the SoC) and
the software architecture, we decided to leave all the AMPs, DIFFINs and
SINGINs ON always. All the MUXs are pre-configured (in codec driver) to
route audio to the right path. So there is no real need to switch OFF any
of the power components on the device!
2) The device is AC powered and power consumption is not a problem here
(unlike battery operated devices)

Currently I'm achieving this by (in snd_soc_codec_driver structure)

.dapm_widgets = NULL;
.num_dapm_widgets = 0;
.dapm_routes = NULL;
 .num_dapm_routes = 0;

Also, I'm not invoking any DAPM related functions
(snd_soc_dapm_add_routes(), snd_soc_dapm_sync(), etc.)

This approach worked when I tested quickly. However, I'm slightly worried
when you say " it's likely things will break". Not sure if there could lead
to some memory leak in the long run.

Do you have any recommendation to achieve this in the right way?

Thank you.

Best Regards,

On Tue, Apr 22, 2014 at 4:09 AM, Mark Brown <broonie at kernel.org> wrote:

> On Mon, Apr 21, 2014 at 01:10:42PM +0530, Santhosh N M wrote:
> >    I'm a newbie to ALSA/ASoC framework. Lets say there is a requirement,
> > where, the application (user space) takes the responsibility to switch
> > ON/OFF the power components of the codec components (using ALSA Mixer
> > Interface).
> >    In this case, is there a standard way to disable DAPM from ASoC? One
> way
> > I see (and found to be working) is setting num_dapm_widgets=0
> > and num_dapm_routes=0 before invoking snd_soc_register_codec()
> This isn't supported, it's mandatory to have DAPM support in drivers -
> if there are no DAPM widgets it's likely things will break.  Why do you
> not want to do power management?

More information about the Alsa-devel mailing list