Skip to content

Commit 9210f5f

Browse files
fabioestevambroonie
authored andcommitted
ASoC: fsl: imx-card: Do not force slot width to sample width
imx-card currently sets the slot width to the physical sample width for I2S links. This breaks controllers that use fixed-width slots (e.g. 32-bit FIFO words), causing the unused bits in the slot to contain undefined data when playing 16-bit streams. Do not override the slot width in the machine driver and let the CPU DAI select an appropriate default instead. This matches the behavior of simple-audio-card and avoids embedding controller-specific policy in the machine driver. On an i.MX8MP-based board using SAI as the I2S master with 32-bit slots, playing 16-bit audio resulted in spurious frequencies and an incorrect SAI data waveform, as the slot width was forced to 16 bits. After this change, audio artifacts are eliminated and the 16-bit samples correctly occupy the first half of the 32-bit slot, with the remaining bits padded with zeroes. Cc: stable@vger.kernel.org Fixes: aa73670 ("ASoC: imx-card: Add imx-card machine driver") Signed-off-by: Fabio Estevam <festevam@gmail.com> Acked-by: Shengjiu Wang <shengjiu.wang@gmail.com> Link: https://patch.msgid.link/20260118205030.1532696-1-festevam@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent 2e48020 commit 9210f5f

1 file changed

Lines changed: 0 additions & 1 deletion

File tree

sound/soc/fsl/imx-card.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,6 @@ static int imx_aif_hw_params(struct snd_pcm_substream *substream,
346346
SND_SOC_DAIFMT_PDM;
347347
} else {
348348
slots = 2;
349-
slot_width = params_physical_width(params);
350349
fmt = (rtd->dai_link->dai_fmt & ~SND_SOC_DAIFMT_FORMAT_MASK) |
351350
SND_SOC_DAIFMT_I2S;
352351
}

0 commit comments

Comments
 (0)