Low gstreamer framerate on Jetson TK1

Hi,

I’m trying to assess if a TK1 would be able to encode two HD video inputs in real time.

I use the follwing command:

gst-launch-0.10 videotestsrc pattern=gamut num-buffers=250 ! ‘video/x-raw-yuv,format=(fourcc)I420,width=1920,height=1080,framerate=(fraction)30/1’ ! nv_omx_h264enc ! video/x-h264 ! avimux ! fakesink
Setting pipeline to PAUSED …
Pipeline is PREROLLING …
NvMMLiteOpen : Block : BlockType = 4
===== MSENC =====
NvMMLiteBlockCreate : Block : BlockType = 4
Pipeline is PREROLLED …
Setting pipeline to PLAYING …
New clock: GstSystemClock
Got EOS from element “pipeline0”.
Execution ended after 18891573163 ns.
Setting pipeline to PAUSED …
Setting pipeline to READY …
Setting pipeline to NULL …
Freeing pipeline …

So for 250 frames it requires 18 seconds. Something must be wrong as the CPU maxes out during running this command.
Any ideas where I might look for further diagnostic data?

Thank you

Juergen

Did you max out all the clocks?

When running any performance tests, I recommend setting CPU, GPU and EMC clocks to maximum:
http://elinux.org/Jetson/Performance

I try to do that, but at the moment I have the following problem:
#echo 852000000 > /sys/kernel/debug/clock/override.gbus/rate
bash: echo: write error: No such file or directory

I run this in sudo su mode, but no success so far…

Are you sure you are running that on the Jetson?

If you are, what does the following say?

ls -l /sys/kernel/debug

It lists the following:

drwxr-xr-x 3 root root 0 Jan 1 1970 asoc
drwxr-xr-x 15 root root 0 Feb 2 00:38 bdi
drwxr-xr-x 313 root root 0 Jan 1 1970 clock
drwxr-xr-x 2 root root 0 Jan 1 1970 clock_stats
drwxr-xr-x 2 root root 0 Jan 1 1970 corenpdrq
drwxr-xr-x 2 root root 0 Jan 1 1970 cpuidle
drwxr-xr-x 2 root root 0 Jan 1 1970 cpu-tegra
drwxr-xr-x 2 root root 0 Jan 1 1970 dma-api
drwxr-xr-x 2 root root 0 Jan 1 1970 dma_buf
drwxr-xr-x 2 root root 0 Jan 1 1970 dynamic_debug
-r–r--r-- 1 root root 0 Jan 1 1970 edid1
drwxr-xr-x 3 root root 0 Jan 1 1970 edp
drwxr-xr-x 2 root root 0 Jan 1 1970 extfrag
drwxr-xr-x 2 root root 0 Jan 1 1970 failslab
drwxr-xr-x 3 root root 0 Jan 1 1970 gk20a.0
-r–r--r-- 1 root root 0 Jan 1 1970 gpio
drwxr-xr-x 2 root root 0 Jan 1 1970 hid
drwxr-xr-x 2 root root 0 Jan 1 1970 iio
drwxr-xr-x 2 root root 0 Jan 1 1970 isp.0
drwxr-xr-x 2 root root 0 Jan 1 1970 isp.1
drwxr-xr-x 3 root root 0 Jan 1 1970 mc
drwxr-xr-x 2 root root 0 Jan 1 1970 memblock
drwxr-xr-x 3 root root 0 Jan 1 1970 mmc0
drwxr-xr-x 2 root root 0 Jan 1 1970 mmc1
drwxr-xr-x 2 root root 0 Jan 1 1970 msenc
drwxr-xr-x 6 root root 0 Jan 1 1970 nvmap
drwxr-xr-x 4 root root 0 Jan 1 1970 pinctrl
drwxr-xr-x 10 root root 0 Jan 1 1970 pm_domains
-r–r--r-- 1 root root 0 Jan 1 1970 powergate
-r–r--r-- 1 root root 0 Jan 1 1970 pwm
drwxr-xr-x 13 root root 0 Jan 1 1970 regmap
drwxr-xr-x 38 root root 0 Jan 1 1970 regulator
-rw-r–r-- 1 root root 0 Jan 1 1970 sched_features
drwxr-xr-x 3 root root 0 Jan 1 1970 sdhci-tegra.2
drwxr-xr-x 3 root root 0 Jan 1 1970 sdhci-tegra.3
-rw-r–r-- 1 root root 0 Jan 1 1970 shrinker
-r–r--r-- 1 root root 0 Jan 1 1970 suspend_stats
-rwxr-xr-x 1 root root 0 Jan 1 1970 suspend_time
–w------- 1 root root 0 Jan 1 1970 syncevent_regulators
drwxr-xr-x 5 root root 0 Jan 1 1970 tegra_actmon
-r–r--r-- 1 root root 0 Jan 1 1970 tegra_ahci
drwxr-xr-x 2 root root 0 Jan 1 1970 tegra_core_cap
drwxr-xr-x 2 root root 0 Jan 1 1970 tegradc.0
drwxr-xr-x 2 root root 0 Jan 1 1970 tegradc.1
drwxr-xr-x 2 root root 0 Jan 1 1970 tegra_dsi
-r–r--r-- 1 root root 0 Jan 1 1970 tegra_dtv
drwxr-xr-x 2 root root 0 Jan 1 1970 tegra_emc
-r–r--r-- 1 root root 0 Jan 1 1970 tegra_gpio
drwxr-xr-x 2 root root 0 Jan 1 1970 tegra_hdmi
drwxr-xr-x 2 root root 0 Jan 1 1970 tegra_host
drwxr-xr-x 2 root root 0 Jan 1 1970 tegra_hotplug
drwxr-xr-x 2 root root 0 Jan 1 1970 tegra_latency
drwxr-xr-x 2 root root 0 Jan 1 1970 tegra_mipi_cal
-rw-rw-r-- 1 root root 0 Jan 1 1970 tegra_pinctrl
-r–r--r-- 1 root root 0 Jan 1 1970 tegra_pinctrl_drive
-r–r--r-- 1 root root 0 Jan 1 1970 tegra_pinctrl_reg
drwxr-xr-x 2 root root 0 Jan 1 1970 tegra_pm_core
drwxr-xr-x 4 root root 0 Feb 2 00:38 tegra_simon
drwxr-xr-x 3 root root 0 Jan 1 1970 tegra_smmu
drwxr-xr-x 2 root root 0 Jan 1 1970 tegra_soctherm
drwxr-xr-x 2 root root 0 Jan 1 1970 tegra_throttle
drwxr-xr-x 6 root root 0 Jan 1 1970 tracing
drwxr-xr-x 2 root root 0 Jan 1 1970 tsec
drwxr-xr-x 3 root root 0 Jan 1 1970 usb
drwxr-xr-x 2 root root 0 Feb 2 00:38 vi
drwxr-xr-x 2 root root 0 Feb 2 00:38 vi.0
drwxr-xr-x 3 root root 0 Jan 1 1970 vic03.0
-r–r--r-- 1 root root 0 Jan 1 1970 wake_irq
-r–r--r-- 1 root root 0 Jan 1 1970 wakeup_sources

Even the “file” /sys/kernel/debug/clock/override.gbus/rate is there,
nevertheless I get:

ubuntu@tegra-ubuntu:~$ sudo su
[sudo] password for ubuntu:
root@tegra-ubuntu:/home/ubuntu# ls -l /sys/kernel/debug/clock/override.gbus/rate
-rw-r–r-- 1 root root 0 Jan 1 1970 /sys/kernel/debug/clock/override.gbus/rate
root@tegra-ubuntu:/home/ubuntu# echo 852000000 > /sys/kernel/debug/clock/override.gbus/rate
bash: echo: write error: No such file or directory
root@tegra-ubuntu:/home/ubuntu#

OK, the solution to the problem of maxing the GPU clock has been that I had no display connected to
the TK1.
Now I have a display connected and set the gbus and emc frequency to the maximum value.

Nevertheless, gstreamer time has not become shorter:

gst-launch-0.10 videotestsrc pattern=gamut num-buffers=250 ! ‘video/x-raw-yuv,format=(fourcc)I420,width=1920,height=1080,framerate=(fraction)30/1’ ! nv_omx_h264enc ! video/x-h264 ! avimux ! fakesink
Setting pipeline to PAUSED …
Pipeline is PREROLLING …
NvMMLiteOpen : Block : BlockType = 4
===== MSENC =====
NvMMLiteBlockCreate : Block : BlockType = 4
Pipeline is PREROLLED …
Setting pipeline to PLAYING …
New clock: GstSystemClock
Got EOS from element “pipeline0”.
Execution ended after 15734764746 ns.
Setting pipeline to PAUSED …
Setting pipeline to READY …
Setting pipeline to NULL …
Freeing pipeline …

@juergenw , Can you please update which release are you using? 21.3?

Because i see just ~ 6 seconds for the same pipeline on 21.3 with all default out of the box settings on jetson-TK1(I have a HDMI TV as display connected).

ubuntu@tegra-ubuntu:~$ gst-launch-0.10 videotestsrc pattern=gamut num-buffers=250 ! ‘video/x-raw-yuv,format=(fourcc)I420,width=1920,height=1080,framerate=(fraction)30/1’ ! nv_omx_h264enc ! video/x-h264 ! a
vimux ! fakesink
Inside NvxLiteH264DecoderLowLatencyInitNvxLiteH264DecoderLowLatencyInit set DPB and MjstreamingSetting pipeline to PAUSED …
Pipeline is PREROLLING …
Framerate set to : 30 at NvxVideoEncoderSetParameterNvMMLiteOpen : Block : BlockType = 4
===== MSENC =====
NvMMLiteBlockCreate : Block : BlockType = 4
===== MSENC blits (mode: 1) into tiled surfaces =====
Pipeline is PREROLLED …
Setting pipeline to PLAYING …
New clock: GstSystemClock
Got EOS from element “pipeline0”.
Execution ended after 6280575303 ns.
Setting pipeline to PAUSED …
Setting pipeline to READY …
Setting pipeline to NULL …
Freeing pipeline …

With 19.3 release I’m getting the same perf as reported by juergenw and with 21.3 I’m getting the same perf as reported by Madhava.

So 44 FPS with 21r3:

ubuntu@tegra-ubuntu:~$ time gst-launch-0.10 videotestsrc pattern=gamut num-buffers=250 ! 'video/x-raw-yuv, width=(int)1920, height=(int)1080, framerate=(fraction)120/1' ! nv_omx_h264enc ! video/x-h264 ! avimux ! fakesink sync=false
Inside NvxLiteH264DecoderLowLatencyInitNvxLiteH264DecoderLowLatencyInit set DPB and MjstreamingSetting pipeline to PAUSED ...
Pipeline is PREROLLING ...
Framerate set to : 120 at NvxVideoEncoderSetParameterNvMMLiteOpen : Block : BlockType = 4 
===== MSENC =====
NvMMLiteBlockCreate : Block : BlockType = 4 
NvH264MSEncInit: Quality overridden to Low (frame_rate 120.000000) (frame_mb_size 8160)
===== MSENC blits (mode: 1) into tiled surfaces =====
Pipeline is PREROLLED ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
Got EOS from element "pipeline0".
Execution ended after 5377446570 ns.
Setting pipeline to PAUSED ...
Setting pipeline to READY ...
Setting pipeline to NULL ...
Freeing pipeline ...

real    0m5.580s
user    0m4.690s
sys     0m2.110s

Hi Madhava, kulve,

I can confirm that my board is at release 19.2. I am going to update to the new release. Thank you for pointing this out!

Hi all,

These results shows that the performance of h264 encoder can’t achieve 1080P60 even at release 21.3. Is it normal? Because I saw the Tegra Data Sheet shows it supports 1080P60 h264 encoding.

The videotestsrc consumes CPU and memory bandwidth so to test only the encoder performance, please try with a raw YUV file produced by the HW decoder.