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.
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
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?
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:
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?
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?
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?