cancel
Showing results for 
Search instead for 
Did you mean: 

Is there any SAI PDM example for STM32MP1?

ARicc.1
Associate II

I'm looking for device tree configuration to acquire 4/6 PDM microphones resulting in an ALSA tdm stream. It's mentioned in the official documentation here(https://www.st.com/content/ccc/resource/training/technical/product_training/group0/30/7d/ca/21/db/00/4c/d2/STM32MP1-Peripheral_Serial_Audio_Interface_SAI/files/STM32MP1-Peripheral_Serial_Audio_Interface_SAI.pdf/jcr:content/translations/en.STM32MP1-Peripheral_Serial_Audio_Interface_SAI.pdf) and in AN5027 but no reference to MP1 code

6 REPLIES 6
PatrickF
ST Employee

Hello,

maybe the following wiki pages will help you:

PDM microphones could benefit to be connected to DFSDM instead of SAI (SAI requires decimation filter to be done in SW, DFSDM provides up to 6 x HW filters)

Regards.

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.
ARicc.1
Associate II

Hello Patrick,

thanks for sharing all the documentation.

Unfortunately I could not find any information (or example) about SAI PDM in the official Wiki.

As I've read in your application note(AN5027) it seems to be possible, but there are no tips on implementation on MP1. Do you have any more information about this?

Thanks,

Aldo

Although SAI HW support PDM microphones, this mode is only usable with Cortex-M4 using HAL (you might find examples on STM32H7 Cube).

SAI Linux driver does not support PDM microphones.

Under Linux, you should use DFSDM IP, which is much more powerful than SAI when using digital microphone (HW filtering) and you could connect up to 6 microphones using only 3 pins + 1 clock.

for HW example, 4 x microphones connected to DFSDM are available on STM32MP157x-EV1 board.

There is no SW example, but this is fully supported using ALSA and DFSDM driver as described in Wiki.

Regards.

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.
ARicc.1
Associate II

Hi Patrick,

thanks for the detailed info about SAI PDM.

Actually we have been through DFSDM, and we're looking for a solution to connect multiple PDM microphones (4/6) to STM32MP1 ALSA, to obtain a single multi-channel inteleaved input. The goal is to have a single card/device that records an interleaved stream of N microphones.

We have our own PCB based on STM32MP1 and we've connected 4 mics on DFSDM, but the result has been of 4 separate ALSA card/devices (following ST device tree for STM32MP157x-EV1)

Is there a way to make them interleaved at driver level? We'd like to avoid using ALSA's multi or similar.

Thanks,

Aldo

just replied off thread, sorry. Please read the post here below.

Hi @ARicc.1​ ,

I got feedback from audio team which is in line with @PatrickF​ comment :

  • Recommanded way to use PDM microphones is DFSDM
  • The way to interleave inputs is through ALSA (not possible inside kernel driver)
  • If you don't want to use ALSA to interleave inputs, it can be done inside an application running on M4, but this needs some development and it will involves a latency to forward interleaved signal from M4 to virtual Alsa sound card on A7.

BR,

Christophe

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.