u***@viop.ca
2014-02-05 09:49:44 UTC
Goal:
As many webcams as possible running on 1 host controller, running at
***@30fps with native H.264 compression.
Problem:
USB bandwith allocation (60%) seems too high for each C920 webcam
running at ***@30fps, when using native H.264 compression. This
limit allows only 1 Webcam per USB controller.
=======
Previous tests:
1. One Logitech C920; ***@30fps; MJPG; Alloc 60%; 19% CPU;
network bandwidth ~50Mb/s (megabits per second)
2. One Logitech C920; ***@30fps; H.264; Alloc 60%; 1.3% CPU;
network bandwidth ~3.2Mb/s
3. Two Logitech C920's; ***@1920x1080@30fps; ***@1280x720@30fps; H.264;
Alloc 92%; 3% CPU; network bandwidth ~6.4Mb/s
4. Three Logitech C920's; ***@1280x720@30fps; H.264; Alloc 96%; 5% CPU;
network bandwidth ~9.6Mb/s
5. Four Logitech C920's; ***@640x360@30fps; H.264; Alloc 32%; 5.5%CPU;
network bandwidth ~11.2Mb/s*
*one cam was viewing a dark scene, so the network bandwidth was
reporting low. In reality the expected bandwidth would be ~12.8Mb/s.
=======
Commands used:
#enable USB debugging
sudo mount -t debugfs none_debugs /sys/kernel/debug
sudo modprobe usbmon
cat /sys/kernel/debug/usb/devices |grep Alloc
#available formats/resolutions
v4l2-ctl --list-formats-ext --device=/dev/video1
#to stream
cvlc -vvv v4l2:///dev/video1:chroma=h264:width=1920:height=1080
--sout='#standard{access=udp,mux=ts,dst=192.168.1.255:8081,name=stream}'
#to play
vlc udp://@:8083
=======
Hardware used:
1. Asus Digimatrix HTPC
-SiS 651 chipset (315 series)
-Intel P4 2.66GHz
-4x SiS USB 1.1 Controller (PCI :03.1, :03.2, :09.0, :09.1) (4
external USB ports)
-2x SiS USB 2.0 Controller (PCI :03.3, :09.2) (4 external USB ports)
2. D-Link DUB-H4; USB 2.0, 4-port, powered hub
3. 4x Logitech C920 Webcams; ***@30fps capabable
4. 5x StarTech USB2FAAEXT15; 16ft USB 2.0 active extension cable
=======
Topology of the 4-webcam test setup: (view properly with a
monospace/console font)
*--------------------*
| USB 2.0 Controller |
*--------------------*
|
*--------------------*
| 16ft USB Extension |
*--------------------*
|
*----------------------------*
| USB 2.0 4-port powered Hub |
*----------------------------*
| | | |
| | | \_*-------------*
| | | | C920 Webcam |
| | | *-------------*
| | |
| | \_*-------------*
| | | C920 Webcam |
| | *-------------*
| |
| \_*--------------------* *--------------------* *-------------*
| | 16ft USB Extension |--| 16ft USB Extension |--| C920 Webcam |
| *--------------------* *--------------------* *-------------*
|
\_*--------------------* *--------------------* *-------------*
| 16ft USB Extension |--| 16ft USB Extension |--| C920 Webcam |
*--------------------* *--------------------* *-------------*
=======
Observations:
1. USB full speed is 480Mb/s. The network bandwidth needed to carry
each native H.264 ***@30fps stream is ~3.2Mb/s. If we
(incorrectly?) assume that the USB bandwidth needs are approximately the
same as the network bandwidth needs, then 150 webcams on one USB
controller would theoretically be possible. Even if that assumption is
wrong by a factor of 10 (because of other limitations), then 15 webcams
at full HD should still be possible.
2. Default USB allocation seems to be 60% for all resolutions that I
tried, except for 2, which are significantly lower (better):
160x90: 60%
320x180: 60%
640x360: 8%
1280x720: 32%
1920x1080: 60%
=======
Questions:
1. Is there a bug in the way the USB bandwidth allocation is fixed at
60% for most resolutions?
2. Is 60% really required for 1920x1080 H.264?
3. With regard to the uvcvideo FAQ[1], is this where these issues can
be addressed in the source code (for those who possess the skills):
uvc_init_video():
/* Isochronous endpoint, select the alternate setting. */
bandwidth = stream->ctrl.dwMaxPayloadTransferSize;
4. Is this something that could/should be addressed in a
webcam-model-specific way, or generally.
5. BONUS question: What is a realistic maximum number of (IP broadcast
streaming) ***@30fps webcams on this computer (the Digimatrix),
and what is the limiting factor?
footnotes:
[1] uvcvideo FAQ: "I get a "No space left on device" (-28) error when
trying to stream from more than one camera simultaneously."
http://www.ideasonboard.org/uvc/faq/
=======
As many webcams as possible running on 1 host controller, running at
***@30fps with native H.264 compression.
Problem:
USB bandwith allocation (60%) seems too high for each C920 webcam
running at ***@30fps, when using native H.264 compression. This
limit allows only 1 Webcam per USB controller.
=======
Previous tests:
1. One Logitech C920; ***@30fps; MJPG; Alloc 60%; 19% CPU;
network bandwidth ~50Mb/s (megabits per second)
2. One Logitech C920; ***@30fps; H.264; Alloc 60%; 1.3% CPU;
network bandwidth ~3.2Mb/s
3. Two Logitech C920's; ***@1920x1080@30fps; ***@1280x720@30fps; H.264;
Alloc 92%; 3% CPU; network bandwidth ~6.4Mb/s
4. Three Logitech C920's; ***@1280x720@30fps; H.264; Alloc 96%; 5% CPU;
network bandwidth ~9.6Mb/s
5. Four Logitech C920's; ***@640x360@30fps; H.264; Alloc 32%; 5.5%CPU;
network bandwidth ~11.2Mb/s*
*one cam was viewing a dark scene, so the network bandwidth was
reporting low. In reality the expected bandwidth would be ~12.8Mb/s.
=======
Commands used:
#enable USB debugging
sudo mount -t debugfs none_debugs /sys/kernel/debug
sudo modprobe usbmon
cat /sys/kernel/debug/usb/devices |grep Alloc
#available formats/resolutions
v4l2-ctl --list-formats-ext --device=/dev/video1
#to stream
cvlc -vvv v4l2:///dev/video1:chroma=h264:width=1920:height=1080
--sout='#standard{access=udp,mux=ts,dst=192.168.1.255:8081,name=stream}'
#to play
vlc udp://@:8083
=======
Hardware used:
1. Asus Digimatrix HTPC
-SiS 651 chipset (315 series)
-Intel P4 2.66GHz
-4x SiS USB 1.1 Controller (PCI :03.1, :03.2, :09.0, :09.1) (4
external USB ports)
-2x SiS USB 2.0 Controller (PCI :03.3, :09.2) (4 external USB ports)
2. D-Link DUB-H4; USB 2.0, 4-port, powered hub
3. 4x Logitech C920 Webcams; ***@30fps capabable
4. 5x StarTech USB2FAAEXT15; 16ft USB 2.0 active extension cable
=======
Topology of the 4-webcam test setup: (view properly with a
monospace/console font)
*--------------------*
| USB 2.0 Controller |
*--------------------*
|
*--------------------*
| 16ft USB Extension |
*--------------------*
|
*----------------------------*
| USB 2.0 4-port powered Hub |
*----------------------------*
| | | |
| | | \_*-------------*
| | | | C920 Webcam |
| | | *-------------*
| | |
| | \_*-------------*
| | | C920 Webcam |
| | *-------------*
| |
| \_*--------------------* *--------------------* *-------------*
| | 16ft USB Extension |--| 16ft USB Extension |--| C920 Webcam |
| *--------------------* *--------------------* *-------------*
|
\_*--------------------* *--------------------* *-------------*
| 16ft USB Extension |--| 16ft USB Extension |--| C920 Webcam |
*--------------------* *--------------------* *-------------*
=======
Observations:
1. USB full speed is 480Mb/s. The network bandwidth needed to carry
each native H.264 ***@30fps stream is ~3.2Mb/s. If we
(incorrectly?) assume that the USB bandwidth needs are approximately the
same as the network bandwidth needs, then 150 webcams on one USB
controller would theoretically be possible. Even if that assumption is
wrong by a factor of 10 (because of other limitations), then 15 webcams
at full HD should still be possible.
2. Default USB allocation seems to be 60% for all resolutions that I
tried, except for 2, which are significantly lower (better):
160x90: 60%
320x180: 60%
640x360: 8%
1280x720: 32%
1920x1080: 60%
=======
Questions:
1. Is there a bug in the way the USB bandwidth allocation is fixed at
60% for most resolutions?
2. Is 60% really required for 1920x1080 H.264?
3. With regard to the uvcvideo FAQ[1], is this where these issues can
be addressed in the source code (for those who possess the skills):
uvc_init_video():
/* Isochronous endpoint, select the alternate setting. */
bandwidth = stream->ctrl.dwMaxPayloadTransferSize;
4. Is this something that could/should be addressed in a
webcam-model-specific way, or generally.
5. BONUS question: What is a realistic maximum number of (IP broadcast
streaming) ***@30fps webcams on this computer (the Digimatrix),
and what is the limiting factor?
footnotes:
[1] uvcvideo FAQ: "I get a "No space left on device" (-28) error when
trying to stream from more than one camera simultaneously."
http://www.ideasonboard.org/uvc/faq/
=======