From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 05C9CC43331 for ; Mon, 11 Nov 2019 16:05:27 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 038CC2190F for ; Mon, 11 Nov 2019 16:05:25 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="Uz6sQ1nH" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 038CC2190F Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id C8C6D166D; Mon, 11 Nov 2019 17:04:33 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz C8C6D166D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1573488323; bh=8ftBIbTor41N4EdvgAPT0uEpy9ajOfGlIAKOo1oXnxE=; h=Date:From:To:In-Reply-To:References:Cc:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=Uz6sQ1nHPyErqpLSCJ1WMwBYYmEeqmDmC+G5oXCM8oe9p60t0PXC6BTGc2CmKi+1k MwWaYHuYkb7X1XBOM5RM5AFhVMdPBwV8HHMZ/sTLMhoKrAM0N4r7P2wgkdUmQRJYFu giYlxJ2Wq8fENNWAkbsGUw7/mG5hKdMZ7f3rzUwI= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 306ABF8045D; Mon, 11 Nov 2019 17:04:33 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 42C5DF804FF; Mon, 11 Nov 2019 17:04:31 +0100 (CET) Received: from mx1.suse.de (mx2.suse.de [195.135.220.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 9CD24F802E0 for ; Mon, 11 Nov 2019 17:04:28 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 9CD24F802E0 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 96A23AFE8; Mon, 11 Nov 2019 16:04:27 +0000 (UTC) Date: Mon, 11 Nov 2019 17:04:27 +0100 Message-ID: From: Takashi Iwai To: Hui Wang In-Reply-To: References: <20191111144502.22910-1-hui.wang@canonical.com> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL/10.8 Emacs/25.3 (x86_64-suse-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Cc: alsa-devel@alsa-project.org, stable@vger.kernel.org Subject: Re: [alsa-devel] [PATCH] ALSA: hda/hdmi - add a parameter to let users decide if checking the eld_valid X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 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: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" On Mon, 11 Nov 2019 16:33:45 +0100, Takashi Iwai wrote: > > On Mon, 11 Nov 2019 15:45:02 +0100, > Hui Wang wrote: > > > > With the commit 7f641e26a6df ("ALSA: hda/hdmi - Consider eld_valid > > when reporting jack event"), the driver checks eld_valid before > > reporting Jack state, this fixes the 4 HDMI/DP audio devices issue. > > > > But recently some users complained that the hdmi audio on their > > machines couldn't work anymore with this commit. On their machines, > > the monitor_present is 1 while the eld_valid is 0 when plugging a > > monitor, and the hdmi audio could work even the eld_valid is 0. > > > > To make the hdmi audio work again on those machines, adding a module > > parameter, if usrs want to skip the checking eld_valid, they > > could set checking_eld_valid=0 when loading the module. And this > > parameter only applies to sense_via_verbs, for those getting eld via > > component, no need to apply this parameter since it is impossible > > that present is 1 while eld_valid is 0. > > > > BugLink: https://bugs.launchpad.net/bugs/1834771 > > Fixes: 7f641e26a6df ("ALSA: hda/hdmi - Consider eld_valid when reporting jack event") > > Cc: > > Signed-off-by: Hui Wang > > Well, this sort of module option is rather a last resort, so I > hesitate to apply this. > > The bug reports in the above are a bit hard to digest quickly. > Could you tell exactly which hardware (and drivers) show the problem? > > FWIW, amdgpu driver already got the audio-component binding recently, > so this problem shouldn't be triggered, at least in this code path. > And, for nouveau and radeon, I already submitted the patches to > support the audio-component binding, but by some reason they haven't > been merged to the upstream. In that case, we'd need to ping DRM > guys. On the second thought, I wonder whether eld_valid would be corrected later by the graphics side at all. If yes, it's a timing issue, and it can be corrected with the repolling. A totally untested patch is below. thanks, Takashi --- a/sound/pci/hda/patch_hdmi.c +++ b/sound/pci/hda/patch_hdmi.c @@ -1549,19 +1549,25 @@ static bool hdmi_present_sense_via_verbs(struct hdmi_spec_per_pin *per_pin, do_repoll = true; } - if (do_repoll) + do_repoll |= repoll && eld->eld_valid != eld->monitor_present; + if (do_repoll) { schedule_delayed_work(&per_pin->work, msecs_to_jiffies(300)); - else + ret = false; + } else { update_eld(codec, per_pin, eld); - - ret = !repoll || !eld->monitor_present || eld->eld_valid; + per_pin->repoll_count = 0; + ret = true; + } jack = snd_hda_jack_tbl_get(codec, pin_nid); if (jack) { jack->block_report = !ret; - jack->pin_sense = (eld->monitor_present && eld->eld_valid) ? - AC_PINSENSE_PRESENCE : 0; + if (ret) { + jack->pin_sense = (eld->monitor_present && eld->eld_valid) ? + AC_PINSENSE_PRESENCE : 0; + } } + mutex_unlock(&per_pin->lock); return ret; } _______________________________________________ Alsa-devel mailing list Alsa-devel@alsa-project.org https://mailman.alsa-project.org/mailman/listinfo/alsa-devel