From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f45.google.com (mail-wm1-f45.google.com [209.85.128.45]) (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 1277C2C0F69 for ; Thu, 28 May 2026 15:02:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.45 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779980533; cv=none; b=QTiCQwv1F77PZq+aGJ9lzdRJCSClFQfAvua9sG0xCww5xWpM5AzoADiCgI9j49ykfpYRIQqmhYSImENB3qI94W8R0j9dAr6Vk78Y2IgFNdBxiusdcJVmSWLaswMdjNev2cjN29xx52t/Ek3Rneodv1V4JAViwO4yDOVgIoekNTY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779980533; c=relaxed/simple; bh=ulQcYVPQcAiNbTMN9AaZzT6CfpirplbnyUzjJk//kt0=; h=Message-ID:Date:MIME-Version:Subject:From:To:Cc:References: In-Reply-To:Content-Type; b=HThIQjihETFmcashAkuGGyMtM7DwiEXnG7x6pVSIMFEZAXJpIHS861O95nxa0/VWHgv4KSAOBtGVGGYSnMDWHpdSTO4b1xG5YhLHABeCq/Wv8v1B8JCcYDKgM0oaMpUEXuBRtflAyE++9qikJG9LAkhjCC6q3OCHypG48RrEeqI= 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=g+GLC6I1; arc=none smtp.client-ip=209.85.128.45 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="g+GLC6I1" Received: by mail-wm1-f45.google.com with SMTP id 5b1f17b1804b1-49048e043e5so52023475e9.1 for ; Thu, 28 May 2026 08:02:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre.com; s=google; t=1779980521; x=1780585321; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:content-language:references :cc:to:from:subject:user-agent:mime-version:date:message-id:from:to :cc:subject:date:message-id:reply-to; bh=ECS7M5UdJ33XaahEVws6tW0y/69FCVes8kzgWMXuvmQ=; b=g+GLC6I1FXvPRvuvVXKkV+1IiP9azsMqdDjzQG0QTDWa3Hz5IgrDqgKTJC9Zucp4O6 LTARgLsEHwlaCislv3vFE8quSS6r2nQsZUWsLKFBO6Qp5UoZvodU+bKg29WB7iadc4Xc /e1jsBBprsqxLRUMCAi1wAQiuhFLDIV2oY8lqRyAGfYcwUa9zCTiZEUqEdWuODVB+d/Y OcG6d1d3LMgrhLRWf0Yf5czqoAzePvij0xWPbnxrG4qwpDbIvAiDYfBAzRjOH0QAwd3F XAz6CQOz1UgfUzXZSDY0U0x6XASjd0iUKCT0gCBflXd0h0DkHqBjz0/Bw6g4zTjw+80U 5h9g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1779980521; x=1780585321; h=content-transfer-encoding:in-reply-to:content-language:references :cc:to:from:subject:user-agent:mime-version:date:message-id:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=ECS7M5UdJ33XaahEVws6tW0y/69FCVes8kzgWMXuvmQ=; b=eTF6oj81wDU/0swu5oRkIjj+195AhkWZSuh5/6J8M6wAaD6aUPLeLE77cK/GaN14s+ IBoppk6nsOpsu3nhD9QFyJIIfjP15Z9AUFZtGReMf2A2HjVmUr14khtvp/KVJp2L2aNA tK0LLF4/YaNULIxefeL9ZSHxfNVQpU+mjjTIqcI424kMdhPu3u4jP1puWdXQobwFgx6g AzLvylYbA5JvpdVel++XIZfUrKkJiGrVSWTTrEFVLo2iMiKv3e/MAMATFoTOOD0myH3i p5HPwmaA9yD2ZrA3V0hg6koroIGQcoxUXuUT3yP5ZbFNL0JM1mrRdotrMP0r1vLyp50M Tx5A== X-Forwarded-Encrypted: i=1; AFNElJ/dOxmsT4wEdiY6yw77/cg62HdcwIVy3IPjJZZutlWeK6a/bSfOhuth74MShuMXd/5UMYt4w6uGT34zNF0=@vger.kernel.org X-Gm-Message-State: AOJu0Ywbfngrc6U9pLZH7Vj8lUNTyw9+2B2TWWM8JptBmUEp+O/i2yQw eEAOV007OJ2biwHjEeCl0eHGyEndeLLY2LAuomofN6iNj9LEJTO/BSDEM1W7VnI7MsU= X-Gm-Gg: Acq92OFOyOl5/kYMtQ/zB+rbg4ZvxFu0xIF74g2Oktp+7XdkDkvqBid4W/ztJCi15VA xcqFwtsTGVI8h3S0cLsBiNhQfKSsiItLrK2aMlcN1ngoQ8XPsP/252TxDUDbdoVPKYekn95V85v XJDSCDLJssu/Ga011slKgiWRgN3EZ6vRQ2tKZ6hKM/uVmdFccnV89yjICXGhMeL/uIzneUrklmx xwxHS6iT/td76GRMOiGsTvZO29iYrx0vvr0lfwO6IcEnNO4S0HHc1TAtFx5yd1E5gGUHq5QlBhp t23rXOypjqNART2nMWwePUXRN+0xmb7jgEvxECBsOI4dyGwh/uUz8hIP8EM8KW4Gnm5C/MDDMm7 Q0Rmkld0g9K/wahlvnzBZGBbzUZCsOUEJwYYRHo/kKOlJaggil/XuEqYtEZb96ODbeziwcWcJap Rfnz62b2k1WweGhXz6dPAT8MrW+ejQGmEt/pWF X-Received: by 2002:a05:600c:3e0d:b0:490:4e3e:b483 with SMTP id 5b1f17b1804b1-4904e3eb5abmr402523195e9.22.1779980521083; Thu, 28 May 2026 08:02:01 -0700 (PDT) Received: from [192.168.3.100] ([151.41.223.93]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4909236ab3bsm53549395e9.4.2026.05.28.08.01.59 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 28 May 2026 08:02:00 -0700 (PDT) Message-ID: Date: Thu, 28 May 2026 17:01:59 +0200 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 4/4] ASoC: meson: aiu: use aiu-formatter-i2s to format I2S output data From: Valerio Setti To: Jerome Brunet 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 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> Content-Language: en-US In-Reply-To: <891be10c-99f1-45b7-bd31-ec5080cfc780@baylibre.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit 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 code >>> 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.  I'm getting: >> >> [...] >> >> Full log: >> >>     https://lava.sirena.org.uk/scheduler/job/2786342#L1934 >> >> 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. > 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 the 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. # 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"="DISABLED" by default, but apparently configuring the AIU_I2S_SOURCE_DESC register is enough to make the playback to work properly. - After: those configurations are only set when "aiu_formatter_i2s_prepare" is called which happens if "I2S Formatter" widget is enabled. Since "HDMI CTRL SRC"="DISABLED" then "I2S Formatter" is not powered up and therefore 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? Thanks a lot. -- Valerio