From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wr1-f52.google.com (mail-wr1-f52.google.com [209.85.221.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C75F928FFF6 for ; Wed, 10 Jun 2026 13:27:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.52 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781098075; cv=none; b=krY+1TtdxWoVKhWN3hAcqQi1JdFM1APiPXjGe2XYGSNoWAFWrrcNhRbJf/OomQjQT06AYo8yCTr1/v7R9tOP6iZkKMFavzMSm+UQKlRF/Rgg10YkBrEeCoOdvVRFXEony7pXotH6akQ3z4IvnmIhcNJSiOdVy5w0k+dSW2HzWtk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781098075; c=relaxed/simple; bh=w6qUDwgiUTdJg+8WZOlXabbkRvKEFVx+rr1JfxifkpU=; h=From:To:Cc:Subject:In-Reply-To:References:Date:Message-ID: MIME-Version:Content-Type; b=LpoQtkygomGNsluAj+bLV1coTDYvHc+1Q93HHmWR2yR4ZU9sQkq0FHXEc62qQcN8fhjdzTRnGYPvAHu4uWqq7caFhsphSP92rSHZ/OxIIKNXMj6hK9xB8MoDgNtPI3FzwO6qb0l5YnsvjOmsUHEnWU4af/nfuir7Y4wzKYehS7Q= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com; spf=pass smtp.mailfrom=baylibre.com; dkim=pass (2048-bit key) header.d=baylibre.com header.i=@baylibre.com header.b=iEAKdSFJ; arc=none smtp.client-ip=209.85.221.52 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=baylibre.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=baylibre.com header.i=@baylibre.com header.b="iEAKdSFJ" Received: by mail-wr1-f52.google.com with SMTP id ffacd0b85a97d-45ee5cdbd28so4590321f8f.1 for ; Wed, 10 Jun 2026 06:27:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre.com; s=google; t=1781098071; x=1781702871; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:user-agent :references:in-reply-to:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=8Dg/fQKFRKiQFhT9w/Pj60e36nurv4DmYNa63cuyXbQ=; b=iEAKdSFJsRsZz7vL4JtJjfRoHrB1TOyV9xZzkrg6qaxgm+5Zof8Uz+Hnu34XSA3Oi/ P/+zubztU1UeilSU4/L/zuyp69pJ1xodFLGDxY0bXCfgfXjmLrWGtYtPuc6hfXHXBVwi 82uA5pKtXa++iSX4X7wIcNnU+kXGMgXhfGtae0IcW23zWhWlZ/ey5HCV4UtSGyq+e9S2 lVptJpjdUpCV4NmcMopbhDsYVu1omSp3pqLOcTyZjbsdCn5YU/pEDaFPI3sKSjS2+sbh HMmsgWU2jsqAkG3agH/0P+Jm8X89KGqxVvly4nZ/g4PbCEFwzFDjI6wYxKYstAeVK2s9 U5ag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1781098071; x=1781702871; h=content-transfer-encoding:mime-version:message-id:date:user-agent :references:in-reply-to:subject:cc:to:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=8Dg/fQKFRKiQFhT9w/Pj60e36nurv4DmYNa63cuyXbQ=; b=fyTyXdJ0wBdVX42TmsMKVBQd2iJRcqYCGnf9qKwfOPzx76vX16cxeM4/lmkAJPQA3W 7NAbzztgZSf9tlaClspL9PLB9gUY1ORqFtQv4jj0RIyh6zyhk02QfoL9d7EQkwBnsAIk ZBZ7p0xfnmLqTtunwCPg3DO1tLnqYn4erEgNxKlxummYMi1ojp3k+fBqUzIb6gPUXkpZ mKpL2kojKTd1uVSTagdoUk6QHUZtwnIlJ9XuNAGXj+VhK/I7w46PC/CO3vHXu7OvGYSH Y2xZdQCpHKKhajZctXHGZoLNE22dQ/G5I9//GVG/Ay/10dDgDmlxHqwcEoE/sYQZbxpP 4jbw== X-Forwarded-Encrypted: i=1; AFNElJ8X5sHcaIykKcSuB+sHfsmgKZUC6Wio5Tv45MySULougvEKbIYHER56ju/KDoEA0IPehJNxfQ0pCAgy7rM=@vger.kernel.org X-Gm-Message-State: AOJu0YwT4Y5hhEt65ZvQaMZvXAkyL6MxAMQ9IcJWnCLx2Lt0jUO5+Jhd pR1uLh9Nf0mOqXby5TyaAv4fwOnRtgOnhwqqLBt85zzwQeMbkWUx2mQeA07HzhaDZWI= X-Gm-Gg: Acq92OGFuDXbTnf2zTw77mFgxaSVVbwF64FrKM/pjPyj2sd7W4Y2YcMBbKHIPExawJi nJ8H4FqhtVlQ19gwyx/iXkRGoMojVo4IC0Ildb/UX7LfAgjG33llKD0yjyT3ce6OQ8u70cfVlaN 6C3Mf+J9a2dOfd0iFxwmtC63MARW7RqB5GwYvNDUByBxQS6ujVa3X2ot7DEcojLYXOfUWcAJsdZ StCozfrgW9RzqgeWwBbESNxdV15om6i4tlPbkrOYdJQ4Ua7XelWuLDxZBSVd/wV15v4SN7Mlvd8 OrSCFWfhLdMO+CE793U1UahkBWYJY0oZRJKp1FGYX1aqlSxfq09ohIRYm41ujq8PIa6uiMBdEfv OyAVldVFzRFrGr1ElGG3cFFvjUBslfFUdPRXUetyPySwkaRpsN4EqyRjoxVBJveEy2jKv5jdOJL iFJo+4ddP/q7NFdftvBukn8ZbevJn2WZrb X-Received: by 2002:a05:6000:400e:b0:460:18cf:d49b with SMTP id ffacd0b85a97d-46032dabbc0mr33050153f8f.15.1781098071144; Wed, 10 Jun 2026 06:27:51 -0700 (PDT) Received: from localhost ([2a01:e0a:3c5:5fb1:c371:18ed:9599:7f5f]) by smtp.gmail.com with UTF8SMTPSA id ffacd0b85a97d-4601f2eadefsm74272179f8f.11.2026.06.10.06.27.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Jun 2026 06:27:50 -0700 (PDT) From: Jerome Brunet To: Valerio Setti Cc: Liam Girdwood , Jaroslav Kysela , Takashi Iwai , Neil Armstrong , Kevin Hilman , Martin Blumenstingl , linux-kernel@vger.kernel.org, linux-sound@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-amlogic@lists.infradead.org, Mark Brown Subject: Re: [PATCH 4/4] ASoC: meson: aiu: use aiu-formatter-i2s to format I2S output data In-Reply-To: (Valerio Setti's message of "Thu, 28 May 2026 17:01:59 +0200") References: <20260515-reshape-aiu-as-axg-v1-0-53b457784ff3@baylibre.com> <20260515-reshape-aiu-as-axg-v1-4-53b457784ff3@baylibre.com> <758a4ef9-1a3e-475a-ae1e-83523330d006@sirena.org.uk> <891be10c-99f1-45b7-bd31-ec5080cfc780@baylibre.com> User-Agent: mu4e 1.12.9; emacs 30.1 Date: Wed, 10 Jun 2026 15:27:48 +0200 Message-ID: <1jtsraed9n.fsf@starbuckisacylon.baylibre.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On jeu. 28 mai 2026 at 17:01, Valerio Setti wrote: > On 5/22/26 18:24, Valerio Setti wrote: >> On 5/22/26 01:15, Mark Brown wrote: >>> On Fri, May 15, 2026 at 05:10:40PM +0200, Valerio Setti wrote: >>>> Create a new DAPM widget for "I2S formatter" and place it on the path >>>> between FIFO and output DAI interface. Remove I2S output formatting co= de >>>> from aiu-encoder-i2s since it's now implemented from aiu-formatter-i2s. >>> >>> This series, it looks like this specific patch, is breaking pcm-test on >>> my libretech Le Potato board, the clocking looks to be seriously messed >>> up.=C2=A0 I'm getting: >>> >>> [...] >>> >>> Full log: >>> >>> =C2=A0=C2=A0=C2=A0 https://lava.sirena.org.uk/scheduler/job/2786342#L19= 34 >>> >>> The prior patches seem to test fine, it's this one that seems to >>> introduce the issue. >> Thanks a lot for the heads up and please apologize for the problem. >> I wasn't aware of these testing tools so I based my testing on playing >> with userspace alsa tools on the physical board that I have. >> I will take a look at it ASAP and send a properly tested v2. >>=20 > > Hi! > > I investigated a bit on the issue caused by my v1 patch series and I think > I've found the root cause. I suspect my patch series helped discovering a > misbehavior that was already present, so I'm seeking for suggestions on t= he > proper way to proceed. > > # First: the background > > By default on OdroidC2/LePotato boards the only available audio playback = is > through HDMI. From DAI point of view the flow is as follows: > > "I2S FIFO" -> "I2S Encoder Playback" -> "CODEC CTRL HDMI I2S IN" -> "HDMI > CTRL SRC" (mixer) -> "CODEC CTRL HDMI OUT Capture" > > In this chain the mixer "HDMI CTRL SRC" by default starts as "DISABLED" so > it should prevent "CODEC CTRL HDMI OUT Capture" from receiving data. Yes, leaving registers to their default state (even if it is not a working configuration) and relying on mixer path to be setup was done on purpose. There is not a single configuration that would work/please everyone, especially on AXG but the same could be said about the GX series. Not hardcoding any such configuration in the driver was the only sane choice, even if it may seem to weird to have pipelines that do not work by default. > > # What changed before/after the last commit of my patch series? > > - Before: "aiu-encoder-i2s.c" was calling "aiu_encoder_i2s_setup_desc()" = in > "hw_params()". Audio playback shouldn't work in this condition because = as > I mentioned "HDMI CTRL SRC"=3D"DISABLED" by default, but apparently > configuring the AIU_I2S_SOURCE_DESC register is enough to make the > playback to work properly. Nice :'( > > - After: those configurations are only set when "aiu_formatter_i2s_prepar= e" > is called which happens if "I2S Formatter" widget is enabled. Since "HD= MI > CTRL SRC"=3D"DISABLED" then "I2S Formatter" is not powered up and there= fore > its callbacks are not called and the playback fails. > > Simply issuing the following command: > $ amixer sset 'AIU HDMI CTRL SRC' 'I2S' > > resolves the problem and all pcm-tests pass. > This also explains why I didn't catch this issue before sending the v1 > series: I tested with NXP SGTL5000 codec, not the HDMI one. > > # Final question > > I have 2 alternative proposals for this: > > - Change the default value of "HDMI CTRL SRC" so that at boot it's set to > some working configuration (ex: "I2S"). This should be done somewhere in > "aiu-codec-ctrl" I think. > - Run the 'amixer' command above before running ALSA tests. > > Any suggestion on what's the best approach? As Mark suggested, let be nice on the user and poke the register on probe. Just add a big fat comment around it so it is clear why you are doing it (and why it is not something to be copied) > > Thanks a lot. --=20 Jerome