Skip to main content
AJank.2
Associate II
July 5, 2023
Solved

S24_LE support on I2S of STM32MP1 line

  • July 5, 2023
  • 1 reply
  • 1978 views

Hi,

what's the state of the S24_LE format support on the STM32MP1 line of boards? It seems that S16_LE and S32_LE formats are supported on the I2S dai, however S24_LE is rather unavailable. Is there a way to somehow enable it (maybe through Cube MX) or is it completely unsupported?

When running alsa speaker-test utility with hardware devices (not default) the S24_LE format is being rejected.

Thanks!

This topic has been closed for replies.
Best answer by Erwan SZYMANSKI

Hello @AJank.2 ,
Indeed, the I2S driver does not support S24_LE format but only S16_LE and S32_LE. This is due to what DMA transfer can also support, and in our case, this is 16 and 32 bits. So there is no link with cubeMX.

If you want to check it by yourself, you can see in stm32_i2s.c driver what is supported:

static void stm32_i2s_dai_init(struct snd_soc_pcm_stream *stream,
			 char *stream_name)
{
	stream->stream_name = stream_name;
	stream->channels_min = 1;
	stream->channels_max = 2;
	stream->rates = SNDRV_PCM_RATE_8000_192000;
	stream->formats = SNDRV_PCM_FMTBIT_S16_LE |
				 SNDRV_PCM_FMTBIT_S32_LE;
}

I hope it answers your question.
Kind regards,
Erwan.

1 reply

Erwan SZYMANSKI
Erwan SZYMANSKIBest answer
Technical Moderator
July 6, 2023

Hello @AJank.2 ,
Indeed, the I2S driver does not support S24_LE format but only S16_LE and S32_LE. This is due to what DMA transfer can also support, and in our case, this is 16 and 32 bits. So there is no link with cubeMX.

If you want to check it by yourself, you can see in stm32_i2s.c driver what is supported:

static void stm32_i2s_dai_init(struct snd_soc_pcm_stream *stream,
			 char *stream_name)
{
	stream->stream_name = stream_name;
	stream->channels_min = 1;
	stream->channels_max = 2;
	stream->rates = SNDRV_PCM_RATE_8000_192000;
	stream->formats = SNDRV_PCM_FMTBIT_S16_LE |
				 SNDRV_PCM_FMTBIT_S32_LE;
}

I hope it answers your question.
Kind regards,
Erwan.

In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.
AJank.2
AJank.2Author
Associate II
July 17, 2023

Thank you!