Hi,
I am working on a project involving a PDM microphone and an I2S speaker.
Hardware:
-
PDM microphone: MP34DT01-M
-
MCU: nRF54L15
-
Speaker amplifier: I2S input
-
PDM microphone is connected to the nRF54L15 PDM interface.
-
Speaker amplifier is connected to the nRF54L15 I2S TX interface.
I am able to successfully read audio data from the PDM microphone using the Zephyr dmic_read() API. The data returned by dmic_read() is in PCM format.
However, I am facing an issue when trying to play this PCM data through the I2S speaker.
What I have tested
-
I configured the PDM microphone and can successfully capture data using
dmic_read(). -
I wrote the PCM data returned by
dmic_read()to an external flash file. -
I played the recorded RAW PCM file separately, but I hear only noise.
-
I also tried sending the PCM data directly from the PDM microphone to the I2S TX interface.
-
In both cases, the speaker produces only noise instead of the expected microphone audio.
The I2S interface is configured with the required:
-
BCLK / SCK
-
LRCLK / FCLK
-
SDOUT / DATA
What I need help with
Could you please review my source code and help identify the problem?
In particular, I would like to verify:
-
Whether the PCM data produced by
dmic_read()is actually valid audio. -
Whether the PDM microphone configuration is correct.
-
Whether the PCM sample format, sample rate, bit depth, and channel configuration are correct.
-
Whether the I2S TX configuration matches the PCM data format.
-
Whether there is an issue with signed/unsigned PCM data, sample width, channel format, or byte ordering.
-
Whether the I2S clock configuration is correct for the speaker amplifier.
-
Whether the DMA/buffer configuration could be causing corrupted audio.
-
Why the RAW PCM file contains noise even when played separately.
-
Why the direct PDM-microphone-to-I2S path also produces only noise.
I have provided my PDM microphone driver, I2S speaker driver, device-tree overlay, prj.conf, and the captured RAW PCM file in attachment .8475.Mic_POC.zip
Please analyze the complete code and identify the exact issue, if possible, and provide the required code/configuration changes to get clean microphone audio through the speaker.