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 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6A659C433F5 for ; Sat, 2 Oct 2021 23:43:38 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4F6EB61A03 for ; Sat, 2 Oct 2021 23:43:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234276AbhJBXpX (ORCPT ); Sat, 2 Oct 2021 19:45:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44760 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234255AbhJBXpT (ORCPT ); Sat, 2 Oct 2021 19:45:19 -0400 Received: from mail-wm1-x333.google.com (mail-wm1-x333.google.com [IPv6:2a00:1450:4864:20::333]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1CAF1C0613EC for ; Sat, 2 Oct 2021 16:43:33 -0700 (PDT) Received: by mail-wm1-x333.google.com with SMTP id z184-20020a1c7ec1000000b003065f0bc631so14731652wmc.0 for ; Sat, 02 Oct 2021 16:43:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=/T6wA479aMjXiGVQMPU8TC7VB5tEcMArPpG5ub2OJHk=; b=EUhZfVpGDD6qg834LaUvUxb9ZhDqAco06iXtwjwHY0t+P8zjiqQea4m2vej+OHxL/l Y9mM1kUwszAQ25fM1xo1dLgXBC/nFzrAFFqUEvI/5eVVKy5RL8SSeenVB5i7Nv6dYGl9 BZFV9xkLNKKFml88jtYV9xgbx0khTQug76YELXAQeCyWcQHfeaU1f4scvMlhAGKsj3b3 C+Q+XSD1TRfSItSDklV22WZKxvf6Jw2radWrncD7geXukbtzwAjmq+4s9ZrXFRmbvXEU WPboa8oE9uQd9eDA39TWhg9PjdTjpW3EGvdA56dQFQ6vdJpr+EUtgqBoVvgxImd/mWDY b1vg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=/T6wA479aMjXiGVQMPU8TC7VB5tEcMArPpG5ub2OJHk=; b=LGl25kNZqHjBUORurPzGOY6Eji6m1DHwSlfaDNXo1dpulnrWDzTe++c1nPRow6o2p3 glB8OerSKYHPtVN+t/Y5YlKIHl/9a9XMq+dgONQla/5AWmnk5EV08VCGQbIflwTOIXbN oSHvUP62kqULc/oV7/yu1qF9+TLrHRbxCXQkpKkPwyAg1uxenCfW+ZlrDLeRYXZ/BQun gzN/tmXU/TOWrherI1d6PxiQk9NGU/QiarWLjx2iRtVnZq5hzbPqKbAKvVMjWXHtIpcn 7iASB3HHhEgwdEgU3WlSQJTG8N2Mrp++XoptJl8bCaF+d60kxOuH4qUUBPhlby0iu3MF Cjow== X-Gm-Message-State: AOAM532JdkHiXiNEuMHI5yxFpTfBpkCoNDM5XKvnnOKLMwsexQ8i+AEg uEx8vSkGhbCuTh5wuk1FBLQnDo+wWJo= X-Google-Smtp-Source: ABdhPJz/j7AnQVPkNfWnlxPyZBz5ITWoO6U2bBx+6+JZMWi8y1ZoDmE4l6z7g9WKHWWnom6z6VtlwA== X-Received: by 2002:a1c:2c3:: with SMTP id 186mr11197754wmc.14.1633218211603; Sat, 02 Oct 2021 16:43:31 -0700 (PDT) Received: from localhost.localdomain (dynamic-2a01-0c22-7bbe-df00-f22f-74ff-fe21-0725.c22.pool.telefonica.de. [2a01:c22:7bbe:df00:f22f:74ff:fe21:725]) by smtp.googlemail.com with ESMTPSA id z6sm13999463wmp.1.2021.10.02.16.43.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 02 Oct 2021 16:43:31 -0700 (PDT) From: Martin Blumenstingl To: jbrunet@baylibre.com, alsa-devel@alsa-project.org, linux-amlogic@lists.infradead.org Cc: lgirdwood@gmail.com, broonie@kernel.org, perex@perex.cz, tiwai@suse.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Martin Blumenstingl Subject: [RFC PATCH v1 0/1] ASoC: meson: aiu: HDMI codec control questions and issues Date: Sun, 3 Oct 2021 01:43:12 +0200 Message-Id: <20211002234313.3209294-1-martin.blumenstingl@googlemail.com> X-Mailer: git-send-email 2.33.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello Jerome et al., on Amlogic Meson SoCs which use the AIU audio controller we have the so-called "machine gun noise" (MGN) issue, reproducible for example in Kodi. So far nobody was able to identify the cause of this issue. My idea was to at least narrow down the issue so we can categorize it. For that I wanted to get the SPDIF output from AIU to the HDMI controller working. On Amlogic Meson GXBB/GXL/GXM SoCs a DesignWare HDMI TX controller is used. This has an SPDIF input but there's currently not driver for it. On Meson8/8b/8m2 SoCs I am working on a HDMI driver for the TransSwitch HDMI controller which - just like DesignWare HDMI TX - supports SPDIF and I2S inputs. I decided to add SPDIF support to the latter since the code from the vendor driver is much easier. It took me a while to figure out why I would not get any audio output from AIU SPDIF to the HDMI controller - or from there to the sink. The "fix" for this issue is the RFC patch which is part of this series. Any feedback would be great as I am still new to the ASoC subsystem. Another part I am still struggling with is the audio "routing" (due to lack of a better term - please correct me if this is not the right word to use for this case). I have the following description in my .dts: sound { compatible = "amlogic,gx-sound-card"; model = "M8B-ODROID-C1"; assigned-clocks = <&clkc CLKID_MPLL0>, <&clkc CLKID_MPLL1>; assigned-clock-rates = <294912000>, <270950400>; dai-link-0 { sound-dai = <&aiu AIU_CPU CPU_I2S_FIFO>; }; dai-link-1 { sound-dai = <&aiu AIU_CPU CPU_SPDIF_FIFO>; }; dai-link-2 { sound-dai = <&aiu AIU_CPU CPU_I2S_ENCODER>; dai-format = "i2s"; mclk-fs = <256>; codec-0 { sound-dai = <&aiu AIU_HDMI CTRL_I2S>; }; }; dai-link-3 { sound-dai = <&aiu AIU_CPU CPU_SPDIF_ENCODER>; codec-0 { sound-dai = <&aiu AIU_HDMI CTRL_PCM>; }; }; dai-link-4 { sound-dai = <&aiu AIU_HDMI CTRL_OUT>; codec-0 { sound-dai = <&hdmi_tx>; }; }; }; The driver for &hdmi_tx defines: struct hdmi_codec_pdata pdata = { .ops = &txc_48352_hdmi_codec_ops, .i2s = 1, .spdif = 1, .max_i2s_channels = 8, .data = priv, }; In hdmi_codec_ops.hw_params I always get fmt->fmt HDMI_I2S unless I remove all I2S references from the .dts snipped above (only then HDMI_SPDIF is detected). Based on the selection of the "HDMI Source" enum in aiu-codec-ctrl I was expecting the format to update as well. That unfortunately doesn't happen and I don't know how that can be achieved. Best regards, Martin Martin Blumenstingl (1): ASoC: meson: aiu: Fix HDMI codec control selection sound/soc/meson/aiu-codec-ctrl.c | 108 ++++++++++++++++++++++-------- sound/soc/meson/aiu-encoder-i2s.c | 6 -- 2 files changed, 80 insertions(+), 34 deletions(-) -- 2.33.0 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 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E0620C433EF for ; Sat, 2 Oct 2021 23:43:47 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 9BFEC619E9 for ; Sat, 2 Oct 2021 23:43:47 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 9BFEC619E9 Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=googlemail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=t8QUXbflIlm/rg9537mLoM5jWDhHpVvexPMpqZSrIpI=; b=JfNAzKgV2aGcnn kbh6BPZOJCIgfWv2g7/wbT4htyMjML+Bo498aYYlQ9cBF894WtcpURz5S4PAMVNbgXHkLyWIjiCVD /I6bHto1NnCneD1K9j27bEiW5E4aPmH8oJicWfaDeXiFDuQK5GEiETtQCJG4anPMrD0PwvEw7GvTh cv1sIxKNPfcF2vtYcR0htysyq60jf8MtjBvrCNWU4/REK6F6TAwJntRIQ1LGD+llzTGqTWt+cSdUN KL55laGcZKr5gXChMokP1C4863DF4cTt2kWN6UsKbkFkZ0dNd3NOU4nb7c5ljCS58tG6YDAkk0UaS QbWVNpLlquIItkVlafbg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mWofJ-002u5X-IW; Sat, 02 Oct 2021 23:43:37 +0000 Received: from mail-wm1-x331.google.com ([2a00:1450:4864:20::331]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mWofG-002u4D-JA; Sat, 02 Oct 2021 23:43:36 +0000 Received: by mail-wm1-x331.google.com with SMTP id t16-20020a1c7710000000b003049690d882so14656582wmi.5; Sat, 02 Oct 2021 16:43:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=/T6wA479aMjXiGVQMPU8TC7VB5tEcMArPpG5ub2OJHk=; b=EUhZfVpGDD6qg834LaUvUxb9ZhDqAco06iXtwjwHY0t+P8zjiqQea4m2vej+OHxL/l Y9mM1kUwszAQ25fM1xo1dLgXBC/nFzrAFFqUEvI/5eVVKy5RL8SSeenVB5i7Nv6dYGl9 BZFV9xkLNKKFml88jtYV9xgbx0khTQug76YELXAQeCyWcQHfeaU1f4scvMlhAGKsj3b3 C+Q+XSD1TRfSItSDklV22WZKxvf6Jw2radWrncD7geXukbtzwAjmq+4s9ZrXFRmbvXEU WPboa8oE9uQd9eDA39TWhg9PjdTjpW3EGvdA56dQFQ6vdJpr+EUtgqBoVvgxImd/mWDY b1vg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=/T6wA479aMjXiGVQMPU8TC7VB5tEcMArPpG5ub2OJHk=; b=uLg6bXUNoo6T0Mq1vg/1v1rbM4bUNOsj+PXyNQB2g17pyWkoSzVvIDU3Kvd3j/NjH3 IEmVR7OmpWMvTUYHqLygHXla4JoZJWRavXpHt2tB8pJmP9glxXeok0i6+6UaaZAd/HAw dHHxGNXIp5+Hq3nkRHrWtz0pYgDT4P67uqYMc36Z/YfpzRgBtM74v0ugubeINPlxL0QP EzE+BhtjZEJKnYCEZbqaHix+XUd0DrefxGggr+y5aUCUgpSgUwtYDM1CRtd4eXzqIXqt LneWv+au3W5nXv11qb/zx2G06QKdnz8EOsXcZ1mROQ2Bon6gzqlLAE/Gaacp4RzwbXuD Cz2w== X-Gm-Message-State: AOAM531yRmxki21/jF7IxyMFqJbnLmC+RwGtsMjePC+l7+JsCH2dWbpc 3fpuJLcUt+woBbiJ7CSbu4Q= X-Google-Smtp-Source: ABdhPJz/j7AnQVPkNfWnlxPyZBz5ITWoO6U2bBx+6+JZMWi8y1ZoDmE4l6z7g9WKHWWnom6z6VtlwA== X-Received: by 2002:a1c:2c3:: with SMTP id 186mr11197754wmc.14.1633218211603; Sat, 02 Oct 2021 16:43:31 -0700 (PDT) Received: from localhost.localdomain (dynamic-2a01-0c22-7bbe-df00-f22f-74ff-fe21-0725.c22.pool.telefonica.de. [2a01:c22:7bbe:df00:f22f:74ff:fe21:725]) by smtp.googlemail.com with ESMTPSA id z6sm13999463wmp.1.2021.10.02.16.43.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 02 Oct 2021 16:43:31 -0700 (PDT) From: Martin Blumenstingl To: jbrunet@baylibre.com, alsa-devel@alsa-project.org, linux-amlogic@lists.infradead.org Cc: lgirdwood@gmail.com, broonie@kernel.org, perex@perex.cz, tiwai@suse.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Martin Blumenstingl Subject: [RFC PATCH v1 0/1] ASoC: meson: aiu: HDMI codec control questions and issues Date: Sun, 3 Oct 2021 01:43:12 +0200 Message-Id: <20211002234313.3209294-1-martin.blumenstingl@googlemail.com> X-Mailer: git-send-email 2.33.0 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211002_164334_676993_BF2AD7BA X-CRM114-Status: GOOD ( 17.75 ) X-BeenThere: linux-amlogic@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-amlogic" Errors-To: linux-amlogic-bounces+linux-amlogic=archiver.kernel.org@lists.infradead.org Hello Jerome et al., on Amlogic Meson SoCs which use the AIU audio controller we have the so-called "machine gun noise" (MGN) issue, reproducible for example in Kodi. So far nobody was able to identify the cause of this issue. My idea was to at least narrow down the issue so we can categorize it. For that I wanted to get the SPDIF output from AIU to the HDMI controller working. On Amlogic Meson GXBB/GXL/GXM SoCs a DesignWare HDMI TX controller is used. This has an SPDIF input but there's currently not driver for it. On Meson8/8b/8m2 SoCs I am working on a HDMI driver for the TransSwitch HDMI controller which - just like DesignWare HDMI TX - supports SPDIF and I2S inputs. I decided to add SPDIF support to the latter since the code from the vendor driver is much easier. It took me a while to figure out why I would not get any audio output from AIU SPDIF to the HDMI controller - or from there to the sink. The "fix" for this issue is the RFC patch which is part of this series. Any feedback would be great as I am still new to the ASoC subsystem. Another part I am still struggling with is the audio "routing" (due to lack of a better term - please correct me if this is not the right word to use for this case). I have the following description in my .dts: sound { compatible = "amlogic,gx-sound-card"; model = "M8B-ODROID-C1"; assigned-clocks = <&clkc CLKID_MPLL0>, <&clkc CLKID_MPLL1>; assigned-clock-rates = <294912000>, <270950400>; dai-link-0 { sound-dai = <&aiu AIU_CPU CPU_I2S_FIFO>; }; dai-link-1 { sound-dai = <&aiu AIU_CPU CPU_SPDIF_FIFO>; }; dai-link-2 { sound-dai = <&aiu AIU_CPU CPU_I2S_ENCODER>; dai-format = "i2s"; mclk-fs = <256>; codec-0 { sound-dai = <&aiu AIU_HDMI CTRL_I2S>; }; }; dai-link-3 { sound-dai = <&aiu AIU_CPU CPU_SPDIF_ENCODER>; codec-0 { sound-dai = <&aiu AIU_HDMI CTRL_PCM>; }; }; dai-link-4 { sound-dai = <&aiu AIU_HDMI CTRL_OUT>; codec-0 { sound-dai = <&hdmi_tx>; }; }; }; The driver for &hdmi_tx defines: struct hdmi_codec_pdata pdata = { .ops = &txc_48352_hdmi_codec_ops, .i2s = 1, .spdif = 1, .max_i2s_channels = 8, .data = priv, }; In hdmi_codec_ops.hw_params I always get fmt->fmt HDMI_I2S unless I remove all I2S references from the .dts snipped above (only then HDMI_SPDIF is detected). Based on the selection of the "HDMI Source" enum in aiu-codec-ctrl I was expecting the format to update as well. That unfortunately doesn't happen and I don't know how that can be achieved. Best regards, Martin Martin Blumenstingl (1): ASoC: meson: aiu: Fix HDMI codec control selection sound/soc/meson/aiu-codec-ctrl.c | 108 ++++++++++++++++++++++-------- sound/soc/meson/aiu-encoder-i2s.c | 6 -- 2 files changed, 80 insertions(+), 34 deletions(-) -- 2.33.0 _______________________________________________ linux-amlogic mailing list linux-amlogic@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-amlogic 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 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6E7FEC433F5 for ; Sat, 2 Oct 2021 23:44:36 +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 3D6A461A03 for ; Sat, 2 Oct 2021 23:44:35 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 3D6A461A03 Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=googlemail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=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 EE139167E; Sun, 3 Oct 2021 01:43:42 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz EE139167E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1633218273; bh=HTEzdK/e45eupM2F8gIo4bbfkKXNqjI5cWKrVCsxyfw=; h=From:To:Subject:Date:Cc:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From; b=V/y7KIcom59A1nyjGU2KBmd1l6wwnHb4zvUeG1ZUpTlkhs0PSsxRwOkgIdxd/6S5u eLNeGr4iV9HdtA0X6eI+wq6CZLPWeYZqNLcbtdQWPr81dlZIWVR4yUZPV4KriOezO9 APou0C3z5vndaR2kIzQZpElpHpN48nPlQwx4+eFY= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 35718F804BC; Sun, 3 Oct 2021 01:43:42 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 41E43F804C1; Sun, 3 Oct 2021 01:43:40 +0200 (CEST) Received: from mail-wm1-x336.google.com (mail-wm1-x336.google.com [IPv6:2a00:1450:4864:20::336]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 09626F800D8 for ; Sun, 3 Oct 2021 01:43:33 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 09626F800D8 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=googlemail.com header.i=@googlemail.com header.b="EUhZfVpG" Received: by mail-wm1-x336.google.com with SMTP id b136-20020a1c808e000000b0030d60716239so963839wmd.4 for ; Sat, 02 Oct 2021 16:43:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=/T6wA479aMjXiGVQMPU8TC7VB5tEcMArPpG5ub2OJHk=; b=EUhZfVpGDD6qg834LaUvUxb9ZhDqAco06iXtwjwHY0t+P8zjiqQea4m2vej+OHxL/l Y9mM1kUwszAQ25fM1xo1dLgXBC/nFzrAFFqUEvI/5eVVKy5RL8SSeenVB5i7Nv6dYGl9 BZFV9xkLNKKFml88jtYV9xgbx0khTQug76YELXAQeCyWcQHfeaU1f4scvMlhAGKsj3b3 C+Q+XSD1TRfSItSDklV22WZKxvf6Jw2radWrncD7geXukbtzwAjmq+4s9ZrXFRmbvXEU WPboa8oE9uQd9eDA39TWhg9PjdTjpW3EGvdA56dQFQ6vdJpr+EUtgqBoVvgxImd/mWDY b1vg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=/T6wA479aMjXiGVQMPU8TC7VB5tEcMArPpG5ub2OJHk=; b=FIlGFtI9EjX2tsPxTA0i/1Z5PGil3/oaKLP9lT0v62wfcQE6F3SFR+bnov3jWMxVVH Iz3JuxF7JWlPHewfWeJT4ZpjZDeOjGCEJBmxqxXrTneLxo+n+Sl1NWFcj3PGxNddUZ+A sBNpLifyqVldqmManPWvrInTWNd6XRlEXKxkt1TMHuzlUQcKygoBvlC4bJ3pNf3lUUcS 1IIKMOS8H+cdOE13T9iqRc66Nb25ryzfA77KJIddhyMdtlaPwahO83ytjX5+A3jYtpkE YFJ+c2gfQf4ogiJOwGCMtMMuhrORbFvaqwaExFY9DnrRG2XDrncbVKDf3hDGS+EVUJjs zsHQ== X-Gm-Message-State: AOAM533ogTCkBuqjIyo/SR2/6Mj8R/sV6zaRtOXV+UE/uSWoOiDkFy7J /i34WrPzDwRV4rDzAQCHhtU= X-Google-Smtp-Source: ABdhPJz/j7AnQVPkNfWnlxPyZBz5ITWoO6U2bBx+6+JZMWi8y1ZoDmE4l6z7g9WKHWWnom6z6VtlwA== X-Received: by 2002:a1c:2c3:: with SMTP id 186mr11197754wmc.14.1633218211603; Sat, 02 Oct 2021 16:43:31 -0700 (PDT) Received: from localhost.localdomain (dynamic-2a01-0c22-7bbe-df00-f22f-74ff-fe21-0725.c22.pool.telefonica.de. [2a01:c22:7bbe:df00:f22f:74ff:fe21:725]) by smtp.googlemail.com with ESMTPSA id z6sm13999463wmp.1.2021.10.02.16.43.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 02 Oct 2021 16:43:31 -0700 (PDT) From: Martin Blumenstingl To: jbrunet@baylibre.com, alsa-devel@alsa-project.org, linux-amlogic@lists.infradead.org Subject: [RFC PATCH v1 0/1] ASoC: meson: aiu: HDMI codec control questions and issues Date: Sun, 3 Oct 2021 01:43:12 +0200 Message-Id: <20211002234313.3209294-1-martin.blumenstingl@googlemail.com> X-Mailer: git-send-email 2.33.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Cc: lgirdwood@gmail.com, Martin Blumenstingl , linux-kernel@vger.kernel.org, tiwai@suse.com, broonie@kernel.org, linux-arm-kernel@lists.infradead.org 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: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" Hello Jerome et al., on Amlogic Meson SoCs which use the AIU audio controller we have the so-called "machine gun noise" (MGN) issue, reproducible for example in Kodi. So far nobody was able to identify the cause of this issue. My idea was to at least narrow down the issue so we can categorize it. For that I wanted to get the SPDIF output from AIU to the HDMI controller working. On Amlogic Meson GXBB/GXL/GXM SoCs a DesignWare HDMI TX controller is used. This has an SPDIF input but there's currently not driver for it. On Meson8/8b/8m2 SoCs I am working on a HDMI driver for the TransSwitch HDMI controller which - just like DesignWare HDMI TX - supports SPDIF and I2S inputs. I decided to add SPDIF support to the latter since the code from the vendor driver is much easier. It took me a while to figure out why I would not get any audio output from AIU SPDIF to the HDMI controller - or from there to the sink. The "fix" for this issue is the RFC patch which is part of this series. Any feedback would be great as I am still new to the ASoC subsystem. Another part I am still struggling with is the audio "routing" (due to lack of a better term - please correct me if this is not the right word to use for this case). I have the following description in my .dts: sound { compatible = "amlogic,gx-sound-card"; model = "M8B-ODROID-C1"; assigned-clocks = <&clkc CLKID_MPLL0>, <&clkc CLKID_MPLL1>; assigned-clock-rates = <294912000>, <270950400>; dai-link-0 { sound-dai = <&aiu AIU_CPU CPU_I2S_FIFO>; }; dai-link-1 { sound-dai = <&aiu AIU_CPU CPU_SPDIF_FIFO>; }; dai-link-2 { sound-dai = <&aiu AIU_CPU CPU_I2S_ENCODER>; dai-format = "i2s"; mclk-fs = <256>; codec-0 { sound-dai = <&aiu AIU_HDMI CTRL_I2S>; }; }; dai-link-3 { sound-dai = <&aiu AIU_CPU CPU_SPDIF_ENCODER>; codec-0 { sound-dai = <&aiu AIU_HDMI CTRL_PCM>; }; }; dai-link-4 { sound-dai = <&aiu AIU_HDMI CTRL_OUT>; codec-0 { sound-dai = <&hdmi_tx>; }; }; }; The driver for &hdmi_tx defines: struct hdmi_codec_pdata pdata = { .ops = &txc_48352_hdmi_codec_ops, .i2s = 1, .spdif = 1, .max_i2s_channels = 8, .data = priv, }; In hdmi_codec_ops.hw_params I always get fmt->fmt HDMI_I2S unless I remove all I2S references from the .dts snipped above (only then HDMI_SPDIF is detected). Based on the selection of the "HDMI Source" enum in aiu-codec-ctrl I was expecting the format to update as well. That unfortunately doesn't happen and I don't know how that can be achieved. Best regards, Martin Martin Blumenstingl (1): ASoC: meson: aiu: Fix HDMI codec control selection sound/soc/meson/aiu-codec-ctrl.c | 108 ++++++++++++++++++++++-------- sound/soc/meson/aiu-encoder-i2s.c | 6 -- 2 files changed, 80 insertions(+), 34 deletions(-) -- 2.33.0 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 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 67F96C433EF for ; Sat, 2 Oct 2021 23:45:46 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 31ADE619E9 for ; Sat, 2 Oct 2021 23:45:46 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 31ADE619E9 Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=googlemail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=+sPLsJJT9+myq5z3DOscgPAz6Bub5xyg4pKAJdifxgI=; b=fUg5LJsVsOMJ8g G4YZaWMCJW2NtOmI7nyL9Ah8u2UvogwffvAki2mUUjBZQsvXMS+Ejr7MslFMEkO2Rf8AujwdDrKni K43+/7KBR+u5jdzxiDCyAltT+0pti+21ZTi/NcfHuMS/eSORRsbGTO6g3+9Qo1sa6IaiSxppVoxUU YmkjPPZt1GkrQ+0ck9CI0jhuNn0ehIrZPLgi0c9TrNba82rV0uQEEeDYO8skT3wmUsfgpJ/P6mUQV hZCNgKJumQ2fUjvxtXZrCLfc+BpsXAcEsghEyBVMEJdoDwKqhngYQT5dCN28H9UjGGBrIdl8pt9Mz r7Mbe2CL9XZeYX4ArsSg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mWofL-002u5w-8R; Sat, 02 Oct 2021 23:43:39 +0000 Received: from mail-wm1-x331.google.com ([2a00:1450:4864:20::331]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mWofG-002u4D-JA; Sat, 02 Oct 2021 23:43:36 +0000 Received: by mail-wm1-x331.google.com with SMTP id t16-20020a1c7710000000b003049690d882so14656582wmi.5; Sat, 02 Oct 2021 16:43:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=/T6wA479aMjXiGVQMPU8TC7VB5tEcMArPpG5ub2OJHk=; b=EUhZfVpGDD6qg834LaUvUxb9ZhDqAco06iXtwjwHY0t+P8zjiqQea4m2vej+OHxL/l Y9mM1kUwszAQ25fM1xo1dLgXBC/nFzrAFFqUEvI/5eVVKy5RL8SSeenVB5i7Nv6dYGl9 BZFV9xkLNKKFml88jtYV9xgbx0khTQug76YELXAQeCyWcQHfeaU1f4scvMlhAGKsj3b3 C+Q+XSD1TRfSItSDklV22WZKxvf6Jw2radWrncD7geXukbtzwAjmq+4s9ZrXFRmbvXEU WPboa8oE9uQd9eDA39TWhg9PjdTjpW3EGvdA56dQFQ6vdJpr+EUtgqBoVvgxImd/mWDY b1vg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=/T6wA479aMjXiGVQMPU8TC7VB5tEcMArPpG5ub2OJHk=; b=uLg6bXUNoo6T0Mq1vg/1v1rbM4bUNOsj+PXyNQB2g17pyWkoSzVvIDU3Kvd3j/NjH3 IEmVR7OmpWMvTUYHqLygHXla4JoZJWRavXpHt2tB8pJmP9glxXeok0i6+6UaaZAd/HAw dHHxGNXIp5+Hq3nkRHrWtz0pYgDT4P67uqYMc36Z/YfpzRgBtM74v0ugubeINPlxL0QP EzE+BhtjZEJKnYCEZbqaHix+XUd0DrefxGggr+y5aUCUgpSgUwtYDM1CRtd4eXzqIXqt LneWv+au3W5nXv11qb/zx2G06QKdnz8EOsXcZ1mROQ2Bon6gzqlLAE/Gaacp4RzwbXuD Cz2w== X-Gm-Message-State: AOAM531yRmxki21/jF7IxyMFqJbnLmC+RwGtsMjePC+l7+JsCH2dWbpc 3fpuJLcUt+woBbiJ7CSbu4Q= X-Google-Smtp-Source: ABdhPJz/j7AnQVPkNfWnlxPyZBz5ITWoO6U2bBx+6+JZMWi8y1ZoDmE4l6z7g9WKHWWnom6z6VtlwA== X-Received: by 2002:a1c:2c3:: with SMTP id 186mr11197754wmc.14.1633218211603; Sat, 02 Oct 2021 16:43:31 -0700 (PDT) Received: from localhost.localdomain (dynamic-2a01-0c22-7bbe-df00-f22f-74ff-fe21-0725.c22.pool.telefonica.de. [2a01:c22:7bbe:df00:f22f:74ff:fe21:725]) by smtp.googlemail.com with ESMTPSA id z6sm13999463wmp.1.2021.10.02.16.43.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 02 Oct 2021 16:43:31 -0700 (PDT) From: Martin Blumenstingl To: jbrunet@baylibre.com, alsa-devel@alsa-project.org, linux-amlogic@lists.infradead.org Cc: lgirdwood@gmail.com, broonie@kernel.org, perex@perex.cz, tiwai@suse.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Martin Blumenstingl Subject: [RFC PATCH v1 0/1] ASoC: meson: aiu: HDMI codec control questions and issues Date: Sun, 3 Oct 2021 01:43:12 +0200 Message-Id: <20211002234313.3209294-1-martin.blumenstingl@googlemail.com> X-Mailer: git-send-email 2.33.0 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211002_164334_676993_BF2AD7BA X-CRM114-Status: GOOD ( 17.75 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hello Jerome et al., on Amlogic Meson SoCs which use the AIU audio controller we have the so-called "machine gun noise" (MGN) issue, reproducible for example in Kodi. So far nobody was able to identify the cause of this issue. My idea was to at least narrow down the issue so we can categorize it. For that I wanted to get the SPDIF output from AIU to the HDMI controller working. On Amlogic Meson GXBB/GXL/GXM SoCs a DesignWare HDMI TX controller is used. This has an SPDIF input but there's currently not driver for it. On Meson8/8b/8m2 SoCs I am working on a HDMI driver for the TransSwitch HDMI controller which - just like DesignWare HDMI TX - supports SPDIF and I2S inputs. I decided to add SPDIF support to the latter since the code from the vendor driver is much easier. It took me a while to figure out why I would not get any audio output from AIU SPDIF to the HDMI controller - or from there to the sink. The "fix" for this issue is the RFC patch which is part of this series. Any feedback would be great as I am still new to the ASoC subsystem. Another part I am still struggling with is the audio "routing" (due to lack of a better term - please correct me if this is not the right word to use for this case). I have the following description in my .dts: sound { compatible = "amlogic,gx-sound-card"; model = "M8B-ODROID-C1"; assigned-clocks = <&clkc CLKID_MPLL0>, <&clkc CLKID_MPLL1>; assigned-clock-rates = <294912000>, <270950400>; dai-link-0 { sound-dai = <&aiu AIU_CPU CPU_I2S_FIFO>; }; dai-link-1 { sound-dai = <&aiu AIU_CPU CPU_SPDIF_FIFO>; }; dai-link-2 { sound-dai = <&aiu AIU_CPU CPU_I2S_ENCODER>; dai-format = "i2s"; mclk-fs = <256>; codec-0 { sound-dai = <&aiu AIU_HDMI CTRL_I2S>; }; }; dai-link-3 { sound-dai = <&aiu AIU_CPU CPU_SPDIF_ENCODER>; codec-0 { sound-dai = <&aiu AIU_HDMI CTRL_PCM>; }; }; dai-link-4 { sound-dai = <&aiu AIU_HDMI CTRL_OUT>; codec-0 { sound-dai = <&hdmi_tx>; }; }; }; The driver for &hdmi_tx defines: struct hdmi_codec_pdata pdata = { .ops = &txc_48352_hdmi_codec_ops, .i2s = 1, .spdif = 1, .max_i2s_channels = 8, .data = priv, }; In hdmi_codec_ops.hw_params I always get fmt->fmt HDMI_I2S unless I remove all I2S references from the .dts snipped above (only then HDMI_SPDIF is detected). Based on the selection of the "HDMI Source" enum in aiu-codec-ctrl I was expecting the format to update as well. That unfortunately doesn't happen and I don't know how that can be achieved. Best regards, Martin Martin Blumenstingl (1): ASoC: meson: aiu: Fix HDMI codec control selection sound/soc/meson/aiu-codec-ctrl.c | 108 ++++++++++++++++++++++-------- sound/soc/meson/aiu-encoder-i2s.c | 6 -- 2 files changed, 80 insertions(+), 34 deletions(-) -- 2.33.0 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel