Are there any options for this element that might help with reducing CPU? I have tried experimenting by adjusting the UDP buffer size, but that affects the framerate stability (fluctuates wildly as the buffer size decreases)
Hi,
Please execute sudo jetson_clocks and check sudo tegrastats. This should be more clear to check CPU usage. By default CPU clock is varying and it is difficult to get accurate loading from the percentage.
I’ve run jetson_clocks and set the power mode to MAXN on both Jetpack 4 and Jetpack 5. But there is a big difference in CPU usage for the same command (almost 6% of a core)
Also, I don’t think tegrastats should be used to profile individual processes, it’s good for profiling system-wide CPU/GPU consumption but not for per-process CPU load.
Please see the bash script below that I used to profile the gstreamer pipeline at 10Hz, that I borrowed from this SO post.
Profiling Script:
#!/bin/bash
set -e
topp() (
if [ -n "$O" ]; then
$* &
else
$* &>/dev/null &
fi
pid="$!"
trap "kill $pid" SIGINT
o='%cpu,%mem,vsz,rss'
printf '%s\n' "$o"
i=0
while s="$(ps --no-headers -o "$o" -p "$pid")"; do
printf "$i $s\n"
i=$(($i + 1))
sleep "${T:-0.1}"
done
)
topp $*
Hi,
In the pipeline it looks like the CPU usage is mainly form rtspsrc. And it is upgraded from 1.14.5 to 1.16.3. We don’t have customization to the plugin, so it may be certain update in the plugin for bug fixes.
Not sure if it helps bu tyou may set the properties for a try:
retry : Max number of retries when allocating RTP ports.
flags: readable, writable
Unsigned Integer. Range: 0 - 65535 Default: 20
udp-reconnect : Reconnect to the server if RTSP connection is closed when doing UDP
flags: readable, writable
Boolean. Default: true
I’ve tried different parameters, and the one you suggested, but they didn’t help.
It seems like the increase in CPU is not just due to the GStreamer version, but there’s something else in the newer Jetpack that’s affecting performance. Please review the results I’m sharing from running a minimal example.
Hi,
It looks like there is deviation between gstreamer 1.14 and 1.16. And certain increase may be from K4.9 to K5.10. We enable our platforms with upstream kernel but don’t make customization. This is more like certain code change in kernel code makes the increase. Probably CPU hotplug mechanism is more active on K5.10.