0

My env:

  • Raspberry Pi 3B
  • Pi Camera v2
  • Dell 2312 screen (1080P)

According to this link, I use below codes to review camera's output:

from picamera import PiCamera
from time import sleep

camera = PiCamera(resolution=(3280, 2464), framerate=8, sensor_mode=2)

camera.start_preview()
sleep(600)

It will raise the error below directly with the default Memory Split setting (128MB in my case)

mmal: mmal_vc_port_enable: failed to enable port vc.null_sink:in:0(OPQV): ENOSPC
mmal: mmal_port_enable: failed to enable connected port 
(vc.null_sink:in:0(OPQV))0xaecce0 (ENOSPC)
mmal: mmal_connection_enable: output port couldn't be enabled
Traceback (most recent call last):
  File "cam_begin.py", line 4, in <module>
    camera = PiCamera(resolution=(3280, 2464), framerate=15)
  File "/usr/lib/python2.7/dist-packages/picamera/camera.py", line 433, in __init__
    self._init_preview()
  File "/usr/lib/python2.7/dist-packages/picamera/camera.py", line 513, in _init_preview
    self, self._camera.outputs[self.CAMERA_PREVIEW_PORT])
  File "/usr/lib/python2.7/dist-packages/picamera/renderers.py", line 558, in __init__
    self.renderer.inputs[0].connect(source).enable()
  File "/usr/lib/python2.7/dist-packages/picamera/mmalobj.py", line 2212, in enable
    prefix="Failed to enable connection")
  File "/usr/lib/python2.7/dist-packages/picamera/exc.py", line 184, in mmal_check
    raise PiCameraMMALError(status, prefix)
picamera.exc.PiCameraMMALError: Failed to enable connection: Out of resources

And after I set the Memory Split to 512MB, the preview can show on the screen about 2 or 3 seconds, then the whole screen changes to black (No Signal Input), then I have to kill this program to get the screen display back.

But, camera.capture method works good. So I'm guessing maybe Raspberry Pi 3B can not afford previewing such a high resolution output, but it still can capture pictures in 3280x2464.

I'm not sure about my guessing, hoping someone good at camera subsystem can tell me if my guessing is right~ thanks~

1
1

I do think you are correct and your memory split experiment points to that. Think about how much memory it takes to represent a single frame (width * height * color depth). Now consider doing that 8 times a second, it appears eventually the Pi can no longer keep up. Another quick experiment will confirm this try reducing the image size or color depth and see how many frames you can get. If your supposition is correct you should at least get more frames before it fails.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.