Hello,
we are currently in the process of integrating a USB 3.0 camera (goal = 1920x1080@30fps) into our system, which is powered by a PicoCoreMX8MM.
As the i.MX8MM does not have native USB 3.0, we use the uDP720202 PCIe to USB 3.0 chip. So far so good, USB 3.0 works with all the right drivers.
Unfortunately we don't reach 30fps. Everything above 20fps starts to stutter heavily.
And for some reason only the first stream works, every subsequent stream fails and I see error messages like:
- "uvcvideo 2-1:1.1: Failed to resubmit video URB (-1)."
- "uvcvideo 3-2:1.1: Non-zero status (-71) in video completion handler."
At first I thought that 30fps is just too much data to handle, but in the process of testing/debuging I stumbled upon usbmon.
Strangely enough while usbmon is actively running in the background, I am able to get a stable 30fps from the camera.
So I have one session (SSH) dumping the usbmon output and one session (Serial) which starts the GStreamer pipeline to show the camera video on a screen.
It seems that having usbmon running, the USB performance increases.
Unfortunately I am not able to replicate that performance without usbmon.
What I tried so far:
- Set CPU frequency scaling to performance:
echo performance > /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor - Map the IRQs to a isolated core. Unfortunately because the USB 3.0 is connected via PCIe, Message Signaled Interrupts (MSI) are used,
for which I cannot change the smp_affinity in /proc/irq/<N>/smp_affinity (see NXP-Forum).
But I see from the output of /proc/interrupts, that CPU0 is handling all the MSIs. And there are a lot of them...
Is there anything else I can try to improve the USB/PCIe performance?
Would it be possible to isolate one core to only handle USB/PCIe?
Thank you and best regards,
Stefan