[alsa-devel] [PATCH] hda_codec: restore control element values during resume
tiwai at suse.de
Thu May 3 12:38:04 CEST 2007
At Wed, 02 May 2007 11:57:00 -0400,
Daniel Drake wrote:
> Takashi Iwai wrote:
> > The controls should have been restored by snd_hda_resume_ctls() call
> > in stac92xx_resume(), so basically your patch must be suprefluous.
> > Could you check whether this gets called?
> I did see the snd_hda_resume_ctls() code but noted it was resuming from
> snd_kcontrol_new structures rather than snd_kcontrol instances. I'm
> still not sure what the difference is here, are they supposed to
> 'mirror' each other?
Not really. The snd_kcontrol_new struct is basically a template for
creating a control element. The codec code uses this array to get the
Tracking all kctls from the card instance is not suitable in this case
because it contains really _all_ control elements. hda-intel driver
may have multiple codecs, so you cannot check whether the element is
what your codec created or not.
Another way would be to keep a list of created kctls, but I chose a
simpler way to use kcontrol_new because they are already there.
> Anyway, it turns out that snd_hda_resume_ctls() doesn't get executed.
> stac92xx_resume() has this code:
> for (i = 0; i < spec->num_mixers; i++)
> snd_hda_resume_ctls(codec, spec->mixers[i]);
> On my system, spec->num_mixers is 0.
OK, it's a simple error. The resume callback should call
snd_hda_resume_ctls() with spec->mixer argument. The other codec
codes store this also onto spec->mixers array, so I overlooked.
Now fixed on HG tree.
More information about the Alsa-devel