I'm whittling down the sw_usb_audio reference application to configure it for our use case, which is basically just 2-channels USB out (from host to xmos device) and then passed through a DAC. I'm using asynchronous USB, NUM_USB_CHAN_IN 0 and NUM_USB_CHAN_OUT 2.
I'm configuring the USB endpoint tables and currently they look like this:
XUD_EpType epTypeTableOut[ENDPOINT_COUNT_OUT] = {
XUD_EPTYPE_CTL | XUD_STATUS_ENABLE, // Endpoint0
XUD_EPTYPE_ISO, // USB audio out from host
};
// ENDPOINT_COUNT_IN is 3 because XUA forces the inclusion of USB audio in
XUD_EpType epTypeTableIn[ENDPOINT_COUNT_IN] = {
XUD_EPTYPE_CTL | XUD_STATUS_ENABLE, // Endpoint0
XUD_EPTYPE_ISO, // Async feedback endpoint
};
However, ENDPOINT_COUNT_IN, calculated in xua_conf_default, reports as 3. Looking at the implementation:
enum USBEndpointNumber_In
{
ENDPOINT_NUMBER_IN_CONTROL, /* Endpoint 0 */
#if (NUM_USB_CHAN_IN == 0) || defined (UAC_FORCE_FEEDBACK_EP)
ENDPOINT_NUMBER_IN_FEEDBACK,
#endif
ENDPOINT_NUMBER_IN_AUDIO, <---- What's this one for?
<-- unused #defines redacted -->
XUA_ENDPOINT_COUNT_IN /* End marker */
};
The 3rd member of this enum, ENDPOINT_NUMBER_IN_AUDIO, seems to be responsible for ENDPOINT_COUNT_IN being 3. Should it not be gated by #if (NUM_USB_CHAN_IN == 0) statement?
I'm whittling down the sw_usb_audio reference application to configure it for our use case, which is basically just 2-channels USB out (from host to xmos device) and then passed through a DAC. I'm using asynchronous USB,
NUM_USB_CHAN_IN 0
andNUM_USB_CHAN_OUT 2
.I'm configuring the USB endpoint tables and currently they look like this:
However,
ENDPOINT_COUNT_IN
, calculated inxua_conf_default
, reports as3
. Looking at the implementation:The 3rd member of this enum,
ENDPOINT_NUMBER_IN_AUDIO
, seems to be responsible forENDPOINT_COUNT_IN
being 3. Should it not be gated by#if (NUM_USB_CHAN_IN == 0)
statement?