This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

PROCESSOR-SDK-AM57X: Running Engine_open from ffmpeg

Part Number: PROCESSOR-SDK-AM57X


Hi,


I am using the AM572x evm with the default TI linux rt image and I am trying to use libdce with ffmpeg.  I am running into an EACCESS error in the Engine_open() command.

#include <dce/libdce.h>
#include <dce/xdc/std.h>
#include <dce/ti/sdo/ce/Engine.h>
#include <dce/ti/sdo/ce/video3/viddec3.h>
#include <drm/omap_drm.h>
#include <libdrm/omap_drmif.h>

self->device = dce_init();
if (self->device == NULL)
{
	goto fail;
}

self->engine = Engine_open((String) "ivahd_vidsvr", NULL, &rc);
if (self->engine == NULL)
{
	goto fail;
}

If I follow the code, I find that I am getting an error from the ioctl in:

libdrm/omap/omap_drm.c: omap_bo_new_impl()

drmCommandWriteRead(dev->fd, DRM_OMAP_GEM_NEW, &req, sizeof(req))

The ioctl is failing with -13 (#define EACCES 13 /* Permission denied */). 

Is there a reason I might be getting a permission error for DRM_OMAP_GEM_NEW?  I see from the debug I have added that ioctls from dce_init are succeeding.

I also see that Engine_open() succeeds when trying samples to test the ducati engine as below.

gst-launch-1.0 -e videotestsrc num-buffers=640 is-live=true ! 'video/x-raw,format=(string)NV12,width=720,height=420,framerate=(fraction)30/1' ! ducatimpeg4enc ! fakesink sync=true

Thanks,
Matt

  • Hi,

    I will check with the team & get back.

    Thanks

    Gaviraju

  • Hi Matt,

    Here is a simple reference code to help you move further: https://git.ti.com/cgit/glsdk/omapdrmtest/tree/viddec3test.c#n189

    Please pay attention the the DRM interactions in the disp_open function too.

    I hope you can follow the same sequence.

    Regards

    Karthik

  • Hi Karthik,

    I have tried your suggestion and it did not help (Code is below).  I still get the same EACCES failure in omap_bo_new() -> drmCommandWriteRead() when trying to use the ioctl for DRM_OMAP_GEM_NEW.  I tried creating my own standalone test executable with my original post test code above and it succeeds to Engine_open.  Are there any reasons I might be getting EACCES as a failure?

    // begin disp_open
    	self->drm_fd = drmOpen("omapdrm", NULL);
    	if (self->drm_fd < 0)
    		goto fail;
    
    	self->device = omap_device_new(self->drm_fd);
    	if (!self->device)
    		goto fail;
    
    // end disp_open
    
    	dce_set_fd(self->drm_fd);
    
    	dev = dce_init();
    	if (dev == NULL)
    		goto fail;
    
    	self->input_size = 560 * 400;
    	self->input_bo = omap_bo_new(self->device, self->input_size, OMAP_BO_WC);
    	self->input = omap_bo_map(self->input_bo);
    
    	self->engine = Engine_open((String) "ivahd_vidsvr", NULL, &rc);
    	if (self->engine == NULL)
    		goto fail;

  • Hi,

    Please follow the sequence provided in the below example

    After following the above sequence, if the issue is not resolved then recommending to run the "videnc2test" application to make sure the issue is replicated here or not

    Thanks

    Gaviraju

  • Hi Gaviraju,

    I run the sequence in the sample code above and I see the same issue in encoder_init() as I have described above.  What I need to understand is why I am running into an EACCESS error in the Engine_open() command.

    If I follow the code, I find that I am getting an error from the ioctl in:

    libdrm/omap/omap_drm.c: omap_bo_new_impl()

    drmCommandWriteRead(dev->fd, DRM_OMAP_GEM_NEW, &req, sizeof(req))

    The ioctl is failing with -13 (#define EACCES 13 /* Permission denied */). 

    What is the cause for getting a permission error for DRM_OMAP_GEM_NEW?  I see from the debug I have added that ioctls from dce_init are succeeding.

  • Hi Matt,

    There are a few things that we can do to take this further:

    a. Can you please confirm that you can run all the other existing applications such as viddec3test or videnc2test (one of them should be sufficient) and get the desired result?

    b. If you are not able to do run it, then we can check the same behavior on the non-rt configuration.

    c. Lastly, will you be able to create a small test case with build instructions and send it over to us to debug this further - we will use the failing configuration to debug further at our end.

    Regards

    Karthik

  • I am working on creating a test case as specified in step c.  I will reply again with a good sample.

    Thank you in advance,