I am attempting to capture Visible Light images using a USB Webcam that operates with USB Bulk Mode type transfers. The Frame is a 640x480 YUYV frame at 614400 bytes.
This webcam and the same sequence of commands works on the following machines:
- Raspberry Pi ( ARM Linux Board )
- Native Ubuntu 14.04 Linux machine
- Virtualbox Linux Ubuntu 14.04 on a Windows 7 host machine
- Windows 7 machine
However, when I try to capture on the RZ/A1 RSK, I get corrupted images, and kernel messages that indicate bandwidth issues and lost/corrupt frames. I’ve attached one of the garbled images here:
The capturing in Linux is done using the standard V4L2 ( Video4Linux2 ) framework with the standard UVC video Linux drivers.
I’ve done quite a bit of research and I believe the issue is bandwidth on the USB Host controller ( r8a66597 hcd ). I’ve plugged the camera directly into the RSK with no hubs and no other USB devices attached so there is no bus contention with any other USB devices. The datasheet says the controller is fully USB 2.0 high speed compliant and I've modified the driver to print the speed when communication is initiated. The driver says it is operating in High Speed mode.
I’ve tried various UVC driver “Quirks” to try to improve performance and I’ve played with Linux nicety values and scheduling. Unfortunately I haven’t been able to get it to work.
Here are the commands:
sudo dmesg -c
sudo rmmod uvcvideo
sudo chmod 777 /sys/module/usbcore/parameters/autosuspend
sudo echo -1 > /sys/module/usbcore/parameters/autosuspend
sudo modprobe uvcvideo nodrop=1 timeout=15000 quirks=640
sudo chmod 777 /sys/module/uvcvideo/parameters/trace
sudo echo 0xffff > /sys/module/uvcvideo/parameters/trace
sudo rm webcam.yuyv
sudo nice -n -19 -f 99 fswebcam -v --device /dev/video0 -D 1 --input 0 --resolution 640x480 -S 2 --no-banner -p YUYV --save webcam.yuyv
eog webcam.yuyv
Are there any tricks I can do to improve performance and receive my frame ungarbled? Thanks.