2026-04-13 5:57 AM
Looking to add a 4 mic pdm array setup to livetune environment. Had questions on how deep into the environment we need to go for the changes. Is it just a matter of changing the # of channels for the sysIn, # of slots and active slots on the pdm interface? or do we need to drive deep as address the audio buffer as well. At one point I thought I read the audio buffer was allocated dynamically. We are just looking for a little guidance before we start changing things as there might be a simple way to achieve our goal vs us guessing and creating issues.
Solved! Go to Solution.
2026-04-13 7:32 AM - last edited on 2026-04-13 7:37 AM by mƎALLEm
Hello,
From the DK schematic, PDM_SAI1_SD2 is connected to the audio connector, thus its feasible on the DK.
On the Designer FW side, you will need to modify to introduce a 4ch sys mic inputs. You can get inspiration from the existing code; here are few guidelines:
stm32_audio_persist_config_setup.c proposed update:
{
.pConfigName = "stval_mic008",
.audioMs = 8U,
.audioInFreq = 16000U,
.audioInCh = 4U, // Modif here
.audioInHwInterleave = 0U,
.audioOutFreq = 16000U,
.audioOutCh = 2U,
.audioOutResolution = UTIL_AUDIO_RESOLUTION_16B,
.audioInResolution = UTIL_AUDIO_RESOLUTION_16B,
.audioInHwResolution = UTIL_AUDIO_RESOLUTION_8B,
.audioInHwCh = 4UL, // Modif here
.audioInDeviceSelect = AUDIO_IN_DEVICE_DIGITAL_MIC1,
.audioInVolume = 100UL,
.audioOutVolume = 100UL,
.audioInDeviceOutFormat = 1UL,
.audioInUsePdm2Pcm = 1U,
.audioInUsePdm = 1U,
.ac_sysInMicBuffType = ABUFF_FORMAT_FIXED16,
.audioChainLowLatency = 0U,
.usbResolution = UTIL_AUDIO_RESOLUTION_16B,
.ac_sysUsbBuffType = ABUFF_FORMAT_FIXED16
},
2026-04-13 7:32 AM - last edited on 2026-04-13 7:37 AM by mƎALLEm
Hello,
From the DK schematic, PDM_SAI1_SD2 is connected to the audio connector, thus its feasible on the DK.
On the Designer FW side, you will need to modify to introduce a 4ch sys mic inputs. You can get inspiration from the existing code; here are few guidelines:
stm32_audio_persist_config_setup.c proposed update:
{
.pConfigName = "stval_mic008",
.audioMs = 8U,
.audioInFreq = 16000U,
.audioInCh = 4U, // Modif here
.audioInHwInterleave = 0U,
.audioOutFreq = 16000U,
.audioOutCh = 2U,
.audioOutResolution = UTIL_AUDIO_RESOLUTION_16B,
.audioInResolution = UTIL_AUDIO_RESOLUTION_16B,
.audioInHwResolution = UTIL_AUDIO_RESOLUTION_8B,
.audioInHwCh = 4UL, // Modif here
.audioInDeviceSelect = AUDIO_IN_DEVICE_DIGITAL_MIC1,
.audioInVolume = 100UL,
.audioOutVolume = 100UL,
.audioInDeviceOutFormat = 1UL,
.audioInUsePdm2Pcm = 1U,
.audioInUsePdm = 1U,
.ac_sysInMicBuffType = ABUFF_FORMAT_FIXED16,
.audioChainLowLatency = 0U,
.usbResolution = UTIL_AUDIO_RESOLUTION_16B,
.ac_sysUsbBuffType = ABUFF_FORMAT_FIXED16
},
2026-04-13 9:33 AM
Thanks JonathanC appreciate the guidance. All made sense but right out of the gate we get a ram issue lol when changing UTIL_AUDIO_MAX_IN_CH_NB to 4. 1372 bytes. Is it possible to take away from the user heap?
2026-04-13 9:39 AM
sure,
just reduce HEAP size and it should fit.
The heap size is set at maximum to give max capabilities to the LiveTune designer. You can take a chunk from there!
2026-04-21 7:32 AM
do we need to change any of the audio chain modules? For example this sysin now has 4 channels do we need to somehow modify the pdm2pcm module to now work with 4 channels or is that done in the background on its own
2026-04-21 7:36 AM
or is the trick to use the deinterleave module first then use the previous mentioned modules like pdm2pcm
2026-04-21 8:51 AM
Hello,
In your setup, microphones are connected to a hardware block that outputs PDM data (for example, SAI PDM). In this case, LiveTune Designer exposes two types of system inputs:
SysIn‑Microphones
SysIn‑MicroPDM
With the SysIn‑MicroPDM input, you can apply the PDM‑to‑PCM conversion directly in the LiveTune dataflow, either by using the pdm2pcm algorithm (equivalent to the one used in the driver) or a CIC filter. This can also be used to introduce delay on the PDM streams if required.
Additionally, acousticBf supports both PCM and PDM input streams; using PDM enables support for shorter microphone spacing.
When designing your dataflow in LiveTune, you are free to route the four system‑input channels as needed. For example, you can split them and send them to multiple router algorithms, create streams based on selected input channels, de‑interleave channels, and so on.
Jonathan
2026-04-23 8:38 AM
So essential just changing the sysIn parameters and the rest should fall into place.
How do we overcome the 2048000 sampling frequency when using the pdm sysIn?
sampling frequency 2048000 is not in algo capabilities. This was also confirmed with the original supplied hex file for the designer. We attempted to use the resample but got the same error message.
2026-04-23 8:59 AM
The PDM stream is 1-bit high frequency.
You need to use pdm2pcm or cic filter to get a PCM data.
Some routing blocks are able to work with PDM format like splitter, router, etc...
But the algorithm called resample is working on PCM only, this is why it fails.
If after the PDM sysIn you use CiC or PDM2PCM it will work; don't forget to configure the output wire to 16kHz and 128 elements if working at 8ms (see below). Then it will work!
2026-04-23 11:39 AM
Got it thanks. I will try changing the output wire. Sorry for the questions, helping out an audio engineer to get 4 mics running but I really don't have much context of how to use the tool.
To go from 4 channels to 2 channels to resolve the input vs output buffer issues. The best method is to use the router?