bbocksta
Posts: 8
Joined: Tue Nov 28, 2017 8:41 am

mmal error ENOSPC

Tue Nov 28, 2017 8:59 am

Hello everybody,

I've played around with the Raspberry Pi 3 Model B and the Raspberry Pi Camera Module V2.
At first everything worked as expected. But then, with almost absolute certainty, i bricked something.

The Error i've been getting since then is the following:
[email protected]:~ $ raspistill -o s.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

First thing i did was to reinstall Noobs. Sounds good, didn't help.
I updated everything, either using sudo rpi-update or sudo apt-get update. No Change.
I've been trying to increase gpu memory, didn't help.
There is no second task trying to access the camera, see:

[email protected]:~ $ sudo ps aux|grep raspi
pi 1492 0.0 0.2 4292 2016 pts/0 S+ 08:54 0:00 grep --color=auto raspi

The Camera Module is detected, see:

[email protected]:~ $ sudo vcgencmd get_camera
supported=1 detected=1

I'm running a fresh install of Noobs no changes done other than updating ( sudo apt full-upgrade).
The Camera Module is activated.

I'm running out of nerves knowing that it's most likely my fault. Is there anything obvious i'm not seeing?
Is there anything you need to know to help?
Your help will be appreciated.

~bbocksta

PhilE
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 1878
Joined: Mon Sep 29, 2014 1:07 pm
Location: Cambridge

Re: mmal error ENOSPC

Tue Nov 28, 2017 12:46 pm

[ Moved to Camera Board ]

jahboater
Posts: 3031
Joined: Wed Feb 04, 2015 6:38 pm

Re: mmal error ENOSPC

Tue Nov 28, 2017 12:58 pm

ENOSPC is lack of disk space is it not?
Try: df -h

Perhaps use Raspbian directly, rather than NOOBs which will save you around 1.5GB.

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

Re: mmal error ENOSPC

Tue Nov 28, 2017 1:56 pm

There are two potential issues I can think of:
a) You already have something running that is using the camera - it only supports one client at a time. Have you installed motion or similar that is running in the background? Start with a clean Raspbian image, enable the camera through raspi-config, reboot, and try again.

b) There are a number of checks done on opening the camera driver. If any of those fail then it throws an error. Add "dtdebug=1" to the bottom of /boot/config.txt, reboot, run "raspistill -t 1000", and then run "sudo vcdbg log assert". If you get

Code: Select all

049839.200: assert( 0 ) failed; ../../../../../vcfw/drivers/device/camera/imx219.c::imx219_open line 431 rev 89a5328
vcdbg_ctx_get_dump_stack: dump_stack failed
then part of the camera module is faulty and your supplier should replace it.
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
Please don't send PMs asking for support - use the forum.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

bbocksta
Posts: 8
Joined: Tue Nov 28, 2017 8:41 am

Re: mmal error ENOSPC

Tue Nov 28, 2017 3:04 pm

Neither motion nor anything else is installed. I've started twice with a new fresh install and that didn't help me.
Since the Goal of the Project is to use 6by9's userland, i've installed that and i am getting a picture while using raspiraw.
Raspistill on the other hand is still not working (is it even supposed to with the modified userland?)

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

Re: mmal error ENOSPC

Tue Nov 28, 2017 3:21 pm

bbocksta wrote:
Tue Nov 28, 2017 3:04 pm
Neither motion nor anything else is installed. I've started twice with a new fresh install and that didn't help me.
Since the Goal of the Project is to use 6by9's userland, i've installed that and i am getting a picture while using raspiraw.
Raspistill on the other hand is still not working (is it even supposed to with the modified userland?)
Someone else reported that raspistill/vid weren't working off my rawcam branch. I've done a quick test with a cross-compile (as it's quicker), and it still works. That could mean that there is an issue in a support library instead, as I'm only running the new binary rather than all the new libraries.
If it isn't working with the standard userland build of raspistill then it won't be anything to do with my branch.
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
Please don't send PMs asking for support - use the forum.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

bbocksta
Posts: 8
Joined: Tue Nov 28, 2017 8:41 am

Re: mmal error ENOSPC

Wed Nov 29, 2017 6:41 am

I'll start off with a new Install on another Pi and i will Report if i'm having the same issues.

bbocksta
Posts: 8
Joined: Tue Nov 28, 2017 8:41 am

Re: mmal error ENOSPC

Wed Nov 29, 2017 9:27 am

Everything is working now (though nothing was changed 8-) ). Thank you for your answers!

Lepracon68
Posts: 9
Joined: Wed Jan 10, 2018 11:18 am

Re: mmal error ENOSPC

Tue Jan 16, 2018 2:51 pm

But i am still struggling with this error

After raspistill -t 1000 i still get the error:
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

BUT the strangest thing is if i go to another pc (same network) and type
http:// {ipadres}:8081/?action=stream
i see the stream (upside down, thats why i need raspistill)

So the camera works but raspistill is NOT

(i tried df -h)
(i tried sudo vcgencmd get_camera : supported=1 detected=1)
(i tried sudo ps aux|grep raspi and get 2 lines : www-data { lots of numers} raspimjpeg
pi {lots of numbers} grep --color=auto raspi

Anyone any good ideas how to rotate the picture or solve the raspistill problem ?

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

Re: mmal error ENOSPC

Tue Jan 16, 2018 3:24 pm

The camera supports ONE client at a time. You have raspimjpeg running, so that is your one client.
If you want to run raspistill, then you MUST stop raspimjpeg first.

However raspimjpeg supports setting the camera flips via the config file (default of /etc/raspimjpeg). Add "hflip=true" and "vflip=true" and you'll get a 180degree rotation.
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
Please don't send PMs asking for support - use the forum.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

Lepracon68
Posts: 9
Joined: Wed Jan 10, 2018 11:18 am

Re: mmal error ENOSPC

Tue Jan 16, 2018 4:25 pm

THANK you, finally an answer on my problem, i've been looking for .
This saves me a lot of headaces.

Thank you 6by9 !

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

Re: mmal error ENOSPC

Tue Jan 16, 2018 5:47 pm

Lepracon68 wrote:
Tue Jan 16, 2018 4:25 pm
THANK you, finally an answer on my problem, i've been looking for .
This saves me a lot of headaces.

Thank you 6by9 !
It's the same answer already given earlier in the thread - viewtopic.php?f=43&t=198665#p1240002
a) You already have something running that is using the camera - it only supports one client at a time. Have you installed motion or similar that is running in the background? Start with a clean Raspbian image, enable the camera through raspi-config, reboot, and try again.
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
Please don't send PMs asking for support - use the forum.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

Dan_reklam
Posts: 1
Joined: Sun Feb 11, 2018 3:18 pm

Re: mmal error ENOSPC

Sun Feb 11, 2018 4:28 pm

I saw an answer above which indicated that my camera is broken due to the log below. Is that true?

[email protected]:~ $ sudo ps aux|grep raspi
pi 5861 0.0 0.0 4372 588 pts/0 S+ 16:32 0:00 grep --color=auto raspi

[email protected]:~ $ sudo vcgencmd get_camera
supported=1 detected=1
[email protected]:~ $

[email protected]:~ $ raspistill -o s.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

[email protected]:~ $ df -h
Filsystem Storlek Använt Ledigt Anv% Monterat på
/dev/root 13G 4,4G 7,9G 36% /
devtmpfs 291M 0 291M 0% /dev
tmpfs 296M 32M 264M 11% /dev/shm
tmpfs 296M 4,2M 292M 2% /run
tmpfs 5,0M 4,0K 5,0M 1% /run/lock
tmpfs 296M 0 296M 0% /sys/fs/cgroup
/dev/mmcblk0p6 65M 21M 45M 33% /boot
tmpfs 60M 0 60M 0% /run/user/1000
/dev/mmcblk0p5 30M 454K 28M 2% /media/pi/SETTINGS

[email protected]:~ $ raspistill -t 1000
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

[email protected]:~ $ sudo vcdbg log assert
519381.300: assert( retcode == 0 ) failed; ../../../../../middleware/openmaxil/components/camera.c::load_and_open_cdi line 12064 rev a3d7660
vcdbg_ctx_get_dump_stack: dump_stack failed
----------------
519381.375: assert( id->cdi!=NULL && id->cdi_handle!=NULL ) failed; ../../../../../middleware/openmaxil/components/camera.c::open_camplus line 11411 rev a3d7660
vcdbg_ctx_get_dump_stack: dump_stack failed
----------------
1123733.856: assert( 0 ) failed; ../../../../../vcfw/drivers/device/camera/imx219.c::imx219_open line 432 rev a3d7660
vcdbg_ctx_get_dump_stack: dump_stack failed

----------------
1123733.915: assert( open_camera_driver: camera open failed ) failed; ../../../../../middleware/camplus/cdi/cdi_camera.c::open_camera_driver line 706 rev a3d7660
vcdbg_ctx_get_dump_stack: dump_stack failed
----------------
1123733.978: assert( cdi_camera_open: Failed to open camera driver/perihperal ) failed; ../../../../../middleware/camplus/cdi/cdi_camera.c::cdi_camera_open line 543 rev a3d7660
vcdbg_ctx_get_dump_stack: dump_stack failed
----------------
1123734.031: assert( retcode == 0 ) failed; ../../../../../middleware/openmaxil/components/camera.c::load_and_open_cdi line 12064 rev a3d7660
vcdbg_ctx_get_dump_stack: dump_stack failed
----------------
1123734.089: assert( id->cdi!=NULL && id->cdi_handle!=NULL ) failed; ../../../../../middleware/openmaxil/components/camera.c::open_camplus line 11411 rev a3d7660
vcdbg_ctx_get_dump_stack: dump_stack failed
----------------
1709142.975: assert( 0 ) failed; ../../../../../vcfw/drivers/device/camera/imx219.c::imx219_open line 432 rev a3d7660
vcdbg_ctx_get_dump_stack: dump_stack failed
----------------
1709143.012: assert( open_camera_driver: camera open failed ) failed; ../../../../../middleware/camplus/cdi/cdi_camera.c::open_camera_driver line 706 rev a3d7660
vcdbg_ctx_get_dump_stack: dump_stack failed
----------------
1709143.074: assert( cdi_camera_open: Failed to open camera driver/perihperal ) failed; ../../../../../middleware/camplus/cdi/cdi_camera.c::cdi_camera_open line 543 rev a3d7660
vcdbg_ctx_get_dump_stack: dump_stack failed
----------------
1709143.145: assert( retcode == 0 ) failed; ../../../../../middleware/openmaxil/components/camera.c::load_and_open_cdi line 12064 rev a3d7660
vcdbg_ctx_get_dump_stack: dump_stack failed
----------------
1709143.220: assert( id->cdi!=NULL && id->cdi_handle!=NULL ) failed; ../../../../../middleware/openmaxil/components/camera.c::open_camplus line 11411 rev a3d7660
vcdbg_ctx_get_dump_stack: dump_stack failed
----------------

tuttiefruit56
Posts: 2
Joined: Sat Feb 17, 2018 7:47 pm

Re: mmal error ENOSPC

Sun Feb 18, 2018 4:26 pm

Hello,

I was getting the same error message from the top and so I tried to do a firmware upgrade, but when I did that I got this error message:

*** Raspberry Pi firmware updater Hexxeh, enhanced by AndrewS and Dom
*** Performing self-update
!!! Failed to download update for rpi update!
!!! Make sure you have a ca-certificate installed and that they time is set correctly

I tried resetting the time and it says it is correct in the settings, but will not change for the Pi itself.
I had the camera working and then I upgraded everything and that is when I started having issues. It happened right after the upgrade and I've been messing with it and have not gotten anywhere, so if someone has an idea or a place to start for me that would be great! Thank you!

tuttiefruit56
Posts: 2
Joined: Sat Feb 17, 2018 7:47 pm

Re: mmal error ENOSPC

Sun Feb 18, 2018 9:23 pm

Okay I figured out how to fix the time setting and got the firmware updated and it is still giving me the error for the 'sudo raspitstill -o image.jpg' line. I tried using the gpu-mem at 128 and 144, and those didn't change anything either. I used the 'vcgencmd get_camera' and it says the camera is supported and detected but still will not take pictures.

anujgpatil
Posts: 4
Joined: Thu May 24, 2018 7:06 am

Re: mmal error ENOSPC

Thu May 24, 2018 12:41 pm

6by9 wrote:
Tue Nov 28, 2017 1:56 pm
There are two potential issues I can think of:
a) You already have something running that is using the camera - it only supports one client at a time. Have you installed motion or similar that is running in the background? Start with a clean Raspbian image, enable the camera through raspi-config, reboot, and try again.

b) There are a number of checks done on opening the camera driver. If any of those fail then it throws an error. Add "dtdebug=1" to the bottom of /boot/config.txt, reboot, run "raspistill -t 1000", and then run "sudo vcdbg log assert". If you get

Code: Select all

049839.200: assert( 0 ) failed; ../../../../../vcfw/drivers/device/camera/imx219.c::imx219_open line 431 rev 89a5328
vcdbg_ctx_get_dump_stack: dump_stack failed
then part of the camera module is faulty and your supplier should replace it.
My issue was the 1st one.

I was running WebcamServer and trying to capture video concurrently.

Thanks for the solution!

ujjwalrathod007
Posts: 82
Joined: Thu Dec 22, 2016 10:09 am

Re: mmal error ENOSPC

Mon Oct 08, 2018 4:58 pm

I also had MMAL error and I saw that I had script running on the startup which uses camera. So I cleared that script and reboot the RPI and saw that error was cleare so the conclution is camera can use one client at a time!!

Return to “Camera board”