V4L2 M2M Encoding Custom Root Filesystem Issues

Hey, I’ve run into some issues the V4L2 M2M Encoding when moving from the sample rootfs to a custom one. When I make a call to the /dev/nvhost-msenc device using the libnv_v4l2 library from within the custom rootfs, the library prints the following error message when using VIDIOC_QUERYCAP.

libv4l2: error getting capabilities: In appropriate ioctl for the device.

There is a kernel message which is printed just before this, but I’m not certain this is related. (And have suspicions that it is not.

(NULL device*): nvhost_channelctl: invalid CMD 0x80685600

I’m using the sample Kernel, and have run the apply_bimaries script on the custom rootfs, so I’m uncertain what I’m missing for this error to occur. I can also see the device itself is being initialised

falcon 154c0000.nvenc: initialized

Can anyone point me to some information as to what is required for the hardware encoder to be successfully used?

I believe I have misslead a little with this. It appears this error is being thrown on v4l2_open, not when querying capabilities. I didn’t think that would even be possible.

Hi,
We have sample 01_video_encode for video encoding. Are you able to run it successfully on the custom rootfs?

Dane. I have been unable to get video_encode to run successfully on your rootfs because the test data does not seem to be within the tegra_multimedia_api folder. Every raw YUV420 file of mine I have tried to put through it has thrown an error.

When I compiled video_decode to do it by first decoding the h264 video, which is available, it threw a seg fault when the rendering window was opened.

I had to remove three libraries from the makefile to get them to compile because they were not present in the rootfs, -lnvinfer, -lnvparsers and -lcudart. Not certain if this was relevant.

And misleading you again. I now have both the encode and decode working on your sample rootfs, just testing on mine now. And thanks I had a library in the wrong spot, which was not loading and then failing silently. I’m on the hunt for which library it was now.

So after some digging, it seems like libEGL and libGLdispatch are the culprits. libnvbuf_utils uses them and it is used as it performs the encoder setup. Once these were placed in the appropriate directory, everything worked fine.

Hello [young.nathan.t],

I am facing a very similar issue, where did you have to place those libraries to get it to work?

Thanks

Basically, the libraries need to be present in a directory that they can be loaded. I had to link all of the libraries to /usr/lib/ in my filesystem, because I couldn’t change the library load path.