Pipeline failure with nvdrmvideosink when hdmi disconnected

• Hardware Platform (Jetson / GPU)
Xavier NX
• DeepStream Version
6.0
• JetPack Version (valid for Jetson only)
4.6
• TensorRT Version
8.0.1.6
• NVIDIA GPU Driver Version (valid for GPU only)
• Issue Type( questions, new requirements, bugs)
Questions

I have a Gstreamer Deepstream pipeline with a tee into two nvdrmvideosink display outputs. A basic example is here (the real pipeline is more complicated but this suffices for the behavior I’m trying to get around):

GST_DEBUG=3 gst-launch-1.0 videotestsrc ! tee name=disp_t disp_t. ! queue ! nvvidconv ! nvdrmvideosink conn-id=0 sync=false disp_t. ! queue ! nvvidconv ! nvdrmvideosink conn-id=1 sync=false 

If both HDMI’s are connected then the pipeline runs fine, however if one of the HDMI’s is disconnected then I get the error:

ERROR         nvdrmvideosink gstnvdrmvideosink.c:1009:gst_nvdrmvideosink_stop:<nvdrmvideosink1> Set plane to NULL failed

I need my pipeline to still function and display to the HDMI at conn-id=0 even if the HDMI at conn-id=1 is disconnected. Is it possible to do this in some way?

I’ve looked online and at the options available for the nvdrmvideosink plugin but have been unable to find anything. Creating a dynamic pipeline which catches this error, NULLs out the pipeline and recreates it with just one nvdrmvideosink display output is also probably not a viable solution, due to a separate unresolved issue, so I’m hoping for an easier/straightforward solution that I’ve missed.

Thanks

Please read the code for “tee” gstreamer/plugins/elements/gsttee.c at master · Kurento/gstreamer (github.com)

The “tee” feeds the same buffer to the two output branches. And in your pipeline, there is no buffer copy(no new buffer) in any of the branch. When one branch stops, there is no sink to unref the buffer while the buffer has been "ref"ed twice in tee. Then the whole pipeline is blocked.

Please configure the nvvidconv’s output by add ‘capsfilter’ to force the nvvidconvs to output different “caps”, then the nvvidconv will copy the buffer, the two branches are decoupled.

Thanks @Fiona.Chen , I will give it a try.

(Responding now that I’m back from vacation and have had a chance to work on this - apologies for the late response.)

Unfortunately I’m unable to get this working even after trying a variety of different pipeline elements and capabilities in order to copy the buffer. I mostly get the Set plane to NULL failed error, and other times “internal data stream” errors. I was able to get it working once using a png and the imagefreeze element where it just didn’t display to the missing hdmi connection, but using either videotestsrc or nvarguscamerasrc results in crashing pipelines no matter what I do.

I think this is probably not doable with these plugins as they are now, though it’s probably possible using a custom coded solution copying the buffers like you mention. For now I’ve just coded a python script which tracks the state of the hdmi connections directly, and then kills and relaunches appropriate gstreamer pipelines. It’s far from ideal but it’ll have to do, as a simpler solution doesn’t seem possible at the moment.

If anyone succeeds in creating a simple pipeline that still runs and just doesn’t display if one of the hdmi connections is missing (and starts displaying to that hdmi if connected), please respond as I would love to know if I’m still doing something wrong, thanks.