How can I correctly collect a sequence of audio samples (from DMIC) in Arm Cortex memory for further processing in LPDSP32?

This is the overall structure of the program I am trying to make:

DMIC → collect 64 samples of audio in Arm Cortex array → send this to LPDSP32 using shared memory → return processed data back to Arm Cortex → send 64 samples to OD

A continuous stream of data will be coming in from DMIC, which should be processed in real time and a continuous stream of data will go out through the OD

The sample frequency at both DMIC and OD should be 16 kHz

I am firstly just trying to collect mic data from DMIC in an array in Arm Cortex memory and send it out to OD without processing, making an audio passthrough

I have tried doing this using the DMIC_OD sample program, but if I try to collect DMIC samples in an array in the DMIC_OD_IRQ function, the output sound starts getting broken. I am assuming I cannot do any intensive operations inside the IRQ function.

I am trying the DMA method to do this now, but it doesn’t work either. I am not getting any sound output with my current code which I have attached here. I am assuming I should get a 1 kHz tone sound with the current code, but I am not getting any output. I am using two DMA channels (for DMIC and OD) in linear mode with a DMA complete interrupt indicating when one sequence of 64 samples have been collected in DMIC/sent out through OD. Any ideas on how to make my desired program structure in RSL10 will be highly appreciated.

DMIC_OD_DMA.zip (40.4 KB)

@mahaju

The issues you were seeing were caused by 3 problems outlined below:

  1. OD Audio Configuration was not set properly. ‘’ OD_DATA_MSB_ALIGNED ’ was removed from the configuration and the OD was able to playback audio that was passed in.
  2. OD and DMIC DMA were set to Linear instead of Circular. While re-enabling the DMA within the Transfer Interrupt will work, Circular performs this step at the HW level making it more seamless.
  3. The DMIC DMA was writing the 0x00 DMIC data into the ‘’ BufferDmicOd[64] ’, effectively overwriting the SINE wave data that was being manually written in the DMIC DMA Interrupt Handler. By adding a Garbage Buffer that is now receiving the DMIC DMA data, the manually written SINE wave data was being passed to the OD as expected.

OD_SINE_TEST_OD_DMA_MAY05_2021.zip (56.7 KB)

Thank you for using our community forum!