AN00127 frame rate limitation

If you have a simple question and just want an answer.
pmjobin
Junior Member
Posts: 4
Joined: Sat Oct 26, 2019 7:40 am

AN00127 frame rate limitation

Post by pmjobin »

Hi,

I've been testing the USB Video Class Device application note (AN00127) on the XK-EVK-XU316 and was wondering what might be limiting the frame rate to around 30 fps. The host negotiates a speed of 480 Mbps, so I would expect the maximum achievable frame rate for a resolution of 480x270 YUV422 to be:

(12 header bytes/line + 480 pixels/lines * 2 bytes/pixels) * 270 lines/frames * 8 bits/byte = 2.1 Mbits/frames

480 Mbps / 2.1 Mbits/frames = 228 frames/sec.

This is significantly higher than the observed 30 fps. It doesn't seem like the frame rate is being limited by a timer or similar mechanism. Instead, the transmission speed appears to be the bottleneck, as reducing the vertical resolution increases the frame rate proportionally.

Is there anything that can be done to achieve a frame rate of 60 fps for this demo?

Thanks,
P-M
User avatar
Ross
Verified
XCore Legend
Posts: 1270
Joined: Thu Dec 10, 2009 9:20 pm
Location: Bristol, UK

Post by Ross »

Hi,

The application uses a single standard bandwidth isochronous endpoint - a single, standard-bandwidth HS iso endpoint you get 1 transaction per 125 µs microframe, max 1024 B payload each →
8192 B/ms = 8 MB/s = 65.536 Mbit/s payload.

Your frame size (UVC header per packet aside) is roughly:

- Pixels: 480×270×2 B = 259,200 B
- If you packetize one line per USB payload and use a 12-byte UVC header per packet: 12×270 = 3,240 B
- Total ≈ 262,440 B/frame

Max fps at regular bandwidth:
8,192,000 B/s ÷ 262,440 B/frame ≈ 31.2 fps

…which matches your ~30 fps observation so this all checks out.

The best way to increase this is to use a high-bandwidth iso endpoint. We're just about to release support for these in lib_xud. This implementation will allow two packets per micro-frame (spec max is 3) - so this should get you where you want to be. You can grab these updates from the head of www.github.com/xmos/lib_xud. We'll endeavour to add support in AN00127 so show example usage.
Technical Director @ XMOS. Opinions expressed are my own