From mboxrd@z Thu Jan 1 00:00:00 1970 From: Takashi Iwai Subject: Re: [PATCH] ALSA: HDA: Add jack detection for HDMI Date: Tue, 24 May 2011 07:39:43 +0200 Message-ID: References: <4DD27C43.3050509@canonical.com> <4DD4E909.80108@canonical.com> <74CDBE0F657A3D45AFBB94109FB122FF0498A480B7@HQMAIL01.nvidia.com> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mx2.suse.de (cantor2.suse.de [195.135.220.15]) by alsa0.perex.cz (Postfix) with ESMTP id 7B84C103854 for ; Tue, 24 May 2011 07:39:48 +0200 (CEST) In-Reply-To: <74CDBE0F657A3D45AFBB94109FB122FF0498A480B7@HQMAIL01.nvidia.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: alsa-devel-bounces@alsa-project.org Errors-To: alsa-devel-bounces@alsa-project.org To: Stephen Warren Cc: ALSA Development Mailing List , David Henningsson List-Id: alsa-devel@alsa-project.org At Mon, 23 May 2011 14:49:15 -0700, Stephen Warren wrote: > > Takashi Iwai wrote at Thursday, May 19, 2011 4:06 AM: > > At Thu, 19 May 2011 11:55:21 +0200, > > David Henningsson wrote: > > > > > > On 2011-05-17 17:46, Takashi Iwai wrote: > > > > At Tue, 17 May 2011 15:46:43 +0200, > > > > David Henningsson wrote: > > > >> > > > >> Just as for headphones and microphone jacks, this patch adds reporting > > > >> of HDMI jack status through the input layer. > > > >> > >... > > > > OK, as the jack report itself doesn't play a big role yet so far for > > HD-audio, let's get it in, and give pressure to graphics guys :) > > I've been testing a preliminary fix for this internally. I found that > the /proc ELD files correctly report monitor_present and eld_valid when > we hot unplug a monitor, but the other fields in the ELD file are not > cleared out to their default state. As best I can tell, this is an ALSA > driver issue, since our display driver only fills in the other fields > when ELDV==1. Then it's just showing stale data. The eld fields are updated only when the data is valid. The patch below should fix the confusion. thanks, Takashi --- diff --git a/sound/pci/hda/hda_eld.c b/sound/pci/hda/hda_eld.c index 74b0560..cd96b1d 100644 --- a/sound/pci/hda/hda_eld.c +++ b/sound/pci/hda/hda_eld.c @@ -477,6 +477,8 @@ static void hdmi_print_eld_info(struct snd_info_entry *entry, snd_iprintf(buffer, "monitor_present\t\t%d\n", e->monitor_present); snd_iprintf(buffer, "eld_valid\t\t%d\n", e->eld_valid); + if (!e->eld_valid) + return; snd_iprintf(buffer, "monitor_name\t\t%s\n", e->monitor_name); snd_iprintf(buffer, "connection_type\t\t%s\n", eld_connection_type_names[e->conn_type]);