NVMAP_IOC_FREE failed: Bad file descriptor

NvV4l2ElementPlane never calls v4l2_close() on buffers exported with VIDIOC_EXPBUF.
It’s quite unusual. I mean if I call open() I’m supposed to call close() later.

https://www.linuxtv.org/downloads/v4l-dvb-apis-old/vidioc-expbuf.html
“It is recommended to close a DMABUF file when it is no longer used to allow the associated memory to be reclaimed.”

I thought it’s a leak initially but if I close exported buffers I get one error message per buffer eventually:
NVMAP_IOC_FREE failed: Bad file descriptor

Could somebody confirm that exported MM buffers must not be closed?
I’m doublechecking, because, again, it’s quite unusual.

Hi,
On Nano, DMABUF is NvBuffer and we use APIs in nvbuf_utils.h to create and destroy buffers. We have implemented classes to run hardware acceleration in tegra_multimedia_api\samples\common\classes. Suggest you use the implementation.