Issue with nvdrmvideosink NULL state

Hello, when setting a pipeline that uses nvdrmvideo to the NULL state I’m finding that the hdmi output shuts down. This is on L4T 32.7.1, it doesn’t do it with L4T 32.6.1. Here’s a short piece of code that illustrates the issue:

/* Initialise GStreamer */
gst_init(&argc, &argv);

/* Build the pipeline */
pipeline = gst_parse_launch(
	"videotestsrc ! ""video/x-raw, width=(int)1280, height=(int)720"" ! nvdrmvideosink", 

/* Start playing */
gst_element_set_state(pipeline, GST_STATE_PLAYING);
g_print("Pipe state: PLAYING\n");

/* Set pipeline state to NULL */
gst_element_set_state(pipeline, GST_STATE_NULL);
g_print("Pipe state: NULL\n");

After hitting ‘enter’ at the first getchar() on L4T 32.6.1 the display blanks but remains stable. But on L4T 32.7.1 the display disconnects. This is making dynamically re-configuring a pipeline that use nvdrmvideo sink difficult.

Is this an intended change in behaviour? If so is there any way to modify the behaviour?

Best regards,

Please try this solution:
Exiting nvdrmvideosink causes display to go blank - #3 by DaneLLL

Thanks for the suggested solution. It works quite well. I was thinking it would just wake the hdmi output up again after disconnect but in fact issuing the echo immediately after setting the pipeline to NULL stops it disconnecting.

Best regards,

It seems that I spoke too soon. Having tried a different monitor the hdmi output does indeed briefly shut down. This is an issue for us as we have a menu on plane 2 and some osd on plane 1 (nvdrmvideosink is on plane 0) and of course the whole display briefly blanks.

Is there any other way around this? Will this be fixed in the next L4T release?

Best regards,

There is a jetson_multimedia_api sample. Please try and see if it works:


And DRM has to be run without X11 or Wayland. Not sure if you disables Ubuntu desktop before running the command:

Ensure the Ubuntu desktop is disabled:
   $ sudo systemctl stop gdm
   $ sudo loginctl terminate-seat seat0

I tried the sample and it does indeed work although I’m struggling to see the relevance of this as regards the gstreamer plugin nvdrmvideosink causing the hdmi output to turn off when it is set to NULL state.

This is a distinct difference in behaviour between L4T 32.6.1 and L4T 32.7.1, easily reproducible with the simple test app in my first post.

System is booting to a text prompt - no X11 or Wayland running.

Best regards,

Please apply the patch and rebuild nvdrmvideosink:

@@ -998,19 +998,7 @@ gst_nvdrmvideosink_stop (GstBaseSink * base_sink)
       GST_DEBUG_OBJECT (sink, "Set crtc to NULL passed \n");
   } else {
-    guint crtc_id = sink->crtc_id;
-    guint pl_id = sink->plane_id;
-    guint nvheight = sink->height;
-    guint nvwidth = sink->width;
-    if (drmModeSetPlane (sink->fd, pl_id, crtc_id,
-            0, 0, 0, 0, nvwidth,
-            nvheight, 0, 0, (nvwidth) << 16, (nvheight) << 16)) {
-      GST_ERROR_OBJECT (sink, "Set plane to NULL failed\n");
-      return FALSE;
-    } else {
-      GST_DEBUG_OBJECT (sink, "Set plane to NULL passed \n");
-    }
   drmModeFreeConnector (sink->conn_info);

The source code is in
Jetson Linux R32.7.1 Release Page | NVIDIA Developer

L4T Driver Package (BSP) Sources

And also need this patch to Makefile:

@@ -31,7 +31,8 @@ SO_NAME :=
 DEST_DIR ?= /usr/lib/aarch64-linux-gnu/gstreamer-1.0
 SRCS := gstnvdrmvideosink.c \
-	util/drmutil.c
+	util/drmutil.c \
+	util/vt_switch.c
 INCLUDES += -I/usr/lib/aarch64-linux-gnu/glib-2.0/include/ \
 	    -I./util/ \
1 Like

Thanks very much for that, it works a treat!

Just a quick note that as well as needing to modify the Makefile the tarball is also missing nvbufsurface.h.

Best regards,

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.