Welcome new user! You can search existing questions and answers without registering, but please register to post new questions and receive answers.

Multiple USB JeVois bandwidth limit

0 votes

We are FIRST FRC robotics team.  We are working on using two JeVois cameras to display on the drivers station for just a straight video feed (no vision/OpenCV) for the drivers to see the field. The goal is to use one on the front and one on the back via USB to the RoboRIO. We are looking to run each device with the MJPG 160x120 at 10FPS. We have the JeVois configured to convert YUYV to MJPG, so the USB bandwidth should be very low. The cameras work great individually, but can’t be run together. We are getting the notorious VIDIOC_STREAMON: No space left on device error. We have tested running uncompressed YUYV as well so that the could leverage the uvcvideo quirks=128 (also tested 640), all to no avail (https://stackoverflow.com/questions/...ux-uvc-driver). We did this by editing the /etc/modprobe.d/uvcvideo.conf file and rebooting. The requested bandwidth on the RoboRIO (Linux) looks to be 61% per USB device. These are the only 2 cameras(devices) that are attached to the RoboRIO and nothing else on USB.

This year we are programming in Java. We have reviewed the fantastic white paper from team 2073 and have two additional (totally separate) JeVois running well over serial for vision processing. We have power working well for all devices. We have thought about using a button to switch between the 2 video feeds and we would prefer to not use that as a solution, but to use 2 video feeds at the same time. Does anyone have ideas to make this work?

This is a copy of our post on Chief Delphi (https://www.chiefdelphi.com/forums/showthread.php?threadid=162566), where we got a reponse recommending to turn off the other services.  We have set serial output to hard, so that it would not reserve bandwidth.  This did not help.

asked Feb 12, 2018 in User questions by TonyEnglish (130 points)

2 Answers

0 votes
Yes, by default JeVois is configured to use all of the isochronous bandwidth, so as to minimize latency. In a nutshell, isochronous transfers are the ones that guarantee real time data delivery, and hence are desirable for audio and video. On a 8MHz clock, each connected device can request some time slots, for example, a device may request to transmit 1kb every 8 clock cycles. The host then finds a way to accommodate the various requests of all connected devices. Now, on jevois, by default we request the max, which is 3kb every clock cycle, with the goal of pushing all the video data as fast as possible to the host to minimize delay. Unfortunately there is no way to request slots only as needed, you just request them or not, i.e., once allocated to jevois they cannont be used by others even after the current frame is done transmitting. Once you are out of bandwidth you get the no space left on device error. Isochronous data can use no more than 80% of the total USB bandwidth, which is why serial over USB still works (it uses bulk transfers).

It is a setting in the kernel. We will add an option to drop this down to 1kb/cycle which should allow you to connect 3 cameras, but then you won’t be able to transmit big frames, which should not be a problem for you. In principle, several settings can be exposed by the camera (eg, 512b/frame, 1kb/frame, etc) but then the host would usually select the one with the lowest bandwidth requirement for the chosen video resolution, which defeats our efforts to minimize latency (low resolution video would be stretched into many tiny packets as opposed to a few big packets)

We will let you know when a custom microSD image is ready for you.
answered Feb 12, 2018 by JeVois (39,960 points)
Having access to tune the USB bandwidth utilization to optimize it for specific configurations will be a really nice feature.
When integrating the JeVois into various projects, having it play well with other devices on the same bus is important. Minimal latency is important for certain applications, but not every application. Giving us access to tune it according to our specific needs is a really nice option. THANK YOU!
Thank you, really appreciate it and look forward to the image.
+1 vote

We now have a prototype of this working. It is not super clean yet as we need to better sync up what is happening in the kernel vs our userland code in jevois-daemon, but please try it to see whether that works for you and we will do an official release next week:

download and flash http://jevois.org/data/jevois-image-1.7.2beta-8G.zip onto each camera (all of them need the new code). Now you can connect up to 3 cameras.


here I ran guvcview -d /dev/video0 and manually selected some resolution, then guvcview -d /dev/video1 and then guvcview -d /dev/video2

Note that now each camera can use a max of 8 Mbytes/s of bandwidth. In YUYV, that means only low-resolution will go through at full frame rate. Indeed, just 640x480x2(bytes/pix)x30(fps) already is 18 Mbytes/s. But you should be fine with your low-res MJPG video. Usually 1 byte/pix is an ok estimate for MJPG though of course it depends on image complexity (fine textures, etc).

answered Feb 15, 2018 by JeVois (39,960 points)
This works great, thank you so much for the fast turn around on this!