Camera not working - mmal: mmal_vc_component_enable: failed to enable component: ENOSPC


I’ve installed a new camera on my Pi Zero and when I run raspistill I get an error?

Note; I have enable the camera using raspi-config.

pi@raspberrypi:~/Documents/projects/zeroborg $ raspistill -o output.jpg
mmal: mmal_vc_component_enable: failed to enable component: ENOSPC
mmal: camera component couldn’t be enabled
mmal: main: Failed to create camera component
mmal: Failed to run camera app. Please check for firmware updates



I did a firmware update and “raspistill -o output.jpg” is working now. (I did think firmware updates under Raspian were handle by the commands below

sudo apt-get update
sudo apt-get upgrade

I’ve done an explicit “sudo rpi-update” now and “raspistill -o output.jpg” works but when I try and run a video test I get an error as below:

pi@raspberrypi:~/Documents/projects/zeroborg $ python
mmal: mmal_vc_port_enable: failed to enable port vc.null_sink:in:0(OPQV): ENOSPC
mmal: mmal_port_enable: failed to enable connected port (vc.null_sink:in:0(OPQV))0xce6ee0 (ENOSPC)
mmal: mmal_connection_enable: output port couldn’t be enabled
Traceback (most recent call last):
_ File “”, line 4, in _
_ camera = PiCamera()_
_ File “/usr/lib/python2.7/dist-packages/picamera/”, line 417, in init_
_ self.init_preview()
_ File “/usr/lib/python2.7/dist-packages/picamera/”, line 496, in init_preview
_ self,[self.CAMERA_PREVIEW_PORT])
_ File “/usr/lib/python2.7/dist-packages/picamera/”, line 512, in init_
_ self.renderer.connect(source)_
_ File “/usr/lib/python2.7/dist-packages/picamera/”, line 1467, in connect_
_ self.connection = MMALConnection(source, self.inputs[0])
_ File “/usr/lib/python2.7/dist-packages/picamera/”, line 1280, in init_
_ prefix=“Failed to enable connection”)_
_ File “/usr/lib/python2.7/dist-packages/picamera/”, line 157, in mmal_check_
_ raise PiCameraMMALError(status, prefix)_
picamera.exc.PiCameraMMALError: Failed to enable connection: Out of resources (other than memory)
from picamera import PiCamera
from time import sleep

camera = PiCamera()



It might be your memory split, can you fire up the Raspberry Pi Configuration tool from the menu and see what’s set?

You can also use raspi-config at the terminal.

You shouldn’t ever need to do this, it subverts the normal upgrade process, installing pre-release software and can easily cause more problems than it solves.


  1. memory split is 64
  2. how do I roll back the sudo rpi-update so i’m back on the release branch?



I’m also looking for an answer. Did you ever find out how to do this?


I’m probably too late, but it can’t hurt to have these instructions in as many places as possible.

If you’ve stuffed up your Pi with the insidious rpi-update utility, you can get yourself back on the rails with:

sudo apt-get update
sudo apt-get install --reinstall libraspberrypi0 libraspberrypi-{bin,dev,doc} raspberrypi-bootloader
sudo reboot


I have same problem. How to fix this just use camera.close() only.