From patchwork Tue Feb 23 19:09:02 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Martin Kepplinger X-Patchwork-Id: 8395641 Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 745E2C0553 for ; Tue, 23 Feb 2016 19:10:47 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 74F6E20306 for ; Tue, 23 Feb 2016 19:10:46 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id EB183202F0 for ; Tue, 23 Feb 2016 19:10:44 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id D5134265E02; Tue, 23 Feb 2016 20:10:42 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,NO_DNS_FOR_FROM, RCVD_IN_DNSWL_NONE,UNPARSEABLE_RELAY autolearn=no version=3.3.1 Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 7A8FA26078A; Tue, 23 Feb 2016 20:10:35 +0100 (CET) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id 7D2E9260881; Tue, 23 Feb 2016 20:10:33 +0100 (CET) Received: from mout01.posteo.de (mout01.posteo.de [185.67.36.65]) by alsa0.perex.cz (Postfix) with ESMTP id 3BDAA26067A for ; Tue, 23 Feb 2016 20:10:28 +0100 (CET) Received: from dovecot03.posteo.de (dovecot03.posteo.de [172.16.0.13]) by mout01.posteo.de (Postfix) with ESMTPS id 7ADF020B68 for ; Tue, 23 Feb 2016 20:10:27 +0100 (CET) Received: from mail.posteo.de (localhost [127.0.0.1]) by dovecot03.posteo.de (Postfix) with ESMTPSA id 3q8qhc28Nfz5vN7; Tue, 23 Feb 2016 20:10:23 +0100 (CET) To: =?UTF-8?B?VmlsbGUgU3lyasOkbMOk?= , Takashi Iwai References: <56BE0044.9080500@posteo.de> <56CAE1C5.4070107@posteo.de> <56CB1510.4010503@posteo.de> <56CB5A4A.90906@posteo.de> <56CB7F98.20807@posteo.de> <20160223171447.GL23290@intel.com> From: Martin Kepplinger X-Enigmail-Draft-Status: N1110 Message-ID: <56CCAE4E.3090009@posteo.de> Date: Tue, 23 Feb 2016 20:09:02 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Icedove/38.5.0 MIME-Version: 1.0 In-Reply-To: <20160223171447.GL23290@intel.com> Cc: alsa-devel@alsa-project.org, intel-gfx@lists.freedesktop.org, linux-kernel@vger.kernel.org, han.lu@intel.com, treding@nvidia.com, david.henningsson@canonical.com Subject: Re: [alsa-devel] [Intel-gfx] [BUG] [REGRESSION] [BISECTED] -rc1 breaks audio over HDMI for i915 X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP Am 2016-02-23 um 18:14 schrieb Ville Syrjälä: > On Tue, Feb 23, 2016 at 05:57:40PM +0100, Takashi Iwai wrote: >> On Mon, 22 Feb 2016 22:37:28 +0100, >> Martin Kepplinger wrote: >>> >>> Am 2016-02-22 um 20:10 schrieb Takashi Iwai: >>>> On Mon, 22 Feb 2016 19:58:18 +0100, >>>> Martin Kepplinger wrote: >>>>> >>>>> Am 2016-02-22 um 15:12 schrieb Takashi Iwai: >>>>>> On Mon, 22 Feb 2016 15:02:56 +0100, >>>>>> Martin Kepplinger wrote: >>>>>>>> And how about my questions in the previous mail? Does >>>>>>>> i915_audio_component_get_eld() is called and returns 0? >>>>>>>> And is monitor_present set true or false? >>>>>>> >>>>>>> i915_audio_component_get_eld() returns 0 and monitor_present is 0. >>>>>>>> >>>>>>>> If i915_audio_component_get_eld() is called but returns zero, track >>>>>>>> the code flow there. It means either intel_encoder is NULL or >>>>>>>> intel_dig_port->audio_connector is NULL. >>>>>>> >>>>>>> intel_dig_port->audio_connector is NULL! >>>>>>> >>>>>>> (when called during boot and during HDMI plugin) >>>>>> >>>>>> Interesting. The relevant code flow should be like: >>>>>> >>>>>> intel_audio_codec_enable() >>>>>> -> acomp->audio_ops->pin_eld_notify() >>>>>> -> intel_pin_eld_notify() >>>>>> -> check_presence_and_report() >>>>>> -> hdmi_present_sense() >>>>>> -> sync_eld_via_acomp() >>>>>> -> snd_hdac_acomp_get_eld() >>>>>> -> i915_audio_component_get_eld() >>>>>> >>>>>> So, at first, check whether intel_dig_port in both >>>>>> intel_audio_codec_enable() and i915_audio_component_get_eld() points >>>>>> to the same object address. The audio_connector must be set in >>>>>> intel_audio_codec_enable(), thus basically it must be non-NULL at >>>>>> i915_audio_component_get_eld(), too. >>>>>> >>>>> >>>>> intel_dig_port is *not* the same object in these 2 places. During >>>>> plugin, see: >>>>> >>>>> [ 146.934091] in intel_audio_codec_enable: intel_dig_port is >>>>> ffff8800a1f54000 >>>>> [ 146.934121] in i915_audio_component_get_eld: intel_dig_port is >>>>> ffff880244f7d000 >>>>> >>>>> sorry for the slow responses. I'll try to go back that direction unless >>>>> again someone comes up with other suggestions. >>>> >>>> Thanks, this makes sense. It implies that the digital port mapping is >>>> somehow wrong. There are three places setting dig_port_map[], one in >>>> intel_ddi_init(), one in intel_dp_init() and another in >>>> intel_hdmi_init(). Try to check which function creates which object >>>> assigned to which port number, together with drm.debug=0x0e debug >>>> messages. >>>> >>> without using drm.debug=0x0e, but by printing the kmalloc'ed objects in >>> those 3 functions with ports, I found: >>> >>> 2 of them are running, only during boot: >>> >>> [ 2.322865] intel_hdmi_init: intel_dig_port is ffff880242564000 port 1 >>> [ 2.322999] intel_dp_init: intel_dig_port is ffff880242f30000 port 1 >>> >>> is is correct for them to have both port 1? Any more ideas? >> >> Adding intel-gfx ML to Cc. >> >> Martin, is the machine SandyBridge or IvyBridge? >> >> In anyway it's PCH_SPLIT and there can call both intel_hdmi_init() and >> intel_dp_init() for the same port although both functions map >> intel_dig_port[]. The assumption of intel_dig_port[] reverse mapping >> is that there is only a single intel_dig_port assigned to a port, but >> this doesn't look correct... > > On pre-HSW there can indeed be two encoders for the same port. > And I'm planning to change HSW+ to follow that model as well, > but I've been busy with other stuff to finish off that work [1] > > [1] https://lists.freedesktop.org/archives/intel-gfx/2015-December/082384.html > So your work wouldn't fix hdmi-audio pre-HSW here? Anyways, a quick fix would be good, and if not that, remember marking future changes that fix this, for stable. What implications would something like the following, that Takashi suggested, have on other systems? commit 7b20983c02928c55377b3cfa927257a17896ecee Author: Martin Kepplinger Date: Tue Feb 23 18:29:05 2016 +0100 sound: pci: hda: set codec_has_acomp to false due to pending regression v4.5 and it's significant intel hda changes break audio over HDMI for some cases. This is a temporary workaround to be reverted in the future. Signed-off-by: Martin Kepplinger diff --git a/sound/pci/hda/patch_hdmi.c b/sound/pci/hda/patch_hdmi.c index 8ee78db..6d6f104 100644 --- a/sound/pci/hda/patch_hdmi.c +++ b/sound/pci/hda/patch_hdmi.c @@ -156,7 +156,7 @@ struct hdmi_spec { bool i915_bound; /* was i915 bound in this driver? */ }; -#ifdef CONFIG_SND_HDA_I915 +#if 0 #define codec_has_acomp(codec) \ ((codec)->bus->core.audio_component != NULL) #else