DMA of USB Multiple Channel Audio

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Panometric
Level 5
Level 5
100 sign-ins 100 replies posted 10 solutions authored

Using the demo CY8CKIT_046_USB_Audio as an example, I am trying to create a 4 channel USB audio adapter. 

   

USBFS and I2S components both support the extra channels, but the data for 4 channels is interleaved in a frame according to http://www.usb.org/developers/docs/devclass_docs/frmts10.pdf Section 2.2.3

   

How the audio stream data is formatted to and from USBFS is not well documented but I am assuming it is still interleaved. So for example, each frame would be 6 bytes to I2S0, and then 6 bytes to I2S1. 

   

Since the data has to go to different I2S FIFO registers I2S_RX_CHn_F0_PTR, it is unclear how to use DMA to accomplish it. Ideas?

0 Likes
1 Solution
AnkitaS_51
Employee
Employee
100 likes received 50 likes received 25 likes received

Presently,the left and right channels are interleaved with a sample for the left channel first, followed by the right channel in a single FIFO (FIFO 0)

   

Data interleaving must be set to Interleaved for the I2S direction which requires byte
swapping.

View solution in original post

0 Likes
3 Replies
AnkitaS_51
Employee
Employee
100 likes received 50 likes received 25 likes received

Presently,the left and right channels are interleaved with a sample for the left channel first, followed by the right channel in a single FIFO (FIFO 0)

   

Data interleaving must be set to Interleaved for the I2S direction which requires byte
swapping.

0 Likes
Panometric
Level 5
Level 5
100 sign-ins 100 replies posted 10 solutions authored

The issue is not the for left and right, but the second or third pair, or channels 3-6 respectively. Since they have to be moved to/from different FIFO locations like  I2S_RX_CHn_F1_PTR and  I2S_RX_CHn_F2_PTR which are different for the additional channels.  It seems like each pair will need it own DMA. But even the existing USB DMA will be broken by adding channels because the USB_FS will put them all in contiguous memory.  Can anyone provide an example of more than 2 channels of I2S with USB?

0 Likes
himam_31
Employee
Employee
50 likes received 25 likes received 10 likes received

Hello,

   

Multiple channel audio requires indexed DMA approach. The current DMA architecture of PSoC4L is not suitable for this architecture. you may have to use PSoC5LP for this application.

   

Thanks,

   

Hima