UVC packet size and interrupts

I am working on porting the UVC driver to another STM32 device that supports hi speed USB to increase the frame rate. I am able to transmit video over USB HS, but not at the max transfer rate. I can transfer at 1 packet per microframe but not the max 3 packets per microframe. In the UVC driver, video data is transmitted one packet at a time, so I think that is part of the problem. Before sending each packet the USB interrupts are disabled and then reenabled afterwords. I tried keeping the IRQs enabled all the time, but it breaks the video stream. Why is this?

uint8_t UVC_Transmit_FS(uint8_t* Buf, uint16_t Len)
{
uint8_t result = USBD_OK;
HAL_NVIC_DisableIRQ(OTG_FS_IRQn);
USBD_UVC_SetTxBuffer(hUsbDevice_0, Buf, Len);
result = USBD_UVC_TransmitPacket(hUsbDevice_0);
HAL_NVIC_EnableIRQ(OTG_FS_IRQn);
return result;
}

I tried increasing the amount of data loaded into the TX fifo to more than one packet, but it didn’t work even though the low level driver seems to be designed for it. The device does not transmit any video data.
Any ideas why this might be?

Are there any plans to try to get this driver working at a faster frame rate over HS USB?

Hi, we don’t have any cameras with USB HS so there are no plans to support it. I don’t think the interrupts are relevant, it’s probably to make sure the transfer starts after all the buffers are set. How do you increase the packet size ? Do you change the VIDEO_PACKET_SIZE in include/usbd_uvc.h ?

Thanks for the response. To send more than one packet per microframe, the wMaxPacketSize field in the endpoint descriptor needs to be set to VIDEO_PACKET_SIZE + ((PACKETS_PER_MICROFRAME - 1) << 11).

Maybe you should try sending a single packet per frame first and increase VIDEO_PACKET_SIZE. I’m sorry I can’t help you more I don’t have access to HS hardware and never tried it before.