From mboxrd@z Thu Jan 1 00:00:00 1970 From: Wu Fengguang Subject: [PATCH 11/11] intelhdmi - keep power on to avoid losing hot plug event Date: Sun, 15 Nov 2009 19:32:30 +0800 Message-ID: <20091115114440.713938034@intel.com> References: <20091115113219.606666087@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mga03.intel.com (mga03.intel.com [143.182.124.21]) by alsa0.perex.cz (Postfix) with ESMTP id AF773103875 for ; Sun, 15 Nov 2009 12:46:41 +0100 (CET) Content-Disposition: inline; filename=hdmi-power-on.patch 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: Takashi Iwai Cc: alsa-devel@alsa-project.org, Wu Fengguang , Shane W , =?UTF-8?q?David=20H=C3=A4rdeman?= List-Id: alsa-devel@alsa-project.org The intelhdmi patch relies on reliable pin presence detection to conditionally generate infoframe for the connected pins. However the codec power off risks losing the hot plug event. Interestingly if such hot plug event is missed (it may not be generated by hardware at all), we cannot even get correct pin presence info with the AC_VERB_GET_PIN_SENSE query some time later. So always keep the HDMI codec power on. This also avoids losing 0.5s audio samples if start playing immediately after powering on the codec. Signed-off-by: Wu Fengguang --- sound/pci/hda/patch_intelhdmi.c | 9 +++++++++ 1 file changed, 9 insertions(+) --- sound-2.6.orig/sound/pci/hda/patch_intelhdmi.c 2009-11-13 18:21:41.000000000 +0800 +++ sound-2.6/sound/pci/hda/patch_intelhdmi.c 2009-11-13 18:21:47.000000000 +0800 @@ -868,6 +868,15 @@ static int intel_hdmi_init(struct hda_co struct intel_hdmi_spec *spec = codec->spec; int i; + /* + * never power off at idle time: + * - if powered off, the monitor hot plug events will be ignored, + * after that AC_VERB_GET_PIN_SENSE returns inaccurate value + * - we need to keep the HDMI link active to avoid the loss of first + * 0.5s audio samples (due to slow responding HDMI sinks) + */ + codec->power_count++; + for (i = 0; spec->pin[i]; i++) { hdmi_enable_output(codec, spec->pin[i]); snd_hda_codec_write(codec, spec->pin[i], 0,