Re: [PATCH 4/4] ASoC: meson: aiu: use aiu-formatter-i2s to format I2S output data

From: Valerio Setti

Date: Thu May 28 2026 - 11:12:44 EST




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