[alsa-devel] [PATCH 2/2] ALSA: hda - get realtime ELD info when codec suspended

Takashi Iwai tiwai at suse.de
Mon Jun 24 14:00:53 CEST 2013


At Mon, 24 Jun 2013 11:56:21 +0000,
Wang, Xingchao wrote:
> 
> > -----Original Message-----
> > From: Takashi Iwai [mailto:tiwai at suse.de]
> > Sent: Monday, June 24, 2013 7:36 PM
> > To: Wang Xingchao
> > Cc: alsa-devel at alsa-project.org; Wang, Xingchao
> > Subject: Re: [PATCH 2/2] ALSA: hda - get realtime ELD info when codec
> > suspended
> > 
> > At Mon, 24 Jun 2013 07:45:24 -0400,
> > Wang Xingchao wrote:
> > >
> > > when controller/codec in runtime suspended mode, monitor hotplug would
> > > not trigger unsolicited event. This patch tries to power up codec and
> > > hdmi driver would probe ELD info again.
> > 
> > I don't know whether this is the wanted behavior.
> > The proc file is supposed to read the driver's status, not to trigger anything.
> > 
> 
> I explained in another mail what the patch fix. In the real case, when HDMI monitor removed,
> Eld# still hold monitor information because the codec/controller is in suspend mode atm and has no chance to refresh eld.

And this is no bug, per se.  The proc file shows the driver's current
status, not the hardware's raw status.

> Even when controller/codec waken up, it will not refresh eld# as gfx side hand
led hdmi hotplut when audio driver suspended.

... and this is actually the bug.
But, it's still unclear why the jack detection callback isn't called
at resume.


Takashi

> Then user will always see eld valid info but in fact the monitor is removed already, obviously it's a bug.
> 
> Thanks
> --xingchao
> 
> > 
> > Takashi
> > 
> > > Signed-off-by: Wang Xingchao <xingchao.wang at linux.intel.com>
> > > ---
> > >  sound/pci/hda/hda_eld.c   | 6 ++++++
> > >  sound/pci/hda/hda_local.h | 1 +
> > >  2 files changed, 7 insertions(+)
> > >
> > > diff --git a/sound/pci/hda/hda_eld.c b/sound/pci/hda/hda_eld.c index
> > > d0d7ac1..914712a 100644
> > > --- a/sound/pci/hda/hda_eld.c
> > > +++ b/sound/pci/hda/hda_eld.c
> > > @@ -482,6 +482,7 @@ static void hdmi_print_eld_info(struct
> > snd_info_entry *entry,
> > >  				struct snd_info_buffer *buffer)
> > >  {
> > >  	struct hdmi_eld *eld = entry->private_data;
> > > +	struct hda_codec *codec = eld->codec;
> > >  	struct parsed_hdmi_eld *e = &eld->info;
> > >  	char buf[SND_PRINT_CHANNEL_ALLOCATION_ADVISED_BUFSIZE];
> > >  	int i;
> > > @@ -500,11 +501,14 @@ static void hdmi_print_eld_info(struct
> > snd_info_entry *entry,
> > >  		[4 ... 7] = "reserved"
> > >  	};
> > >
> > > +	snd_hda_power_up(codec);
> > > +
> > >  	mutex_lock(&eld->lock);
> > >  	snd_iprintf(buffer, "monitor_present\t\t%d\n", eld->monitor_present);
> > >  	snd_iprintf(buffer, "eld_valid\t\t%d\n", eld->eld_valid);
> > >  	if (!eld->eld_valid) {
> > >  		mutex_unlock(&eld->lock);
> > > +		snd_hda_power_down(codec);
> > >  		return;
> > >  	}
> > >  	snd_iprintf(buffer, "monitor_name\t\t%s\n", e->monitor_name); @@
> > > -529,6 +533,7 @@ static void hdmi_print_eld_info(struct snd_info_entry
> > *entry,
> > >  	for (i = 0; i < e->sad_count; i++)
> > >  		hdmi_print_sad_info(i, e->sad + i, buffer);
> > >  	mutex_unlock(&eld->lock);
> > > +	snd_hda_power_down(codec);
> > >  }
> > >
> > >  static void hdmi_write_eld_info(struct snd_info_entry *entry, @@
> > > -614,6 +619,7 @@ int snd_hda_eld_proc_new(struct hda_codec *codec,
> > struct hdmi_eld *eld,
> > >  	entry->c.text.write = hdmi_write_eld_info;
> > >  	entry->mode |= S_IWUSR;
> > >  	eld->proc_entry = entry;
> > > +	eld->codec = codec;
> > >
> > >  	return 0;
> > >  }
> > > diff --git a/sound/pci/hda/hda_local.h b/sound/pci/hda/hda_local.h
> > > index e0bf753..1aaf8b6 100644
> > > --- a/sound/pci/hda/hda_local.h
> > > +++ b/sound/pci/hda/hda_local.h
> > > @@ -747,6 +747,7 @@ struct hdmi_eld {
> > >  #ifdef CONFIG_PROC_FS
> > >  	struct snd_info_entry *proc_entry;
> > >  #endif
> > > +	struct hda_codec *codec;
> > >  };
> > >
> > >  int snd_hdmi_get_eld_size(struct hda_codec *codec, hda_nid_t nid);
> > > --
> > > 1.8.1.2
> > >
> 


More information about the Alsa-devel mailing list