Orin Nano With NvDRM Overlay

I am trying to use the Nvidia DRM API with the Orin Nano. I am using the sample “08_video_dec_drm” as the basis for my project. When I attempt to call drmModeSetPlane on plane ID 1 (I think the overlay plane), this call returns -EINVAL. Calling drmModeSetPlane on plane ID 0 (I think the primary plane), the call succeeds and the graphics are displayed as expected. In short, calls to plane 0 work as expected, calls to plane 1 fail.
Additional Info:

  • When I call drmModeGetResources(), the number of planes returned is 2
  • If I use the sample 08_video_dec_drm as supplied (unmodified), the overlay also fails (it displays the H264 video on the primary plane, but the overlay fails)
  • I am using Multimedia API R35.3.1
  • I am using kernel 5.10.104-tegra
  • I am using the Orin Nano dev kit

Questions:

  • How can I get this sample working with the Orin Nano? Could you point me any instructions on how to enable extra DRM planes on the Orin Nano?
  • Can it be run on the Orin Nano? Does it have sufficient DRM planes?

Any help is appreciated.

Hi,
Please share a patch to 08_video_dec_drm sample. So that we can set up AGX Orin developer kit and give it a try.

Thanks for your response. I shall get you a copy of my project so you can see. It will be much later in the day.
However, if you simply compile and run the sample 08_video_dec_drm and run it on the Orin Nano, you will see it fails. Currently in the sample’s code, the return value of ::setPlane() is not checked:
On line 310 of video_dec_drm.cpp:
ctx->drm_renderer->setPlane(overlay_plane_index…);
If you store the return value of this call, it returns -EINVAL and the overlay graphics are not displayed. So, I think you will see the problem using the sample code as-is.
The previous call to setPlane() on line 268 using the primary plane ID does indeed work. It seems to me the second call dislikes the overlay plane index, which has a value of 1. Is a plane index of 1 correct for the Orin Nano?

I just want to reiterate I am using the Orin Nano with the Orin Nano dev kit. You mention you will try it on an Orin AGX dev system, which you would know better than me if that is comparable test with the Orin Nano.

video_dec_drm.patch (843 Bytes)
Attached is a patch file that you can apply to video_dec_drm.cpp in the 08_video_dec_drm sample that will show you the error. When the call to ::setPlane() fails it will output debug things to standard error.
This is running on a Orin Nano using the Orin Nano dev kit.

Edited to add:
In order to get the DRM working, I use the following command:
$ sudo modprobe nvidia-drm modeset=1
This was listed as the thing to do for Orin AGX. Is this command correct for Orin Nano as well?

Hi nluck,

After apply your patch, we can’t reproduce issue on AGX Orin and Orin-Nano.
List our steps for you reference:

  1. Apply “video_dec_drm.patch” on 08_video_dec_drm samples
  2. Build
  3. Disabled Ubuntu Desktop:
    $ sudo systemctl stop gdm
    $ sudo loginctl terminate-seat seat0
  4. Install nvidia-drm driver:
    $ sudo modprobe nvidia-drm modeset=1
  5. Run:
    $ sudo ./video_dec_drm ../../data/Video/sample_outdoor_car_1080p_10fps.h264 H264 --disable-ui

Hi Carol,
Thank you for taking the time to look at this. I appreciate it.
I think the issue with reproducing my problem is you are running the demo with the --disable-ui flag. This flag disables the overlay rendering loop. If you look in video_dec_drm.cpp on line 526, you will see the --disable-ui flag causes the overlay rendering thread to be disabled, which means the code in my patch will never be called. So, in effect, you are only testing the ::setPlane() on the primary plane (which works) and not testing the ::setPlane() on the overlay plane (which does not work).

I use this command line to run the demo:
$ sudo ./video_dec_drm ~/Downloads/test.h264 H264
If you do it this way, both the video render and overlay render threads will start and you will see the issue. Could you try it in this manner?

Thanks again.

Hi nluck,

I tried to run this command, but still pass on our side.
$ sudo ./video_dec_drm ../../data/Video/sample_outdoor_car_1080p_10fps.h264 H264

Check again your path, there are no different with default video_dec_drm.cpp.
Can you check again with your attached file? thanks!

Hi Carol,
This is really quite puzzling.



I’ve uploaded pictures of the execution when I run it.

The first picture shows the playback of my test video. You can see the video is rendered on the primary plane, but the decoration (which is the point of the demo, a moving block of color) is not present. In addition to the video, there should be an Nvidia logo and a moving block of color. If you use the --disable-video flag, which prevents the video data from using plane 0, then you will see the Nvidia logo but not the moving color block. Using the Orin Nano and this demo, two things are never overlaid upon the screen as they should be.

The second picture shows the terminal with the error output, where the overlay is not drawn because of the -EINVAL failure attempting to ::setPlane() on plane 1.

Could please you post a picture of what the output looks like on your display? I’d like to see what a working demo looks like on your system.

Is there a difference with our test setups? I am using:

  • Orin Nano Dev Kit
  • Operating system on SD card. The OS is the standard demo SD card image I downloaded from NVidia.
  • A single DisplayPort display attached to the dev kit
  • Is there some installed package that is required that I am missing?

Thanks again for your assistance with this.

I forgot I had a original Jetson Nano dev kit. I set it up and ran the 08_video_dec_drm sample on it and it works as expected. I have attached a picture of its execution.

As you can see, all the overlay elements are there: the video, the Nvidia logo, and moving color block. All the overlay planes work on the original Nano, but do not work on the Orin Nano.

Thanks again for your assistance. Hopefully this will shed some light on the issue for you.

Hi,
We can observe the issue on AGX Orin and Orin Nano. The background is whole green. We will debug further and see if it can be supported in future release.

Awesome, thanks. If I can help by trying any patches, etc, please let me know and I’ll be glad to try it out.

Hi, can I check whether there is any update regarding to this issue?

Hi,
We have confirmed single video plane is supported on Orin series. Please check if you can do video playback with single plane in full screen.

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