If while trying to play a video on the RaspberryPi, in particular with Kodi, the video doesn’t play and you get this error on the terminal:
[CGPUMEM]: ioctl mem-alloc FAILED [-1]
Then hopefully this post will help you.
You may have read elsewhere that you should increase your GPU memory in
/boot/config.txt, then add
But that’s not enough. You also need to increase the limit of the contiguous memory allocator. In
/boot/cmdline.txt add the option
cma=256M. Then reboot and you should be fine.
That solved the problem! Thanks a lot!
Cannot Allocate Memory
[3:45:35.833744413]  INFO RPI raspberrypi.cpp:611 Sensor: / base/soc/i2c0mux/i2c@1/arducam@0c – Selected mode: 5344×4012-pRAA [3:45:35.948442507]  ERROR V4L2 v4l2_videodevice.cpp:1126 /dev/video14[17:cap]: Unable to request 4 buffers: Cannot allocate memory [3:45:35.948551358]  ERROR RPI raspberrypi.cpp:808 Failed to allocate buffers ERROR: *** failed to start camera ***
If your RPi has enough RAM, you can try