[alsa-devel] [PATCH 1/2] ALSA: hdmi - poll eld at resume time

Wang, Xingchao xingchao.wang at intel.com
Tue Jun 25 10:30:09 CEST 2013



> -----Original Message-----
> From: Takashi Iwai [mailto:tiwai at suse.de]
> Sent: Tuesday, June 25, 2013 3:09 PM
> To: Wang, Xingchao
> Cc: alsa-devel at alsa-project.org; Wang Xingchao
> Subject: Re: [PATCH 1/2] ALSA: hdmi - poll eld at resume time
> 
> At Tue, 25 Jun 2013 09:06:32 +0200,
> Takashi Iwai wrote:
> >
> > At Tue, 25 Jun 2013 06:34:49 +0000,
> > Wang, Xingchao wrote:
> > >
> > > Hi Takashi,
> > >
> > > > -----Original Message-----
> > > > From: Takashi Iwai [mailto:tiwai at suse.de]
> > > > Sent: Tuesday, June 25, 2013 2:07 PM
> > > > To: Wang, Xingchao
> > > > Cc: alsa-devel at alsa-project.org; Wang Xingchao
> > > > Subject: Re: [PATCH 1/2] ALSA: hdmi - poll eld at resume time
> > > >
> > > > At Tue, 25 Jun 2013 04:54:05 +0000, Wang, Xingchao wrote:
> > > > >
> > > > > Hi Takashi,
> > > > >
> > > > >
> > > > > > -----Original Message-----
> > > > > > From: Takashi Iwai [mailto:tiwai at suse.de]
> > > > > > Sent: Monday, June 24, 2013 8:50 PM
> > > > > > To: Wang, Xingchao
> > > > > > Cc: alsa-devel at alsa-project.org; Wang Xingchao
> > > > > > Subject: Re: [PATCH 1/2] ALSA: hdmi - poll eld at resume time
> > > > > >
> > > > > > At Mon, 24 Jun 2013 12:19:42 +0000, Wang, Xingchao wrote:
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > > > -----Original Message-----
> > > > > > > > From: Takashi Iwai [mailto:tiwai at suse.de]
> > > > > > > > Sent: Monday, June 24, 2013 7:33 PM
> > > > > > > > To: Wang Xingchao
> > > > > > > > Cc: alsa-devel at alsa-project.org; Wang, Xingchao
> > > > > > > > Subject: Re: [PATCH 1/2] ALSA: hdmi - poll eld at resume
> > > > > > > > time
> > > > > > > >
> > > > > > > > At Mon, 24 Jun 2013 07:45:23 -0400, Wang Xingchao wrote:
> > > > > > > > >
> > > > > > > > > Hdmi driver may not receive intrinsic event from gfx
> > > > > > > > > side when it's in runtime suspend mode. There's no ELD
> > > > > > > > > info when exit from runtime suspend. This patch avoid missing
> ELD info.
> > > > > > > >
> > > > > > > > hda_call_codec_resume() sets the jack detection all dirty,
> > > > > > > > thus each jack detection callback should be called at
> > > > > > > > resume.  Didn't it work as
> > > > > > expected?
> > > > > > >
> > > > > > > I would double check that. In my test, it doesnot work as expected.
> > > > > >
> > > > > > OK, I found the problem.  patch_hdmi.c enables the jack
> > > > > > detection stuff without the callback, so the resume code
> > > > > > triggers the check of jack detection but only updates the kcontrols.
> > > > >
> > > > > You patch did not resolve the issue.
> > > > > I added some debug log, the callback wasnot called at all.
> > > >
> > > > Even if you unplugged while runtime suspend?
> > >
> > > Yes, the controller/codec suspended in runtime already.
> > >
> > > >
> > > > The callback is called only when the plug status (i.e. the jack
> > > > detection state) change is detected at the resume time -- i.e. the
> > > > state the driver holds differs from the state at the resume.
> > > >
> > >
> > > Do you assume jackpoll_interval be non-zero? If so the hda_jackpoll_work
> will continue to run periodically.
> > > IMO the callback just need be called only once at resume time.
> >
> > Hmm, the problem is that the callback updater isn't called in the
> > resume path as default.  The oneliner below will fix it.
> 
> Forgot to attach...

Yes, it works if call snd_hda_jack_poll_all(codec) directly, but sometimes read pin sense value is 0xc000,0000 even unplug monitor, and eld# will keep valid all the time.
Although sometimes it works(the ELD info refreshed correctly), you have to wake up controller/codec before check eld info(cat codec# or play a piece of audio).

Thanks
--xingchao

> 
> 
> Takashi
> 
> ---
> diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c index
> 35090b3..86d4709 100644
> --- a/sound/pci/hda/hda_codec.c
> +++ b/sound/pci/hda/hda_codec.c
> @@ -3942,6 +3942,7 @@ static void hda_call_codec_resume(struct
> hda_codec *codec)
>  			codec->patch_ops.init(codec);
>  		snd_hda_codec_resume_amp(codec);
>  		snd_hda_codec_resume_cache(codec);
> +		snd_hda_jack_poll_all(codec);
>  	}
> 
>  	if (codec->jackpoll_interval)


More information about the Alsa-devel mailing list