HelloWorld!11235
Posts: 1
Joined: Tue Jan 29, 2019 10:07 pm

Camera not working - failed to enable component: ENOSPC

Wed Jan 30, 2019 3:56 pm

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.

User avatar
topguy
Posts: 5569
Joined: Tue Oct 09, 2012 11:46 am
Location: Trondheim, Norway

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

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.

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 6896
Joined: Wed Dec 04, 2013 11:27 am
Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.

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

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.
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 6896
Joined: Wed Dec 04, 2013 11:27 am
Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.

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

Thu Jan 31, 2019 10:26 am

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).
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

User avatar
topguy
Posts: 5569
Joined: Tue Oct 09, 2012 11:46 am
Location: Trondheim, Norway

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

Thu Jan 31, 2019 11:29 am

You can't use both bcm2835-v4l2 and MMAL simultaneously, but the two will co-exist happily.
Ok, thanks for the clarification.

HFMan
Posts: 1
Joined: Sun Feb 17, 2019 11:48 pm

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

Sun Feb 17, 2019 11:53 pm

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?

sflemdog2
Posts: 1
Joined: Thu Apr 25, 2019 1:15 am

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

Thu Apr 25, 2019 4:38 am

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.

dcs
Posts: 1
Joined: Sat May 25, 2019 3:07 pm

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

Sat May 25, 2019 3:11 pm

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.

tjrob
Posts: 32
Joined: Tue Feb 19, 2013 5:31 pm

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

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.

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 6896
Joined: Wed Dec 04, 2013 11:27 am
Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.

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

Sun Jun 09, 2019 9:32 pm

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.
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

Return to “Camera board”