VIDIOC_REQBUFS Error 12 when opening multiple v4l2 sources

I’m using an 8-channel PCI-based framegrabber on Nvidia TX1 dev kit. I’m using this driver along with it. I can play up to 3/4 v4l2 camera feeds comfortably using mplayer, streamer or VLC but I always get a memory allocation error when I start playing the 5th camera feed, irrespective of the software I use to play it. I also wrote my own program to capture and display v4l2 streams but I’m getting the same problem. The exact error is an error 12 given by the ioctl command:

ioctl(fd, VIDIOC_REQBUFS, &req)

I have tried this framegrabber and edvice on a standalone PC and it works perfectly fine.

Any suggestions would be helpful.

If I understand your case correctly, you are using the framegrabber to capture camera stream and pass into mplayer or VLC for rendering, right?
In this case, the ioctl should hook into framegrabber driver to allocate buffer. Please figure out what error 12 signifies from there.

It wasn’t a driver related issue as I tested it on a different desktop machine. I fixed the issue by setting CONFIG_CMA_SIZE_MBYTES=32 while building the kernel.