[alsa-devel] power state in power save mode

Kailang kailang at realtek.com
Wed Apr 10 05:00:31 CEST 2019



> -----Original Message-----
> From: Takashi Iwai <tiwai at suse.de>
> Sent: Tuesday, April 9, 2019 6:15 PM
> To: Kailang <kailang at realtek.com>
> Cc: (alsa-devel at alsa-project.org) <alsa-devel at alsa-project.org>
> Subject: Re: power state in power save mode
> 
> On Tue, 09 Apr 2019 11:54:27 +0200,
> Kailang wrote:
> >
> > Hi Takashi,
> >
> > https://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound.git/commit
> > /?h=for-next&id=98081ca62cbac31fb0f7efaf90b2e7384ce22257
> >
> > Use upper patch to print power state in function alc256_init() and
> alc256_shutup().
> > But when kernel turn on power_save = 1. (echo 1 >
> > /sys/module/snd_hda_intel/parameters/power_save)
> >
> > The print power state value always be 0x0.
> 
> That's expected, it means PM_EVENT_ON.
> The power_state value is changed only during the suspend and resume.
> Once after returning from resume, it's set to PM_EVENT_ON.

I also test suspend and resume. It also show 0x0.
If it turn off power save, power state value will normally.

> 
> > ( If it turn off power save, power state value will normally)
> 
> What does it mean exactly...?
> 
> Actually one missing piece is to set PMSG_ON at the device initialization.  A
> patch like below.

Add this patch, the power state value will show on suspend and resume. Right?
I will test it later.

> 
> 
> thanks,
> 
> Takashi
> 
> --- a/sound/pci/hda/hda_codec.c
> +++ b/sound/pci/hda/hda_codec.c
> @@ -969,6 +969,7 @@ int snd_hda_codec_device_new(struct hda_bus *bus,
> struct snd_card *card,
> 
>  	/* power-up all before initialization */
>  	hda_set_power_state(codec, AC_PWRST_D0);
> +	codec->core.dev.power.power_state = PMSG_ON;
> 
>  	snd_hda_codec_proc_new(codec);
> 
> 
> ------Please consider the environment before printing this e-mail.


More information about the Alsa-devel mailing list