[PATCH v2] ASoC: meson: aiu-formatter-i2s: remove pipeline reset from prepare
Valerio Setti <[email protected]>
| Newsgroups | org.infradead.lists.linux-amlogic,org.infradead.lists.linux-arm-kernel,org.kernel.vger.linux-kernel,org.kernel.vger.linux-sound |
|---|---|
| Message-ID | <[email protected]> |
'aiu-fifo-i2s' (DAI FE) already resets the I2S pipeline in 'aiu_fifo_i2s_trigger' for all relevant trigger scenarios, right before starting the FIFO. Since the DAI triggering order is the default one (FE before BE), the reset performed in 'aiu_formatter_i2s_prepare' happens after the FIFO has already been reset and started, which corrupts playback in 24-bit mode. Remove the duplicated reset from the formatter. Signed-off-by: Valerio Setti <[email protected]> --- A patch series has recently been merged in c7852d2dcf66 ("ASoC: meson: aiu: align I2S design to the AXG one") which unfortunately introduces a bug in 24 bit mode playback which this new series resolves. Among other things the previous series moved the content of what was once called 'aiu_encoder_i2s_setup_desc' from 'aiu-encoder-i2s' to 'aiu-formatter-i2s'. 'aiu_encoder_i2s_setup_desc' was basically accomplishing two tasks: - reset the i2s pipeline. - configure number of channels and physical samples width. Before being moved 'aiu_encoder_i2s_setup_desc' was called in the encoder DAI 'hw_params()', whereas after the move it is called at trigger time ('aiu_encoder_i2s_trigger'->'gx_stream_start' -> 'gx_formatter_enable' -> 'aiu_formatter_i2s_prepare'). In parallel 'aiu-fifo-i2s' (DAI FE) already performs the very same reset of the pipeline at trigger time in 'aiu_fifo_i2s_trigger' and then it triggers the playback. Since the DAI triggering order is the default one (FE before BE) this means that the pipeline reset in BE happens when the FE already did it and started the playback. This causes the 24-bit playback mode to be corrupted. This series removes pipeline reset from 'aiu_formatter_i2s_prepare' because the very same operation is done by 'aiu-fifo-i2s' on trigger. This series depends on c7852d2dcf66 ("ASoC: meson: aiu: align I2S design to the AXG one") which exists in 'broonie/sound.git#for-7.3', but which has not been mainlined yet. Apologies for the inconvenience. --- Changes in v2: - Dropped the first commit of the series because, as found by Sashiko, it could lead to other playback issues in case the sample width was changed without closing the PCM stream (i.e. play->stop->reconfigure->play). - Link to v1: https://patch.msgid.link/[email protected] To: Jerome Brunet <[email protected]> To: Liam Girdwood <[email protected]> To: Mark Brown <[email protected]> To: Jaroslav Kysela <[email protected]> To: Takashi Iwai <[email protected]> To: Neil Armstrong <[email protected]> To: Kevin Hilman <[email protected]> To: Martin Blumenstingl <[email protected]> Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] --- sound/soc/meson/aiu-formatter-i2s.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/sound/soc/meson/aiu-formatter-i2s.c b/sound/soc/meson/aiu-formatter-i2s.c index b4604734fe88..cb554c2e7ce4 100644 --- a/sound/soc/meson/aiu-formatter-i2s.c +++ b/sound/soc/meson/aiu-formatter-i2s.c @@ -13,7 +13,6 @@ #define AIU_I2S_SOURCE_DESC_MODE_8CH BIT(0) #define AIU_I2S_SOURCE_DESC_MODE_24BIT BIT(5) #define AIU_I2S_SOURCE_DESC_MODE_32BIT BIT(9) -#define AIU_RST_SOFT_I2S_FAST BIT(0) #define AIU_I2S_DAC_CFG_MSB_FIRST BIT(2) @@ -55,11 +54,11 @@ static int aiu_formatter_i2s_prepare(struct regmap *map, { /* Always operate in split (classic interleaved) mode */ unsigned int desc = 0; - unsigned int tmp; - /* Reset required to update the pipeline */ - regmap_write(map, AIU_RST_SOFT, AIU_RST_SOFT_I2S_FAST); - regmap_read(map, AIU_I2S_SYNC, &tmp); + /* + * Pipeline reset is already implemented in aiu_fifo_i2s_trigger() at + * trigger time. + */ switch (ts->physical_width) { case 16: /* Nothing to do */ --- base-commit: bff7fad1010eea6f183fb110b54171cf8700ef8e change-id: 20260702-fix-24-bit-i2s-playback-6444174c7cd7 Best regards, -- Valerio Setti <[email protected]> _______________________________________________ linux-amlogic mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-amlogic