I've set the rpi camera to take a photo, saved in jpg at 1280x720, on the refresh of a webpage.
It works fine for a short time, but then fails with
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
All subsequent calls to raspistill and raspivid fail with the same error. The only solution seems to be a system reboot.
I've read elsewhere - http://www.raspberrypi.org/phpBB3/viewt ... PC#p350745 - this is related to GPU memory (I've it set to 128mb, I'm on the 256mb version), but I don't see why it should effectively kill the camera.
I've run apt-get update and upgrade, so the system is fully updated.
Anyone have any ideas?
Edit:
ludespeedny suggested here http://www.raspberrypi.org/phpBB3/viewt ... 96#p351796 to check the cable - but that's not the issue, it's connected correctly and does work, it just fails (and requires a reboot) quite quickly.
Re: Rasbpistill fails with ENOSPC
Experienced the same problems as you are reporting. As I'm using my own cross-compiled kernel etc. so my first guess was a problem with my kernel configuration.
Compared my kernel configuration against the raspbian kernel and noticed my kernel didn't have CONFIG_BCM_VC_CMA, but this shouldn't be an issue, see: http://www.raspberrypi.org/phpBB3/viewt ... 43&t=44165.
But I did end up with removing all cma_ related parameters in the config.txt as it looks like it interferes with the camera. (and CMA stuff is related to the memory split).
HTH.
Compared my kernel configuration against the raspbian kernel and noticed my kernel didn't have CONFIG_BCM_VC_CMA, but this shouldn't be an issue, see: http://www.raspberrypi.org/phpBB3/viewt ... 43&t=44165.
But I did end up with removing all cma_ related parameters in the config.txt as it looks like it interferes with the camera. (and CMA stuff is related to the memory split).
HTH.
-
- Posts: 22
- Joined: Thu Nov 24, 2011 1:59 pm
Re: Rasbpistill fails with ENOSPC
I've got the same error tonight.
I'm wondering if it's to do with 2 sessions running raspistill at the same time. I've got a cron jon running every minute taking a snapshot, and was experimenting with timelapse on the command line when it happened.
I'm wondering if it's to do with 2 sessions running raspistill at the same time. I've got a cron jon running every minute taking a snapshot, and was experimenting with timelapse on the command line when it happened.
Re: Rasbpistill fails with ENOSPC
I had the same kind of concurrency issue with my pre-release camera.
--
Michael Horne - @recantha on Twitter
Raspberry Pi Pod blog - http://www.recantha.co.uk/blog
Cambridge Raspberry Jam - https://camjam.me
Pi Wars - https://piwars.org
Michael Horne - @recantha on Twitter
Raspberry Pi Pod blog - http://www.recantha.co.uk/blog
Cambridge Raspberry Jam - https://camjam.me
Pi Wars - https://piwars.org
Re: Rasbpistill fails with ENOSPC
My problems didn't occur due to latency.
Straight out of the box I received these errors, changed my kernel/tested with raspbian and stuff worked.
I use the kernel, boot loader and user land tools from the most up to date git.
Straight out of the box I received these errors, changed my kernel/tested with raspbian and stuff worked.
I use the kernel, boot loader and user land tools from the most up to date git.
Re: Rasbpistill fails with ENOSPC
Certainly. The camera is single instance - if something has it open, you cannot open it again.gusgriller wrote:I've got the same error tonight.
I'm wondering if it's to do with 2 sessions running raspistill at the same time. I've got a cron jon running every minute taking a snapshot, and was experimenting with timelapse on the command line when it happened.
Principal Software Engineer at Raspberry Pi Ltd.
Working in the Applications Team.
Working in the Applications Team.
Re: Rasbpistill fails with ENOSPC
Ah, that's gotten rid of the error
Did
and true to form, there were two raspistill instances running. After I killed one of them, the raspistill now no longer returns ENOSPC error, but it still hangs.
It just hangs here, has to be killed with ctrl-c.
Did
Code: Select all
ps aux | grep raspi
Code: Select all
$ raspistill -v -t 0 -o output.jpg
RaspiStill Camera App
=====================
Width 2592, Height 1944, quality 85, filename output.jpg
Time delay 0, Raw no
Thumbnail enabled Yes, width 64, height 48, quality 35
Preview Yes, Full screen Yes
Preview window 0,0,1024,768
Sharpness 0, Contrast 0, Brightness 50
Saturation 0, ISO 400, Video Stabilisation No, Exposure compensation 0
Exposure Mode 'auto', AWB Mode 'auto', Image Effect 'none'
Metering Mode 'average', Colour Effect Enabled No with U = 128, V = 128
Rotation 0, hflip No, vflip No
Re: Rasbpistill fails with ENOSPC
Hmm. No component connection errors, but no text saying the connection has been made either. Dunno. I'll have a think.
Principal Software Engineer at Raspberry Pi Ltd.
Working in the Applications Team.
Working in the Applications Team.
Re: Rasbpistill fails with ENOSPC
Thanksjamesh wrote:Hmm. No component connection errors, but no text saying the connection has been made either. Dunno. I'll have a think.

Re: Rasbpistill fails with ENOSPC
Any more thoughts on this?, as im getting the same thing
Re: Rasbpistill fails with ENOSPC
First thing to check - are you using the very latest distro, and have you run all the updates required to get the latest firmware and libraries? Starting off with a known working SD system is the best start point.
Have you checked to make sure the cables are plugged in and seated firmly and are the right way round. Don't forget to check the module connection (the tiny ribbon cable from the sensor itself to the camera PCB). This can come unseated. Slight pressure on it should reseat it if it's loose.
Have you checked to make sure the cables are plugged in and seated firmly and are the right way round. Don't forget to check the module connection (the tiny ribbon cable from the sensor itself to the camera PCB). This can come unseated. Slight pressure on it should reseat it if it's loose.
Principal Software Engineer at Raspberry Pi Ltd.
Working in the Applications Team.
Working in the Applications Team.
Re: Rasbpistill fails with ENOSPC
Yep all of these are case for me - I reinstalled the weezy build last night, did an upgrade this morning, same issue.jamesh wrote:First thing to check - are you using the very latest distro, and have you run all the updates required to get the latest firmware and libraries? Starting off with a known working SD system is the best start point.
Have you checked to make sure the cables are plugged in and seated firmly and are the right way round. Don't forget to check the module connection (the tiny ribbon cable from the sensor itself to the camera PCB). This can come unseated. Slight pressure on it should reseat it if it's loose.
Again, it does take photos, but if you try to take two simultaneously, one will fail, then all subsequent camera commands will fail (hang) until reboot.
Re: Rasbpistill fails with ENOSPC
Sorry, missed the bit about taking two simultaneously - how are you trying to do that?
Two separate instances of raspixxxx will not work, although I would normally expect the second instance to just fail and for everything to recover gracefully.
Two separate instances of raspixxxx will not work, although I would normally expect the second instance to just fail and for everything to recover gracefully.
Principal Software Engineer at Raspberry Pi Ltd.
Working in the Applications Team.
Working in the Applications Team.
Re: Rasbpistill fails with ENOSPC
I was running a php script on a webpage on an apache server, taking a photo with raspistill whenever it was loaded. Two people loading the page at once sparked the ENOSPC error. Every subsequent call to the camera would fail until I checked the running processes, killed the second process, at which point all subsequent camera calls will hang, as I mentioned above.jamesh wrote:Sorry, missed the bit about taking two simultaneously - how are you trying to do that?
Two separate instances of raspixxxx will not work, although I would normally expect the second instance to just fail and for everything to recover gracefully.
And easier way to replicate the problem is to open a screen session, start raspivid streaming in one screen, try to take a still in the other.
Re: Rasbpistill fails with ENOSPC
Yes, you will need to ensure you only access the camera sequentially. Although it shouldn't lock like that, can you post a bug on userland please.fin wrote:I was running a php script on a webpage on an apache server, taking a photo with raspistill whenever it was loaded. Two people loading the page at once sparked the ENOSPC error. Every subsequent call to the camera would fail until I checked the running processes, killed the second process, at which point all subsequent camera calls will hang, as I mentioned above.jamesh wrote:Sorry, missed the bit about taking two simultaneously - how are you trying to do that?
Two separate instances of raspixxxx will not work, although I would normally expect the second instance to just fail and for everything to recover gracefully.
And easier way to replicate the problem is to open a screen session, start raspivid streaming in one screen, try to take a still in the other.
Principal Software Engineer at Raspberry Pi Ltd.
Working in the Applications Team.
Working in the Applications Team.
Re: Rasbpistill fails with ENOSPC
Hello I getting same error after upgrades:
pi@raspberrypi ~ $ raspivid -d -t 30000
Please help me, how to solve this Error?
I tried some command with i found here and this is what I get, but I still getting same error:
I tried to change GPU from 128 to 256 MB but no luck...
pi@raspberrypi ~ $ ps aux | grep raspi
pi@raspberrypi ~ $ sudo vcdbg log msg
pi@raspberrypi ~ $ raspivid -v
pi@raspberrypi ~ $ sudo rpi-update
pi@raspberrypi ~ $ raspivid -d -t 30000
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

I tried some command with i found here and this is what I get, but I still getting same error:
I tried to change GPU from 128 to 256 MB but no luck...
pi@raspberrypi ~ $ ps aux | grep raspi
Code: Select all
pi 2452 0.0 0.3 3548 800 pts/0 S+ 00:20 0:00 grep --color=auto raspi
Code: Select all
002519.735: HDMI:Setting property pixel encoding to Default
002519.760: HDMI:Setting property pixel clock type to PAL
002519.784: HDMI:Setting property content type flag to No data
002519.806: HDMI:Setting property fuzzy format match to enabled
002520.719: hdmi: HDMI:>>>>>>>>>>>>>Rx sensed, reading EDID<<<<<<<<<<<<<
002532.962: hdmi: HDMI:EDID version 1.3, 1 extensions, screen size 55x31 cm
002533.032: hdmi: HDMI:EDID features - videodef 0x80 !standby !suspend !active off; colour encoding:RGB444|YCbCr422; sRGB is not default colourspace; preferred format is native; does not support GTF
002533.091: hdmi: HDMI:EDID found preferred CEA detail timing format: 1920x1080p @ 60 Hz (16)
002533.165: hdmi: HDMI:EDID found DMT detail timing format: 1680x1050p @ 60 Hz (58)
002533.211: hdmi: HDMI:EDID found DMT format: code 4, 640x480p @ 60 Hz in established timing I/II
002533.251: hdmi: HDMI:EDID found DMT format: code 6, 640x480p @ 75 Hz in established timing I/II
002533.293: hdmi: HDMI:EDID found DMT format: code 9, 800x600p @ 60 Hz in established timing I/II
002533.333: hdmi: HDMI:EDID found DMT format: code 11, 800x600p @ 75 Hz in established timing I/II
002533.376: hdmi: HDMI:EDID found DMT format: code 16, 1024x768p @ 60 Hz in established timing I/II
002533.418: hdmi: HDMI:EDID found DMT format: code 17, 1024x768p @ 70 Hz in established timing I/II
002533.459: hdmi: HDMI:EDID found DMT format: code 18, 1024x768p @ 75 Hz in established timing I/II
002533.505: hdmi: HDMI:EDID found DMT format: code 36, 1280x1024p @ 75 Hz in established timing I/II
002533.591: hdmi: HDMI:EDID standard timings block x 8: 0x714F 81C0 8100 8180 9500 9040 A9C0 B300
002533.643: hdmi: HDMI:EDID found DMT format: code 21, 1152x864p @ 75 Hz (4:3) in standard timing 0
002533.703: hdmi: HDMI:EDID found DMT format: code 85, 1280x720p @ 60 Hz (16:9) in standard timing 1
002533.758: hdmi: HDMI:EDID found DMT format: code 28, 1280x800p @ 60 Hz (16:10) in standard timing 2
002533.812: hdmi: HDMI:EDID found DMT format: code 35, 1280x1024p @ 60 Hz (5:4) in standard timing 3
002533.866: hdmi: HDMI:EDID found DMT format: code 47, 1440x900p @ 60 Hz (16:10) in standard timing 4
002533.919: hdmi: HDMI:EDID found DMT format: code 42, 1400x1050p @ 60 Hz (4:3) in standard timing 5
002533.976: hdmi: HDMI:EDID found DMT format: code 83, 1600x900p @ 60 Hz (16:9) in standard timing 6
002534.033: hdmi: HDMI:EDID found DMT format: code 58, 1680x1050p @ 60 Hz (16:10) in standard timing 7
002547.054: hdmi: HDMI:EDID parsing v3 CEA extension 0
002547.097: hdmi: HDMI:EDID monitor support - underscan IT formats:yes, basic audio:yes, yuv444:yes, yuv422:yes, #native DTD:1
002547.143: hdmi: HDMI:EDID found CEA detail timing format: 1280x720p @ 60 Hz (4)
002547.189: hdmi: HDMI:EDID found CEA detail timing format: 1920x1080i @ 60 Hz (5)
002547.236: hdmi: HDMI:EDID found CEA detail timing format: 1920x1080i @ 50 Hz (20)
002547.282: hdmi: HDMI:EDID found CEA detail timing format: 1920x1080p @ 50 Hz (31)
002547.329: hdmi: HDMI:EDID found CEA detail timing format: 1920x1080p @ 60 Hz (16)
002547.367: hdmi: HDMI:EDID found CEA format: code 4, 1280x720p @ 60Hz (native)
002547.405: hdmi: HDMI:EDID found CEA format: code 5, 1920x1080i @ 60Hz
002547.438: hdmi: HDMI:EDID found CEA format: code 3, 720x480p @ 60Hz
002547.472: hdmi: HDMI:EDID found CEA format: code 2, 720x480p @ 60Hz
002547.508: hdmi: HDMI:EDID found CEA format: code 32, 1920x1080p @ 24Hz
002547.544: hdmi: HDMI:EDID found CEA format: code 34, 1920x1080p @ 30Hz
002547.581: hdmi: HDMI:EDID found CEA format: code 16, 1920x1080p @ 60Hz
002547.616: hdmi: HDMI:EDID found CEA format: code 17, 720x576p @ 50Hz
002547.653: hdmi: HDMI:EDID found CEA format: code 19, 1280x720p @ 50Hz
002547.688: hdmi: HDMI:EDID found CEA format: code 18, 720x576p @ 50Hz
002547.724: hdmi: HDMI:EDID found CEA format: code 20, 1920x1080i @ 50Hz
002547.762: hdmi: HDMI:EDID found CEA format: code 31, 1920x1080p @ 50Hz
002547.797: hdmi: HDMI:EDID found CEA format: code 7, 1440x480i @ 60Hz
002547.834: hdmi: HDMI:EDID found CEA format: code 22, 1440x576i @ 50Hz
002547.888: hdmi: HDMI:EDID found audio format 6 channels AC3, sample rate: 32|44|48 kHz, bitrate: 640 kbps
002547.942: hdmi: HDMI:EDID found audio format 2 channels PCM, sample rate: 32|44|48 kHz, sample size: 16|20|24 bits
002547.964: hdmi: HDMI:EDID found HDMI VSDB length 6
002547.994: hdmi: HDMI:EDID HDMI VSDB has physical address 1.0.0.0
002548.018: hdmi: HDMI:EDID HDMI VSDB supports AI:yes, dual link DVI:no
002548.052: hdmi: HDMI:EDID HDMI VSDB deep colour support - 48-bit:no 36-bit:no 30-bit:no DC_yuv444:no
002548.071: hdmi: HDMI:EDID HDMI VSDB has no latency information
002548.132: hdmi: HDMI:EDID filtering formats with pixel clock > 162 MHz or h. blanking > 1023
002548.248: hdmi: HDMI:EDID preferred mode remained as CEA (16) 1920x1080p @ 60 Hz with pixel clock 148 MHz
002548.284: hdmi: HDMI: hotplug attached with HDMI support
002548.381: hdmi: HDMI:hdmi_get_state is deprecated, use hdmi_get_display_state instead
002550.997: hdmi: HDMI: power_on to CEA mode 1080p60
002553.172: hdmi: HDMI: Action callback added to queue to happen at frame 2
002553.195: hdmi: HDMI: Action stop_3d_mode added to queue to happen at frame 2
002553.218: hdmi: HDMI: Action unmute added to queue to happen at frame 3
002553.258: hdmi: HDMI: Action cec_init added to queue to happen at frame 3
004664.378: vchiq_core: vchiq_init_state: slot_zero = 0x4f000000, is_master = 1
004668.976: hdmi: HDMI:hdmi_get_state is deprecated, use hdmi_get_display_state instead
004671.631: cma: cma_hwm is zero - disabling cma service
004673.354: TV service:host side not connected, dropping notification 0x00000002, 0x00000001, 0x00000010
Code: Select all
raspivid Camera App v1.3.11
Width 1920, Height 1080, filename (null)
bitrate 17000000, framerate 30, time delay 5000
H264 Profile high
H264 Quantisation level 0, Inline headers No
Wait method : Simple capture
Initial state 'record'
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'
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
Code: Select all
*** Raspberry Pi firmware updater by Hexxeh, enhanced by AndrewS
*** Performing self-update
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 135 100 135 0 0 176 0 --:--:-- --:--:-- --:--:-- 243
100 6986 100 6986 0 0 6511 0 0:00:01 0:00:01 --:--:-- 6511
*** Relaunching after update
*** Raspberry Pi firmware updater by Hexxeh, enhanced by AndrewS and Dom
*** Downloading specific firmware revision (this will take a few minutes)
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 168 100 168 0 0 258 0 --:--:-- --:--:-- --:--:-- 332
100 20.8M 100 20.8M 0 0 476k 0 0:00:44 0:00:44 --:--:-- 395k
*** Updating firmware
*** Updating kernel modules
*** depmod 3.10.36+
*** Updating VideoCore libraries
*** Using HardFP libraries
*** Updating SDK
*** Running ldconfig
*** Storing current firmware revision
*** Deleting downloaded files
*** Syncing changes to disk
*** If no errors appeared, your firmware was successfully updated to 683516a82abc0975d6248475b711860627e529d8
*** A reboot is needed to activate the new firmware
-
- Raspberry Pi Engineer & Forum Moderator
- Posts: 13801
- Joined: Wed Dec 04, 2013 11:27 am
- Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.
Re: Rasbpistill fails with ENOSPC
It may be the same error, but definitely a different reason. The original bug in the sensor driver that fouled things up if a second simultaneous instance was started got fixed back around January.
A minor bug did creep in over the weekend, but that was with JPEG captures not video. It is fixed anyway with the firmware release done yesterday lunchtime (https://github.com/raspberrypi/firmware ... 3188a019a9)
I can't think of any recent changes that would cause this sort of failure. If you use a clean NOOBS or Raspbian install does the camera work OK? It'd be good to rule out hardware issue (ie the cable connections) whilst we check the software
A minor bug did creep in over the weekend, but that was with JPEG captures not video. It is fixed anyway with the firmware release done yesterday lunchtime (https://github.com/raspberrypi/firmware ... 3188a019a9)
I can't think of any recent changes that would cause this sort of failure. If you use a clean NOOBS or Raspbian install does the camera work OK? It'd be good to rule out hardware issue (ie the cable connections) whilst we check the software
Software Engineer at Raspberry Pi Ltd. Views expressed are still personal views.
I'm not interested in doing contracts for bespoke functionality - please don't ask.
I'm not interested in doing contracts for bespoke functionality - please don't ask.
Re: Rasbpistill fails with ENOSPC
Had the same problem - solved with chmod 666 /dev/video0