Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp4364540pxj; Tue, 25 May 2021 06:27:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx46z4Y3QODmiQF8gZf4CQNmB6t3IPVhuhMB+WM5xQU6rjIfrEaf5hnLJDvY+7p4E7iElKd X-Received: by 2002:a50:8e44:: with SMTP id 4mr31984379edx.244.1621949221071; Tue, 25 May 2021 06:27:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621949221; cv=none; d=google.com; s=arc-20160816; b=arqp5K6xfuc0Td59A4twj7IPK34I9MuHdAYb4/OJJaMjRbhiW/bhZKHhUJ5/Gvdig2 2MPSpWdML1iyr0qWrP6h9eOoA1LR4V0Qp1+QKg5kuSYVe3dc+091gZxvA44295/VnTpH 5Jzf/lkBr7ZvwLIEn67cw7/6miMhAqyMcjn1HfughhNnHVskJSwYtkhSjtxcRFXiwOk1 v6jO//ucFMWtZAYvToPlXSGU85Yixx0oGCNFg6f5HjM7piFZ9VCawKLhOjPdeAK+wBpl idjOJ4MrhUP8g048igUwYZ7QhfhcW5JUOZRHcJ88WI9KBpNqrGHy1aQ5+JkiUR27LCj9 fINQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:dkim-signature; bh=Hm66TN2+4rFj2+hvHW2sdkOXUymQe5MbU4IMHCfHuAI=; b=z4m6HqIiG6T8UXZi/zhAg5ZuucN/SZkUwSjBBxJIsLlS0hYPbi5ndQ4bjkkXLcAXAP zt1SKRT1euc30GLI/wwNyQQZHjHaW/nExaNl4Z/BO8Vxo0Hmp+2qunzK81sfTtBv2DKj 5CGnPiJp7nSFMjNTJnAqTlXjtjRzsDz2dFQQY59gmFxRlwhPiG4Ug3LAEPt2pTzoPGWs B0NJwRlQL50AAJbMq12XX8aewCx6RPuKcmGC2RTbILSPrBTtWHW161a4HEY+biCLzi6G APqfBP2dTFx/uPFXamjkOc4yCAZxbZxJb8VCWkTN1FzFz+0Etl6o868euf9mchJNRuAy 7Fuw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cerno.tech header.s=fm2 header.b=fghqbZjj; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=OMSHDlqU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=cerno.tech Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f18si15163224ejk.304.2021.05.25.06.26.37; Tue, 25 May 2021 06:27:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@cerno.tech header.s=fm2 header.b=fghqbZjj; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=OMSHDlqU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=cerno.tech Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233374AbhEYN0j (ORCPT + 99 others); Tue, 25 May 2021 09:26:39 -0400 Received: from new2-smtp.messagingengine.com ([66.111.4.224]:56609 "EHLO new2-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233254AbhEYNZ4 (ORCPT ); Tue, 25 May 2021 09:25:56 -0400 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailnew.nyi.internal (Postfix) with ESMTP id E7696580712; Tue, 25 May 2021 09:24:12 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Tue, 25 May 2021 09:24:12 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cerno.tech; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm2; bh=Hm66TN2+4rFj2 +hvHW2sdkOXUymQe5MbU4IMHCfHuAI=; b=fghqbZjjxyJ77b9oDV6xmd/Cu5Xzx zOuj5ZDE7A3L++IKqsBFXrp+RbRagqC5zO3SPA0iwIsy+qAMuFzUhsKCrX5bOw2H 6B8bV/iV3yq/rc7VxUmarj8CuxCQnQ95wpjVKRFZcAwkavkYhrQCwPnYbAgFnvmg MMRqqsP5uXtajgPRcrwnK7UkNdwxtzNg1aZCoQcRUXCX0Al+xAM1a/uqf86WCvW3 HJuf4bwmR2xkwJrqBxjv7Dy4Z6tRE64PoNT5f98YcVz1eT4HYMEF/8HzCDg/OTzS OfeXrg3DdphUqr8ijvDJZuEe8PpAxT4TAUm7OznEWAAF6lWzCTO1kDmng== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; bh=Hm66TN2+4rFj2+hvHW2sdkOXUymQe5MbU4IMHCfHuAI=; b=OMSHDlqU eHcSPgjMwHct8SnnWXxBm8hqPpoFOc01qe9wsU1CLPtn9br8m5h8+d5kQ70TZ8/6 0Q+Ut4nuCp7Ovt8AQ/ERm/V/Gc+ioD1tsMEyL/WZ/mY4294JusGyYD/34kE5v5Yk TGeEB0bpl+CWdNDiy6/8+ZY9qYdrAvatmAyP1LvxoACZynTNaLdjgKZeIhGvAHIF Et+CB92zqZUf1V5Ht+We2i5aiJxCJYgfA/iCKVWRWTwaIVPJ54nYo20BcvnAQFW+ pvmAiWd+RdEoxBMxwsRmpQpX1H9WL1Kv5/c3hJgswvg3nMDTukLfU+NI/2SOYyD1 wc5Bd8m4eKExgA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrvdekuddgieehucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpeforgigihhm vgcutfhiphgrrhguuceomhgrgihimhgvsegtvghrnhhordhtvggthheqnecuggftrfgrth htvghrnhepvdekleevfeffkeejhfffueelteelfeduieefheduudfggffhhfffheevveeh hedvnecukfhppeeltddrkeelrdeikedrjeeinecuvehluhhsthgvrhfuihiivgeptdenuc frrghrrghmpehmrghilhhfrhhomhepmhgrgihimhgvsegtvghrnhhordhtvggthh X-ME-Proxy: Received: from localhost (lfbn-tou-1-1502-76.w90-89.abo.wanadoo.fr [90.89.68.76]) by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 25 May 2021 09:24:12 -0400 (EDT) From: Maxime Ripard To: Jaroslav Kysela , Mark Brown , dri-devel@lists.freedesktop.org, Daniel Vetter , David Airlie , Maarten Lankhorst , Thomas Zimmermann , Maxime Ripard , Liam Girdwood , Takashi Iwai Cc: devicetree@vger.kernel.org, Dave Stevenson , Phil Elwell , Tim Gover , Dom Cobley , linux-doc@vger.kernel.org, Eric Anholt , Nicolas Saenz Julienne , linux-kernel@vger.kernel.org, alsa-devel@alsa-project.org, Maxime Ripard , Nicolas Saenz Julienne , bcm-kernel-feedback-list@broadcom.com, linux-arm-kernel@lists.infradead.org, Daniel Vetter , linux-rpi-kernel@lists.infradead.org, Jonathan Corbet , Rob Herring , Dom Cobley Subject: [PATCH v2 06/12] drm/vc4: hdmi: Set HD_CTL_WHOLSMP and HD_CTL_CHALIGN_SET Date: Tue, 25 May 2021 15:23:48 +0200 Message-Id: <20210525132354.297468-7-maxime@cerno.tech> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210525132354.297468-1-maxime@cerno.tech> References: <20210525132354.297468-1-maxime@cerno.tech> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Dom Cobley Symptom is random switching of speakers when using multichannel. Repeatedly running speakertest -c8 occasionally starts with channels jumbled. This is fixed with HD_CTL_WHOLSMP. The other bit looks beneficial and apears harmless in testing so I'd suggest adding it too. Documentation says: HD_CTL_WHILSMP_SET Wait for whole sample. When this bit is set MAI transmit will start only when there is at least one whole sample available in the fifo. Documentation says: HD_CTL_CHALIGN_SET Channel Align When Overflow. This bit is used to realign the audio channels in case of an overflow. If this bit is set, after the detection of an overflow, equal amount of dummy words to the missing words will be written to fifo, filling up the broken sample and maintaining alignment. Signed-off-by: Dom Cobley Signed-off-by: Maxime Ripard --- drivers/gpu/drm/vc4/vc4_hdmi.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c index c27b287d2053..212b5df11d73 100644 --- a/drivers/gpu/drm/vc4/vc4_hdmi.c +++ b/drivers/gpu/drm/vc4/vc4_hdmi.c @@ -1267,7 +1267,9 @@ static int vc4_hdmi_audio_trigger(struct snd_pcm_substream *substream, int cmd, HDMI_WRITE(HDMI_MAI_CTL, VC4_SET_FIELD(vc4_hdmi->audio.channels, VC4_HD_MAI_CTL_CHNUM) | - VC4_HD_MAI_CTL_ENABLE); + VC4_HD_MAI_CTL_WHOLSMP | + VC4_HD_MAI_CTL_CHALIGN | + VC4_HD_MAI_CTL_ENABLE); break; case SNDRV_PCM_TRIGGER_STOP: HDMI_WRITE(HDMI_MAI_CTL, -- 2.31.1