Hi,
I wrote a program in which I use the Jetson multimedia API to capture frames and then encode them. I’m actually very happy with the latencies.
But i noticed that the following command leads to an increase in NVENC latency (i nee to execute the command to use drm for another part of my Project):
sudo systemctl stop gdm
Here are my average latencies before stopping the gdm (~12ms for encoding):
INFO: check(): (line:142) Enc Bitrate avg: 0.930888 Mbit/s
INFO: check(): (line:142) SOF to CR time Δ avg: 16.316132 ms
INFO: check(): (line:142) SOF to CL time Δ avg: 16.326601 ms
INFO: check(): (line:142) SOF to Comb time Δ avg: 19.154358 ms
INFO: check(): (line:142) SOF to Enc time Δ avg: 31.073876 ms
INFO: check(): (line:142) Enc Bitrate avg: 0.966408 Mbit/s
INFO: check(): (line:142) SOF to CR time Δ avg: 16.300697 ms
INFO: check(): (line:142) SOF to CL time Δ avg: 16.306919 ms
INFO: check(): (line:142) SOF to Comb time Δ avg: 19.146263 ms
INFO: check(): (line:142) SOF to Enc time Δ avg: 31.172676 ms
INFO: check(): (line:142) Enc Bitrate avg: 0.896328 Mbit/s
INFO: check(): (line:142) SOF to CR time Δ avg: 16.360031 ms
INFO: check(): (line:142) SOF to CL time Δ avg: 16.366589 ms
INFO: check(): (line:142) SOF to Comb time Δ avg: 19.196853 ms
INFO: check(): (line:142) SOF to Enc time Δ avg: 31.351798 ms
Here are my latencies after stopping the gdm (~51ms):
INFO: check(): (line:142) Enc Bitrate avg: 0.922920 Mbit/s
INFO: check(): (line:142) SOF to CL time Δ avg: 16.286754 ms
INFO: check(): (line:142) SOF to CR time Δ avg: 16.296088 ms
INFO: check(): (line:142) SOF to Comb time Δ avg: 19.145151 ms
INFO: check(): (line:142) SOF to Enc time Δ avg: 70.346858 ms
INFO: check(): (line:142) Enc Bitrate avg: 0.920184 Mbit/s
INFO: check(): (line:142) SOF to CL time Δ avg: 16.289686 ms
INFO: check(): (line:142) SOF to CR time Δ avg: 16.296840 ms
INFO: check(): (line:142) SOF to Comb time Δ avg: 19.147402 ms
INFO: check(): (line:142) SOF to Enc time Δ avg: 70.438493 ms
INFO: check(): (line:142) Enc Bitrate avg: 1.248536 Mbit/s
INFO: check(): (line:142) SOF to CL time Δ avg: 16.290126 ms
INFO: check(): (line:142) SOF to CR time Δ avg: 16.293413 ms
INFO: check(): (line:142) SOF to Comb time Δ avg: 19.130861 ms
INFO: check(): (line:142) SOF to Enc time Δ avg: 70.387857 ms
I tried to double check it with the 01_video_encode example. There it seems to fix the framerate to 60fps:
Before stopping gdm:
Creating Encoder in blocking mode
Opening in BLOCKING MODE
NvMMLiteOpen : Block : BlockType = 4
===== NvVideo: NVENC =====
NvMMLiteBlockCreate : Block : BlockType = 4
875967048
842091865
H264: Profile = 66 Level = 51
NVMEDIA: Need to set EMC bandwidth : 846000
NvVideo: bBlitMode is set to TRUE
Could not read complete frame from input file
File read complete.
Got 0 size buffer in capture
----------- Element = enc0 -----------
Total Profiling time = 1.50695
Average FPS = 392.182
Total units processed = 592
Average latency(usec) = 23638
Minimum latency(usec) = 7099
Maximum latency(usec) = 25128
-------------------------------------
App run was successful
After stopping gdm:
Creating Encoder in blocking mode
Opening in BLOCKING MODE
NvMMLiteOpen : Block : BlockType = 4
===== NvVideo: NVENC =====
NvMMLiteBlockCreate : Block : BlockType = 4
875967048
842091865
H264: Profile = 66 Level = 51
NVMEDIA: Need to set EMC bandwidth : 846000
NvVideo: bBlitMode is set to TRUE
Could not read complete frame from input file
File read complete.
Got 0 size buffer in capture
----------- Element = enc0 -----------
Total Profiling time = 9.83096
Average FPS = 60.1162
Total units processed = 592
Average latency(usec) = 165437
Minimum latency(usec) = 117693
Maximum latency(usec) = 245793
-------------------------------------
App run was successful
That is a real dealbreaker for me. What could be the issue here? How can i avoid it so the NVENC behaves the same after stopping the gdm?
Device: Orin NX 16G in MAXN_SUPER Mode
L4T Version: R36 (release), REVISION: 4.3, GCID: 38968081, BOARD: generic, EABI: aarch64, DATE: Wed Jan 8 01:49:37 UTC 2025
JETPACK Version: 6.2.1