Hi @mrecoskie ,
Sorry for my later reply!
I find your code, usb_device_interface_0_audio_contol.c contains the USB_DeviceInterface4AudioStreamingSetInterface,
So, I think you can copy this API, then set it for the interface1,2,3.
usb_status_t USB_DeviceInterface4AudioStreamingSetInterface(class_handle_t handle, uint8_t alternateSetting) {
usb_status_t error = kStatus_USB_Success;
/* if a supported alternated setting is used */
if (alternateSetting <= USB_ALTERNATE_SETTING_1)
{
if (s_UsbDeviceComposite->currentInterfaceAlternateSetting[USB_INTERFACE_4_AUDIO_STREAMING_INDEX] == alternateSetting)
{
return error;
}
/* Data output alternate setting of the stream interface */
if (USB_ALTERNATE_SETTING_1 == alternateSetting)
{
error = USB_DeviceAudioRecv(s_UsbDeviceComposite->interface0AudioControlHandle,
USB_AUDIO_SPEAKER_STREAM_ENDPOINT, &USB_Interface0AudioControlDataBuff[0],
s_UsbDeviceAudioSpeaker->currentStreamOutMaxPacketSize);
if (!feedbackValueUpdating)
{
*((uint32_t *)&usbAudioFeedBackBuffer[0]) = *((uint32_t *)&audioFeedBackBuffer[0]);
}
error |= USB_DeviceAudioSend(s_UsbDeviceComposite->interface0AudioControlHandle,
USB_AUDIO_SPEAKER_FEEDBACK_ENDPOINT, usbAudioFeedBackBuffer,
s_UsbDeviceAudioSpeaker->currentFeedbackMaxPacketSize);
}
else
{
error = USB_DeviceDeinitEndpoint(
s_UsbDeviceComposite->deviceHandle,
USB_AUDIO_SPEAKER_STREAM_ENDPOINT |
(USB_OUT << USB_DESCRIPTOR_ENDPOINT_ADDRESS_DIRECTION_SHIFT));
}
/* usb host stops the speaker, so there is no need for feedback */
if ((1U == s_UsbDeviceAudioSpeaker->startPlayFlag) &&
(USB_ALTERNATE_SETTING_0 == alternateSetting))
{
s_UsbDeviceAudioSpeaker->stopFeedbackUpdate = 1U;
}
/* usb host start the speaker, discard the feedback for AUDIO_SPEAKER_FEEDBACK_DISCARD_COUNT
* times */
if (USB_ALTERNATE_SETTING_1 == alternateSetting)
{
s_UsbDeviceAudioSpeaker->stopFeedbackUpdate = 0U;
s_UsbDeviceAudioSpeaker->feedbackDiscardFlag = 1U;
s_UsbDeviceAudioSpeaker->feedbackDiscardTimes = AUDIO_SPEAKER_FEEDBACK_DISCARD_COUNT;
}
}
else
{
error = kStatus_USB_InvalidRequest;
}
return error;
}
I copy it, and use the related name in the usb_device_compoiste.c:
case USB_INTERFACE_1_AUDIO_STEAMING1_INDEX:
ret = USB_DeviceInterface1AudioSteaming1SetInterface(g_UsbDeviceComposite.interface0AudioControlHandle, alternateSetting);
break;
case USB_INTERFACE_2_AUDIO_STREAMING_INDEX:
ret = USB_DeviceInterface2AudioStreamingSetInterface(g_UsbDeviceComposite.interface0AudioControlHandle, alternateSetting);
break;
case USB_INTERFACE_3_AUDIO_STREAMING_INDEX:
ret = USB_DeviceInterface3AudioStreamingSetInterface(g_UsbDeviceComposite.interface0AudioControlHandle, alternateSetting);
break;
case USB_INTERFACE_4_AUDIO_STREAMING_INDEX:
ret = USB_DeviceInterface4AudioStreamingSetInterface(g_UsbDeviceComposite.interface0AudioControlHandle, alternateSetting);
break
Then build again, the issue is not happen, I think it is the CFG issues which didn't generate the related API.
You can try it on your side.
Best Regards,
Kerry