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 · 10 comments

Comments

Projects
None yet
6 participants
@lurch
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

This comment has been minimized.

Owner

waveform80 commented May 9, 2014

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

@lurch

This comment has been minimized.

@waveform80

This comment has been minimized.

Owner

waveform80 commented May 10, 2014

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

This comment has been minimized.

lxg2015 commented Nov 14, 2016

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

@waveform80

This comment has been minimized.

Owner

waveform80 commented Nov 14, 2016

@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

This comment has been minimized.

JWTappert commented May 6, 2018

@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

This comment has been minimized.

eagleEggs commented May 27, 2018

Also having this issue currently

@eagleEggs

This comment has been minimized.

eagleEggs commented May 27, 2018

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

@geerlingguy

This comment has been minimized.

geerlingguy commented Sep 20, 2018

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

This comment has been minimized.

Owner

waveform80 commented Sep 29, 2018

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

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