Page 1 of 1

Camera not working - failed to enable component: ENOSPC

Posted: Wed Jan 30, 2019 3:56 pm
by HelloWorld!11235
Hardware:

Pi 3B running Raspbian Stretch with recommended software ( https://www.raspberrypi.org/downloads/raspbian/ )
Rainbow cable attached raspberry pi camera V2.1 ( https://www.amazon.co.uk/Raspberry-Pi-1 ... +pi+camera )
Ethernet (CAT 7)
HDMI
Offical raspberry pi charger
Wireless Mouse
Wired Keyboard

Issue:

I'm trying to run

Code: Select all

raspistill -o image.jpg
but I get the error

Code: Select all

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
The output of

Code: Select all

sudo vcgencmd get_camera
is

Code: Select all

supported=1 detected=1
I've ran

Code: Select all

dmesg
and I get the output: https://www.pastebin.com/Zjn2Exfm There are some errors for brcmfmac near the end of the output. Not sure if thats of anyhelp

What I've tried:

Firstly I've enabled the camera on

Code: Select all

sudo raspi-config
by going onto option 5 then enabling the camera which is P1 then rebooting. I've updated the pi with the sudo apt-get update and sudo apt-get upgrade and sudo raspi upgrade (this command is probably wrong but its the raspi upgrade command in most troubleshooting guides) then rebooting. I've re-downloaded the OS multiple times, and have also increase the SD space on advanced options. I've tried increasing GPU memory from the default 128 to 144. All to no avail.

DISCLAIMER:

There are numerous threads on this issue from my time googling but none of them have helped fix my particular issue. Also I think it maybe a driver conflict from my time googling but am not sure if this is true and if it was how to find which drivers and fix it accordingly.

Thanks!


EDIT:

Running raspistill -v -o image.jpg I get the following:

Code: Select all

"raspistill" Camera App (commit 7cbfbd38d982 Tainted)

Camera Name imx219
Width 3280, Height 2464, filename image.jpg
Using camera 0, sensor mode 0

GPS output Disabled

Quality 85, Raw no
Thumbnail enabled Yes, width 64, height 48, quality 35
Time delay 5000, Timelapse 0
Link to latest frame enabled  no
Full resolution preview No
Capture method : Single capture

Preview Yes, Full screen Yes
Preview window 0,0,1024,768
Opacity 255
Sharpness 0, Contrast 0, Brightness 50
Saturation 0, ISO 0, Video Stabilisation No, Exposure compensation 0
Exposure Mode 'auto', AWB Mode 'auto', Image Effect 'none'
Flicker Avoid Mode 'off'
Metering Mode 'average', Colour Effect Enabled No with U = 128, V = 128
Rotation 0, hflip No, vflip No
ROI x 0.000000, y 0.000000, w 1.000000 h 1.000000
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
Not sure if this will be of anymore help but it's worth a shot.

Re: Camera not working - failed to enable component: ENOSPC

Posted: Thu Jan 31, 2019 10:22 am
by topguy
Do you have the device "/dev/video0" on your Pi ?
If yes then you have enabled the V4L2 driver and that ( I belive ) will prevent the MMAL tools from working.

Re: Camera not working - failed to enable component: ENOSPC

Posted: Thu Jan 31, 2019 10:24 am
by 6by9
"sudo nano /boot/config.txt"
Add "start_debug=1"
Reboot
Run raspistill
Run "sudo vcdbg log assert" and post the output. If it includes the line

Code: Select all

assert( 0 ) failed; ../../../../../vcfw/drivers/device/camera/imx219.c::imx219_open line 431 rev 3ca4cf4
then part of the camera module has failed. Please return it for replacement.

Re: Camera not working - failed to enable component: ENOSPC

Posted: Thu Jan 31, 2019 10:26 am
by 6by9
topguy wrote:
Thu Jan 31, 2019 10:22 am
Do you have the device "/dev/video0" on your Pi ?
If yes then you have enabled the V4L2 driver and that ( I belive ) will prevent the MMAL tools from working.
You can't use both bcm2835-v4l2 and MMAL simultaneously, but the two will co-exist happily.

(Loading the bcm2835-unicam driver to drive the CSI2 receiver from the Linux kernel will stop the GPU talking to it, but that's a very different kettle of fish).

Re: Camera not working - failed to enable component: ENOSPC

Posted: Thu Jan 31, 2019 11:29 am
by topguy
You can't use both bcm2835-v4l2 and MMAL simultaneously, but the two will co-exist happily.
Ok, thanks for the clarification.

Re: Camera not working - failed to enable component: ENOSPC

Posted: Sun Feb 17, 2019 11:53 pm
by HFMan
6by9 wrote:
Thu Jan 31, 2019 10:24 am
"sudo nano /boot/config.txt"
Add "start_debug=1"
Reboot
Run raspistill
Run "sudo vcdbg log assert" and post the output. If it includes the line

Code: Select all

assert( 0 ) failed; ../../../../../vcfw/drivers/device/camera/imx219.c::imx219_open line 431 rev 3ca4cf4
then part of the camera module has failed. Please return it for replacement.
I have the same issue, with 2 of my three cameras. One works fine, the other two (both purchased from MicroCenter two months apart) show this assert error per your steps. It concerns me that perhaps MicroCenter is selling counterfeit cameras. Both were in 'official' packaging, both boards are bad (the camera lens modules however are fine as I tested them on my good board.)

These boards like slightly different than my 'good' board. The oscillator is not in a metal can, and the connector for the ribbon cable is grey, as opposed to white for my good board.

Any thoughts?

Re: Camera not working - failed to enable component: ENOSPC

Posted: Thu Apr 25, 2019 4:38 am
by sflemdog2
Hi, I am having the same problem except I am running a Pi zero W headless with Stretch lite, SSH-ing in to do everything. I have tried to start simple... was able to connect to WiFi, then went with the RPi-Cam-Web-Interface via web-browser to check the camera...unfortunately I get the "failed to enable component" message. I wouldn't post anything unless it helped others find the solution to this problem, as well, so I have re-done things many times to make sure I am doing everything in the right order across an entire month(re-flashing images and re-running installs). When I go to my web-address to check the camera, I have never actually seen an image produced from the camera...it being a headless setup makes it hard to even check the image output on the cam module (and I have yet to dip into things like Sixel, where you can view jpegs via terminal). I will try the suggestion from 6by9 when I get back to my computer that's next to my Pi and update here. Any updates/news on this topic would help if anything has changed. Thanks.

Re: Camera not working - failed to enable component: ENOSPC

Posted: Sat May 25, 2019 3:11 pm
by dcs
I had the same issue.
1 x v2 camera, 1 x NoIR v2, both from Adafruit.
I went through all the advice given, then changed to the NoIR, and it worked fine.
I don't think I damaged the camera on installation. I'm pretty sure the cable was used properly.
I have to presume there is a problem with the camera, as no other changes were made.

Workarounds: Camera not working - failed to enable component: ENOSPC

Posted: Sun Jun 09, 2019 7:02 pm
by tjrob
I had the same ENOSPC problem when using picamera in python3 for single (still) images. I found two workarounds:
1. reduce the resolution -- it failed at 3280x2464, but succeeded at 1024x768
2. increase the amount of GPU memory. The default is 128 MB; 192MB permits 3280x2464.
(do this in the Performance tab of the graphical configuration tool)

JPEG format seems to need less GPU memory than the bitmapped formats (PNG, GIF, BMP). Of course the final JPEG file is also smaller.

Re: Workarounds: Camera not working - failed to enable component: ENOSPC

Posted: Sun Jun 09, 2019 9:32 pm
by 6by9
tjrob wrote:
Sun Jun 09, 2019 7:02 pm
I had the same ENOSPC problem when using picamera in python3 for single (still) images. I found two workarounds:
1. reduce the resolution -- it failed at 3280x2464, but succeeded at 1024x768
2. increase the amount of GPU memory. The default is 128 MB; 192MB permits 3280x2464.
(do this in the Performance tab of the graphical configuration tool)

JPEG format seems to need less GPU memory than the bitmapped formats (PNG, GIF, BMP). Of course the final JPEG file is also smaller.
You mean exactly as stated in the docs? https://picamera.readthedocs.io/en/late ... are-limits

And please don't double or triple post the same thing.