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


#1

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

Shreyas


#2

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 testcam.py
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 “testcam.py”, line 4, in _
_ camera = PiCamera()_
_ File “/usr/lib/python2.7/dist-packages/picamera/camera.py”, line 417, in init_
_ self.init_preview()
_ File “/usr/lib/python2.7/dist-packages/picamera/camera.py”, line 496, in init_preview
_ self, self.camera.outputs[self.CAMERA_PREVIEW_PORT])
_ File “/usr/lib/python2.7/dist-packages/picamera/renderers.py”, line 512, in init_
_ self.renderer.connect(source)_
_ File “/usr/lib/python2.7/dist-packages/picamera/mmalobj.py”, line 1467, in connect_
_ self.connection = MMALConnection(source, self.inputs[0])
_ File “/usr/lib/python2.7/dist-packages/picamera/mmalobj.py”, line 1280, in init_
_ prefix=“Failed to enable connection”)_
_ File “/usr/lib/python2.7/dist-packages/picamera/exc.py”, line 157, in mmal_check_
_ raise PiCameraMMALError(status, prefix)_
picamera.exc.PiCameraMMALError: Failed to enable connection: Out of resources (other than memory)

testcam.py
from picamera import PiCamera
from time import sleep

camera = PiCamera()

camera.start_preview()
sleep(10)
camera.stop_preview()


#3

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.


#4

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

Regards
Shreyas


#5

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


#6

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

#7

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