laurentalacoque / TouchSelfie-extended

Open Source Photobooth based on the official Raspberry Pi 7" Touchscreen
55 stars 33 forks source link

mmal errors - Failed to enable connection: Out of resources #58

Closed andyhawkes closed 5 years ago

andyhawkes commented 5 years ago

I have just done a clean install of Rasbian (via NOOBS) and run through the setup process in the README, and everything is set up for the TouchSelfie app, but if I try to execute photobooth.sh I get the following error:

pi@photobooth:~ $ cd Desktop/photobooth/
pi@photobooth:~/Desktop/photobooth $ bash photobooth.sh 
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))0xf6c070 (ENOSPC)
mmal: mmal_connection_enable: output port couldn't be enabled
Traceback (most recent call last):
  File "user_interface.py", line 942, in <module>
    ui = UserInterface(config,window_size=(SCREEN_W, SCREEN_H))
  File "user_interface.py", line 285, in __init__
    self.camera = mycamera.PiCamera()
  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

I have checked that the camera is detected and supported via the following:

pi@photobooth:~ $ sudo vcgencmd get_camera
supported=1 detected=1

I have also increased GPU memory to 144

Nothing seems to make it want to work!

laurentalacoque commented 5 years ago

Hey @andyhawkes ! I also ran into this kind of trouble.

This error takes place during the first instanciation of PiCamera() This is frequently caused by :

This is not caused by TouchSelfie, any script that creates a PiCamera instance should fail the same way.

I advise you to:

Good luck!

andyhawkes commented 5 years ago

raspistill gives the same error.

I don't know what else could be using the camera though - it's literally a clean install of Raspbian with TouchSelfie set up on top of it.

I've ordered a new camera module and will test it with that once it arrives.

laurentalacoque commented 5 years ago

@andyhawkes also double check if you don't have any background services that use the camera (e.g. 'motion' or camera/www bridge) and make sure that the camera is enabled with raspi-config

andyhawkes commented 5 years ago

@laurentalacoque it looks like the v2 camera module I had was faulty - I swapped it out for a new v1 camera module and it works fine!

laurentalacoque commented 5 years ago

Hooray 👍 :)