Raspberry Pi: VLC – Failed To Allocate CMA Buffer

Recently i got an issue on my RPi4 with a VLC media player that was crashing if i was trying to switch between a fullscreen and a windowed mode and scroll a video.

Also i couldn’t play some movies as the VLC was playing the audio track only but not the video one.

In the both cases if i was running the VLC from a terminal there were errors about some failures to allocate buffer objects from a CMA.

Cool Tip: HDMI hotplug settings on a Raspberry Pi! Read more →

Raspberry Pi: VLC – Failed To Allocate CMA Buffer

If the VLC media player on the Raspberry Pi is crashing with the errors as follows (mainly while switching between a fullscreen and a windowed mode):

DRM_IOCTL_MODE_CREATE_DUMB failed: Cannot allocate memory
Failed to create scanout resource
usrvcsm: [vcsm_malloc_cache]: [VLC frame]: ioctl mem-alloc FAILED [-1] (hdl: 0)
[9f331378] mmal_codec filter error: Failed to alloc CMA buf: fmt=Z420, size=1044480
Segmentation fault

Or if is playing the audio only but not the video track with the errors like these:

[000bd658] main audio output error: cannot setup filtering pipeline
[a8b2bae0] main decoder error: failed to create audio output
usrvcsm: [vcsm_malloc_cache]: [ffmpeg uncached]: ioctl mem-alloc FAILED [-1] (hdl: 0)
Unable to alloc 2219520 bytes from VCSM for ffmpeg uncached
[hevc @ 0xa8b49d60] Failed to allocate col mv buffer
[hevc @ 0xa8b49d60] Failed setup for format rpi: hwaccel initialisation returned error
[a8b0f1b0] mmal_avcodec decoder error: Frame has no attached CMA buffer
[a8b0f1b0] main decoder error: buffer deadlock prevented

I got resolved both of these issues on my RPi4 by starting a raspi-config and selecting the OpenGL driver:

$ sudo raspi-config

Go to “Advanced Options” → “GL Driver” and select the “GL (Fake KMS) OpenGL desktop driver with fake KMS”.

Reboot the Raspberry Pi to apply the modifications.

Cool Tip: Shutdown & reboot a Raspberry Pi safely! Read more →

Was it useful? Share this post with the world!

Leave a Reply