From patchwork Sun May 4 23:38:44 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anssi Hannula X-Patchwork-Id: 4111051 Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 85E9C9F23C for ; Sun, 4 May 2014 23:39:17 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id AE457203F7 for ; Sun, 4 May 2014 23:39:16 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 6E5AC20411 for ; Sun, 4 May 2014 23:39:15 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id D433A261A68; Mon, 5 May 2014 01:39:13 +0200 (CEST) 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, UNPARSEABLE_RELAY autolearn=no version=3.3.1 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id DF3FC261A68; Mon, 5 May 2014 01:39:02 +0200 (CEST) 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 2C7B1261A89; Mon, 5 May 2014 01:39:01 +0200 (CEST) Received: from sirokuusama.dnainternet.net (sirokuusama.dnainternet.net [83.102.40.133]) by alsa0.perex.cz (Postfix) with ESMTP id 293112608CF for ; Mon, 5 May 2014 01:38:52 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by sirokuusama.dnainternet.net (Postfix) with ESMTP id 58E6E3F92D; Mon, 5 May 2014 02:38:52 +0300 (EEST) X-Virus-Scanned: DNA Postiturva at dnainternet.net Received: from sirokuusama.dnainternet.net ([83.102.40.133]) by localhost (sirokuusama.dnainternet.net [127.0.0.1]) (DNA Postiturva, port 10041) with ESMTP id z5SQRkp8-yj7; Mon, 5 May 2014 02:38:51 +0300 (EEST) Received: from luumupuu.dnainternet.net (luumupuu.dnainternet.net [83.102.40.213]) by sirokuusama.dnainternet.net (Postfix) with ESMTP id E0F813F8E0; Mon, 5 May 2014 02:38:51 +0300 (EEST) Received: from mail.onse.fi (unknown [109.204.216.205]) by luumupuu.dnainternet.net (Postfix) with ESMTP id C4D735FA91; Mon, 5 May 2014 02:38:48 +0300 (EEST) Received: by mail.onse.fi (Postfix, from userid 501) id A0FB64035B; Mon, 5 May 2014 02:38:48 +0300 (EEST) From: Anssi Hannula To: tiwai@suse.de Date: Mon, 5 May 2014 02:38:44 +0300 Message-Id: <1399246724-16611-2-git-send-email-anssi.hannula@iki.fi> X-Mailer: git-send-email 1.8.4.5 In-Reply-To: <1399246724-16611-1-git-send-email-anssi.hannula@iki.fi> References: <1399246724-16611-1-git-send-email-anssi.hannula@iki.fi> Cc: Stephan Raue , alsa-devel@alsa-project.org Subject: [alsa-devel] [PATCH 2/2] ALSA: hda - hdmi: Set infoframe and channel mapping even without sink 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: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP Currently infoframe contents and channel mapping are only set when a sink (monitor) is present. However, this does not make much sense, since 1) We can make a very reasonable guess on CA after 18e391862c ("ALSA: hda - hdmi: Fallback to ALSA allocation when selecting CA") or by relying on a previously valid ELD (or we may be using a user-specified channel map). 2) Not setting infoframe contents and channel count simply means they are left at a possibly incorrect state - playback is still allowed to proceed (with missing or wrongly mapped channels). Reasons for monitor_present being 0 include disconnected cable, video driver issues, or codec not being spec-compliant. Note that in actual disconnected-cable case it should not matter if these settings are wrong as they will be re-set after jack detection, though. Change the behavior to allow the infoframe contents and the channel mapping to be set even without a sink/monitor, either based on the previous valid ELD contents, if any, or based on sensible defaults (standard channel layouts or provided custom map, sink type HDMI). Signed-off-by: Anssi Hannula Tested-by: Stephan Raue --- This simply removes the monitor_present check, which is probably more trouble than it is worth, as it may trip obscure setups even though we can tolerate !monitor_present and !eld in 99%+ of all cases by using defaults, nowadays post-18e391862c anyway. Downside is that missing monitor_present may not be noticed by the user as ~everything continues to work. sound/pci/hda/patch_hdmi.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/sound/pci/hda/patch_hdmi.c b/sound/pci/hda/patch_hdmi.c index 1edbb9c47c2d..016f785cdf45 100644 --- a/sound/pci/hda/patch_hdmi.c +++ b/sound/pci/hda/patch_hdmi.c @@ -1127,10 +1127,6 @@ static void hdmi_setup_audio_infoframe(struct hda_codec *codec, AMP_OUT_UNMUTE); eld = &per_pin->sink_eld; - if (!eld->monitor_present) { - hdmi_set_channel_count(codec, per_pin->cvt_nid, channels); - return; - } if (!non_pcm && per_pin->chmap_set) ca = hdmi_manual_channel_allocation(channels, per_pin->chmap);