fin
Posts: 8
Joined: Sat May 18, 2013 2:24 pm

Rasbpistill fails with ENOSPC

Sat May 18, 2013 5:29 pm

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.

limpens
Posts: 38
Joined: Thu Sep 13, 2012 1:15 pm

Re: Rasbpistill fails with ENOSPC

Sat May 18, 2013 8:19 pm

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.

gusgriller
Posts: 22
Joined: Thu Nov 24, 2011 1:59 pm

Re: Rasbpistill fails with ENOSPC

Sat May 18, 2013 10:17 pm

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.

User avatar
recantha2
Posts: 347
Joined: Wed Nov 14, 2012 9:34 am
Location: Potton, Bedfordshire
Contact: Website Facebook Twitter

Re: Rasbpistill fails with ENOSPC

Sun May 19, 2013 7:21 am

I had the same kind of concurrency issue with my pre-release camera.
--
Michael Horne - @recantha
Raspberry Pi blog - http://www.recantha.co.uk/blog

Cambridge Raspberry Jam
Website: http://camjam.me
Facebook: https://www.facebook.com/cambridgeraspberryjam
Follow the Cambridge Raspberry Jam on Twitter - @cambridgejam

limpens
Posts: 38
Joined: Thu Sep 13, 2012 1:15 pm

Re: Rasbpistill fails with ENOSPC

Sun May 19, 2013 7:31 am

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.

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 27721
Joined: Sat Jul 30, 2011 7:41 pm

Re: Rasbpistill fails with ENOSPC

Sun May 19, 2013 9:45 am

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.
Certainly. The camera is single instance - if something has it open, you cannot open it again.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed.
I've been saying "Mucho" to my Spanish friend a lot more lately. It means a lot to him.

fin
Posts: 8
Joined: Sat May 18, 2013 2:24 pm

Re: Rasbpistill fails with ENOSPC

Sun May 19, 2013 10:31 am

Ah, that's gotten rid of the error

Did

Code: Select all

ps aux | grep raspi
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.

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
It just hangs here, has to be killed with ctrl-c.

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 27721
Joined: Sat Jul 30, 2011 7:41 pm

Re: Rasbpistill fails with ENOSPC

Sun May 19, 2013 12:06 pm

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 (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed.
I've been saying "Mucho" to my Spanish friend a lot more lately. It means a lot to him.

fin
Posts: 8
Joined: Sat May 18, 2013 2:24 pm

Re: Rasbpistill fails with ENOSPC

Sun May 19, 2013 1:08 pm

jamesh wrote:Hmm. No component connection errors, but no text saying the connection has been made either. Dunno. I'll have a think.
Thanks :)

madmaxno1
Posts: 5
Joined: Fri May 17, 2013 4:13 pm

Re: Rasbpistill fails with ENOSPC

Mon May 20, 2013 12:40 pm

Any more thoughts on this?, as im getting the same thing

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 27721
Joined: Sat Jul 30, 2011 7:41 pm

Re: Rasbpistill fails with ENOSPC

Mon May 20, 2013 12:52 pm

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.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed.
I've been saying "Mucho" to my Spanish friend a lot more lately. It means a lot to him.

fin
Posts: 8
Joined: Sat May 18, 2013 2:24 pm

Re: Rasbpistill fails with ENOSPC

Tue May 21, 2013 2:08 pm

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.
Yep all of these are case for me - I reinstalled the weezy build last night, did an upgrade this morning, same issue.
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.

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 27721
Joined: Sat Jul 30, 2011 7:41 pm

Re: Rasbpistill fails with ENOSPC

Tue May 21, 2013 2:30 pm

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.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed.
I've been saying "Mucho" to my Spanish friend a lot more lately. It means a lot to him.

fin
Posts: 8
Joined: Sat May 18, 2013 2:24 pm

Re: Rasbpistill fails with ENOSPC

Tue May 21, 2013 10:34 pm

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.
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.

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.

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 27721
Joined: Sat Jul 30, 2011 7:41 pm

Re: Rasbpistill fails with ENOSPC

Wed May 22, 2013 6:54 am

fin wrote:
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.
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.

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.
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.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed.
I've been saying "Mucho" to my Spanish friend a lot more lately. It means a lot to him.


Drasius
Posts: 1
Joined: Mon Apr 07, 2014 9:09 pm

Re: Rasbpistill fails with ENOSPC

Mon Apr 07, 2014 9:37 pm

Hello I getting same error after upgrades:

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
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

Code: Select all

pi        2452  0.0  0.3   3548   800 pts/0    S+   00:20   0:00 grep --color=auto raspi
pi@raspberrypi ~ $ sudo vcdbg log msg

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
pi@raspberrypi ~ $ raspivid -v

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
pi@raspberrypi ~ $ sudo rpi-update

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

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

Re: Rasbpistill fails with ENOSPC

Tue Apr 08, 2014 6:50 am

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
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.

liderbug
Posts: 193
Joined: Sat Oct 08, 2011 4:47 pm

Re: Rasbpistill fails with ENOSPC

Thu Oct 30, 2014 8:11 pm

Had the same problem - solved with chmod 666 /dev/video0

Return to “Camera board”