cancel
Showing results for 
Search instead for 
Did you mean: 

I2S mono audio capture

slal
Associate III
Posted on September 10, 2012 at 22:37

I have an application where I have a digital mic/codec combination transmitting PCM 16-bit samples over I2S to an STM32F217 at 16kSps (Phillips I2S standard). I am trying to use DMA to capture this audio stream, however I only wish to capture one single channel on I2S e.g. when LRCLK is low only, while ignoring the sample when LRCLK is high. Right now I have the DMA capturing all samples, i.e. when LRCLK is low and when high, and that requires extra handling once the write buffer is filled to copy out all the samples from one channel.

Is there a way to configure the I2S DMA capture to only capture one sample per LRCLK cycle, i.e. mono capture instead of stereo capture?

#stm32-audio-dma #metoo-maybe
4 REPLIES 4
Posted on September 11, 2012 at 02:23

Dunno, perhaps you can configure the DMA to read 32-bit words, and write 16-bit half words.

Other than that you'll probably just need to decimate the data, if you're copying it anyway, the cost of stepping by 4 on the input instead of by 2 isn't going to amount to much.
Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Posted on September 11, 2012 at 10:52

> Is there a way to configure the I2S DMA capture to only capture one sample per LRCLK cycle,

> i.e. mono capture instead of stereo capture?

No.

(I could envision a system with the buffer in external 16-bit RAM, with a multiplexer on addresses shifting them one bit to the right while writing; but the complexity of such thing makes the whole idea absurd. It would perhaps be easier to build a dedicated mono I2S deserializer).

But if it makes you feel better, if you would use a 24-bit or 32-bit I2S codec, you would need to resolve also the swapped endianness due to the DMA limitations... 🙂

JW

bola
Associate II
Posted on March 21, 2013 at 19:28

Hi Sunny,

Whether you got solution for below mentioned issue. 

Even I am facing similar issue.

Regards,

Pradeep Bola

Posted on March 21, 2013 at 21:19

Whether you got solution for below mentioned issue.  Even I am facing similar issue.

I2S is intrinsically stereo pairs, pad or discard data as required. PCM at 16-bit is just a continuous stream of data with some kind of word framing. You may, or may not, need to stuff alternate words if the transport expects two channels. Be specific about the data/framing you need, use a diagram.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..