Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Confusing error when camera isn't enabled in firmware #89

Closed
lurch opened this issue May 9, 2014 · 11 comments
Closed

Confusing error when camera isn't enabled in firmware #89

lurch opened this issue May 9, 2014 · 11 comments
Assignees
Milestone

Comments

@lurch
Copy link
Contributor

lurch commented May 9, 2014

If I don't run raspi-config to select the "Enable Camera" option, when I try running raspistill it provides the helpful error message:

mmal: mmal_vc_component_create: failed to create component 'vc.ril.camera' (1:ENOMEM)
mmal: mmal_component_create_core: could not create component 'vc.ril.camera' (1)
mmal: Failed to create camera component
mmal: main: Failed to create camera component
mmal: Camera is not enabled in this build. Try running "sudo raspi-config" and ensure that "camera" has been enabled

However in python if I do

import picamera
camera = picamera.PiCamera()

it displays:

mmal: mmal_vc_component_create: failed to create component 'vc.ril.camera' (1:ENOMEM)
mmal: mmal_component_create_core: could not create component 'vc.ril.camera' (1)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python2.7/dist-packages/picamera/camera.py", line 298, in __init__
    self._init_camera()
  File "/usr/lib/python2.7/dist-packages/picamera/camera.py", line 329, in _init_camera
    prefix="Failed to create camera component")
  File "/usr/lib/python2.7/dist-packages/picamera/exc.py", line 112, in mmal_check
    raise PiCameraMMALError(status, prefix)
picamera.exc.PiCameraMMALError: Failed to create camera component: Out of memory

Maybe picamera could also display a 'helpful' error message, rather the 'cryptic' "Out of memory" ?

@waveform80 waveform80 added this to the 1.5 milestone May 9, 2014
@waveform80 waveform80 self-assigned this May 9, 2014
@waveform80
Copy link
Owner

Good plan - I'll add this as an enhancement for 1.5

@lurch
Copy link
Contributor Author

lurch commented May 10, 2014

@waveform80
Copy link
Owner

Well, it's certainly come up in a few e-mails and forum posts so I added it as a FAQ, but it would indeed be better to add a special error message for that exception if it occurs during _init_camera

@lxg2015
Copy link

lxg2015 commented Nov 14, 2016

i also meet such a question, it's caused by low power

@waveform80
Copy link
Owner

@lxg2015 it's not caused by low power. The most common cause is simply that the camera isn't enabled. There are other causes (deliberately setting the GPU memory split too low, or not enough free VC mem due to other processes / crashed processes) but not low power.

@JWTappert
Copy link

@waveform80 I definitely have the camera enabled but I am still getting this error. Do you have any suggestions on how I could diagnose those other issues you mentioned?

@eagleEggs
Copy link

Also having this issue currently

@eagleEggs
Copy link

Actually it only had to do with plugging into the wrong spot. All good now.

@geerlingguy
Copy link

Another possibility—if you're like me and you're using the Pi headless, you might be tempted to set the memory split to 16 MB, since you don't think you'll need the GPU for UI interactions.

The camera subsystem seems to also use the GPU, however, so you should leave it at the default—at least 64 (you can change it headless using sudo raspi-config).

@waveform80
Copy link
Owner

The camera subsystem seems to also use the GPU, however, so you should leave it at the default—at least 64 (you can change it headless using sudo raspi-config).

Correct; the camera firmware is (almost?) entirely on the GPU (see the Camera hardware chapter for more details). I think 64Mb is the bare minimum for camera usage, but that may not be enough for all operations (e.g. multiple encoders running simultaneously, higher resolutions, etc).

@j-suhas
Copy link

j-suhas commented Oct 19, 2021

Plugging it into the right slot in the right direction solved my problem. 😜 I was playing around with it for 2hrs and just realized.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants