Anyone has usb_examples/usb_device_audio_speaker working?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Anyone has usb_examples/usb_device_audio_speaker working?

Jump to solution
744 Views
javiercardona
Contributor III

I'm trying the usb audio examples in SDK_2.0 on a TWR-K24F120M and I cannot get usb_device_audio_speaker to work.  The USB portion of the example seems to work fine, with the speaker being correctly detected and enumerated by the host, and audio data flowing over USB.  The problem is the DMA transfer to the codec: SAI_TransferSendEDMA() is called, but the associated callback() never gets called.

 

Other audio examples that use that mechanism work fine, in particular demo_apps/sai and driver_examples/sai/sai_edma_transfer.c have the same callback() called, and produce sound as expected.

 

Can anyone suggest how to troubleshoot this?

 

Best,

 

 

cc:

Kyle Manna

Labels (1)
Tags (3)
1 Solution
494 Views
javiercardona
Contributor III

I did get this to work, but not without some effort...

First, I applied the workaround given here to allow multiple SAI_TransferSendEDMA() to work.

How to reuse SAI_TransferSendEDMA in KSDK 2.0 

Secondly, I copied over the SAI configuration from sai_edma_transfer.c, in particular

use the default SGTL config:

- sgtl_config_t codecConfig;
- codecConfig.bus = kSGTL_BusLeftJustified;
- codecConfig.master_slave = true;
- codecConfig.route = kSGTL_RoutePlayback;
- SGTL_Init(&codecHandle, &codecConfig);
+ SGTL_Init(&codecHandle, NULL);

And configure the SGTL as slave (SAI as master):

-#if !defined(DEMO_CODEC_WM8960)
- config.masterSlave = kSAI_Slave;
-#if defined(FSL_FEATURE_SAI_HAS_MCR) && (FSL_FEATURE_SAI_HAS_MCR)
- config.mclkOutputEnable = false;
-#endif
-#endif

View solution in original post

2 Replies
494 Views
kyleyang
Contributor IV

Hi Kyle

Would you mind share your USB audio speaker descriptor with me?

I am also want to use KSDK2.1 to build this application on FRDM-K66F.

Thanks.

0 Kudos
495 Views
javiercardona
Contributor III

I did get this to work, but not without some effort...

First, I applied the workaround given here to allow multiple SAI_TransferSendEDMA() to work.

How to reuse SAI_TransferSendEDMA in KSDK 2.0 

Secondly, I copied over the SAI configuration from sai_edma_transfer.c, in particular

use the default SGTL config:

- sgtl_config_t codecConfig;
- codecConfig.bus = kSGTL_BusLeftJustified;
- codecConfig.master_slave = true;
- codecConfig.route = kSGTL_RoutePlayback;
- SGTL_Init(&codecHandle, &codecConfig);
+ SGTL_Init(&codecHandle, NULL);

And configure the SGTL as slave (SAI as master):

-#if !defined(DEMO_CODEC_WM8960)
- config.masterSlave = kSAI_Slave;
-#if defined(FSL_FEATURE_SAI_HAS_MCR) && (FSL_FEATURE_SAI_HAS_MCR)
- config.mclkOutputEnable = false;
-#endif
-#endif