UVC - wMaxPacketSize confusion | Cypress Semiconductor
UVC - wMaxPacketSize confusion
I'm trying to modify the videoclass firmware that comes with the SDK to work with NV12 instead of JPEG. I ran into a problem with wMaxPacketSize on OSX. USB Prober on OSX complains that the wMaxPacketSize field of the ISO endpoint descriptor is 0x1400. The message is:
"0x1400: Illegal value for wMaxPacketSize for a SuperSpeed Isochronous endpoint (has to be between 0 and 1024)"
I looked up the field in the USB 3.0 spec and found this...
"For interrupt and isochronous endpoints this field shall be set to 1024 if this endpoint defines a value in the bMaxBurst field greater than zero. If the value in the bMaxBurst field is set to zero then this field can have any value from 0 to 1024 for an isochronous endpoint and 1 to 1024 for an interrupt endpoint."
I then looked through the cypress firmware (cyfxuvcdscr.c) and traced the problem to CY_FX_EP_ISO_VIDEO_PKT_SIZE_H being defined as the size of the packet OR'd with the number of packets...
"#define CY_FX_EP_ISO_VIDEO_PKT_SIZE_H (uint8_t)(((CY_FX_EP_ISO_VIDEO_PKT_SIZE & 0xFF00) >> 8) \
| ((CY_FX_EP_ISO_VIDEO_PKTS_COUNT-1) << 3))"
so this looks like a bug with the Cypress firmware but then I found that if I force the value to 0x0400 then OSX doesn't complain anymore but Windows 8.1 starts complaining. AMCap gives the message..
"Unable to render the video preview stream. The parameter is incorrect. [0x80070057/11878]"
What's going on here? What's the right value for wMaxPacketSize? Any pointers would be appreciated.