I have configured USB Audio Speaker.
Here is tx_callback
static void tx_callback(I2S_Type *base, sai_edma_handle_t *handle, status_t status, void *userData)
{
global_var_struct_t *global_var_struct_ptr;
global_var_struct_ptr = &global_var_struct;
if (kStatus_SAI_RxError == status)
{
}
else
{
global_var_struct_ptr->free_sai_tx_queue = SAI_TransferGetValidTransferSlotsEDMA(base, handle);
}
}
And in USB Audio Thread I'm requesting to send a new pack of sound data when
if (global_var_ptr->free_sai_tx_queue != 0){
After a random couple of minutes (can be 10 or 30) audio is stopped playing. USB looks like kept working. But when I connected to debug I see this:
if (handle->saiQueue[handle->queueUser].data != NULL)
{
if (SAI_TransferGetValidTransferSlotsEDMA(base, handle) != 0)
{
return kStatus_SAI_TxError;
}
return kStatus_SAI_QueueFull;
}
So there is a queue of 4 elements. There are 2 slots available, and SAI trying to request a transfer on the busy slot. What could cause this?
Hi @SCh ,
Do you run the RT1170 sdk usb project directly meet the issues?
If yes, please tell me your project path in the SDK, thanks.
I think, you can refer to this code:
\SDK_2_13_10_MIMXRT1170-EVK\boards\evkmimxrt1170\usb_examples\usb_device_audio_generator
If you use the directly sdk project meet issues, just kindly let me know.
Best Regards,
Kerry