Hi,
I’m facing issue with 4K30 USB capture and streaming. I’m trying to realize 4K30 capture → encode → stream. I see that the USB3.0 capture affects the throughput of the Ethernet, i.e when 4K30 is being captured Ethernet bandwidth reduces drastically, due to which I’m not able to achieve video streaming.
These are my observations:
When I run iperf this is the output
iperf -c 192.168.39.9 -u -b 1000M -i 1
------------------------------------------------------------
Client connecting to 192.168.39.9, UDP port 5001
Sending 1470 byte datagrams
UDP buffer size: 208 KByte (default)
------------------------------------------------------------
[ 3] local 192.168.49.12 port 42333 connected with 192.168.39.9 port 5001
[ ID] Interval Transfer Bandwidth
[ 3] 0.0- 1.0 sec 50.4 MBytes 423 Mbits/sec
[ 3] 1.0- 2.0 sec 50.5 MBytes 424 Mbits/sec
[ 3] 2.0- 3.0 sec 51.1 MBytes 429 Mbits/sec
:
:
[ 3] 0.0-10.0 sec 505 MBytes 424 Mbits/sec
[ 3] Sent 360266 datagrams
[ 3] Server Report:
[ 3] 0.0-10.2 sec 114 MBytes 93.8 Mbits/sec 13.993 ms 278688/360265 (77%)
When I run v4l2 capture as follows and then run iperf simultaneously the throughput reduces
v4l2-ctl --device /dev/video0 --set-fmt-video=width=3840,height=2160,pixelformat=NV12
v4l2-ctl --device /dev/video0 --stream-mmap --stream-poll
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 31.37 fps
<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 30.50 fps
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 30.36 fps
<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 30.25 fps
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 30.20 fps
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 30.18 fps
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 30.15 fps
Tegrastats -
RAM 1747/3995MB (lfb 303x4MB) cpu [89%,1%,1%,0%]@1734 EMC 14%@1600 AVP 1%@80 NVDEC 268 MSENC 268 GR3D 0%@998 EDP limit 1734
RAM 1747/3995MB (lfb 303x4MB) cpu [85%,0%,0%,0%]@1734 EMC 14%@1600 AVP 1%@80 NVDEC 268 MSENC 268 GR3D 0%@998 EDP limit 1734
RAM 1747/3995MB (lfb 303x4MB) cpu [86%,0%,1%,0%]@1734 EMC 14%@1600 AVP 1%@80 NVDEC 268 MSENC 268 GR3D 0%@998 EDP limit 1734
Now run iperf
[ 3] local 192.168.49.12 port 56749 connected with 192.168.39.9 port 5001
[ ID] Interval Transfer Bandwidth
[ 3] 0.0- 1.0 sec 1.27 MBytes 10.6 Mbits/sec
[ 3] 1.0- 2.0 sec 1.12 MBytes 9.43 Mbits/sec
[ 3] 2.0- 3.0 sec 1.66 MBytes 13.9 Mbits/sec
:
:
[ 3] 9.0-10.0 sec 1.12 MBytes 9.38 Mbits/sec
[ 3] 0.0-10.0 sec 14.1 MBytes 11.8 Mbits/sec
[ 3] Sent 10056 datagrams
[ 3] Server Report:
[ 3] 0.0-10.0 sec 14.1 MBytes 11.8 Mbits/sec 0.736 ms
And tegrastats output is
RAM 1747/3995MB (lfb 303x4MB) cpu [100%,0%,1%,1%]@1734 EMC 14%@1600 AVP 0%@80 NVDEC 268 MSENC 268 GR3D 0%@998 EDP limit 1734
RAM 1747/3995MB (lfb 303x4MB) cpu [100%,0%,0%,4%]@1734 EMC 14%@1600 AVP 0%@80 NVDEC 268 MSENC 268 GR3D 0%@998 EDP limit 1734
RAM 1747/3995MB (lfb 303x4MB) cpu [100%,0%,2%,8%]@1734 EMC 14%@1600 AVP 0%@80 NVDEC 268 MSENC 268 GR3D 0%@998 EDP limit 1734
The ethernet throughput dropped from ~100Mpbs to ~10Mpbs.
I have run the jetson max clocks script as well, but no improvement.
I found out that ethernet controller on TX1 is RTL8153 which is also via USB3.0.
Can this be leading to this issue?
Is there a way to achieve 4K30 USB capture and streaming on TX1?