Anyone has usb_examples/usb_device_audio_speaker working?

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Anyone has usb_examples/usb_device_audio_speaker working?

ソリューションへジャンプ
1,607件の閲覧回数
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

ラベル(1)
タグ(3)
1 解決策
1,357件の閲覧回数
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

元の投稿で解決策を見る

2 返答(返信)
1,357件の閲覧回数
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 件の賞賛
返信
1,358件の閲覧回数
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