picamera.exc.PiCameraMMALError: Failed to enable connection: Out of resources

Raspberry Pi cameras (V1, V2, wide angle etc), HDMI capture modules etc.
Post Reply
atrunyan
Posts: 8
Joined: Fri Oct 22, 2021 4:36 pm

picamera.exc.PiCameraMMALError: Failed to enable connection: Out of resources

Post by atrunyan »

I am trying to run the stereopi tutorial code 1_test.py. After running vcgencmd get_camera I get supported=2 detected=2, and I enabled cameras in raspi-config. I also ran sudo apt update and sudo apt upgrade and checked to make sure no other programs are using the camera. This error happens when I run the script, along with these messages before the final error code:

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))0x2665e40 (ENOSPC)
mmal: mmal_connection_enable: output port couldn't be enabled

Please advise.

atrunyan
Posts: 8
Joined: Fri Oct 22, 2021 4:36 pm

Re: picamera.exc.PiCameraMMALError: Failed to enable connection: Out of resources

Post by atrunyan »

When I change the line:

camera = PiCamera(stereo_mode='side-by-side',stereo_decimate=False)

to only be camera = PiCamera()

I am able to get a video stream but I think it is only for one camera. I also tried:

camera = PiCamera()
camera.stereo_mode='side-by-side'
camera.stereo_decimate=False

but both run an attribute error that camera doesn't have the attributes stereo_mode and stereo_decimate.

User avatar
Realizator
Site Admin
Posts: 900
Joined: Tue Apr 16, 2019 9:23 am
Contact:

Re: picamera.exc.PiCameraMMALError: Failed to enable connection: Out of resources

Post by Realizator »

Hi atrunyan,
Am I got it right that you are using the fresh RaspiOS installation, but not our ready-to-use OpenCV RaspiOS image?

If yes, please check the GPU memory in config.txt (gpu_mem=...) You see, Python and Picamera libraries require much more memory than the regular camera use. Set this value to 192 or 256.

Which version of RaspiOS, Python, and Picamera you are using?
upd> The latest code can be found in this repository: https://github.com/realizator/stereopi-fisheye-robot
Eugene a.k.a. Realizator

Post Reply