waveform80 / picamera

A pure Python interface to the Raspberry Pi camera module
https://picamera.readthedocs.io/
BSD 3-Clause "New" or "Revised" License
1.57k stars 357 forks source link

Fix MMal no buffers available. #645

Open dinapappor opened 4 years ago

dinapappor commented 4 years ago

This fixes picamera.exc.PiCameraMMALError: no buffers available: Resource temporarily unavailable when dealing with raw mmalobj and overlays.

What seems to happen is that we try to send buffers all the time instead of only doing it on port that is an output. This fixes it for me and I have not seen any issues as a result.

Let me know if this is good enough for inclusion or if you want me to do additional digging.

(For some reason I was not able to monkeypatch this from my code, probably because my python is somewhat limited)

xlla commented 3 years ago

it work!

rschaer commented 3 years ago

This fixed all (no buffer available) error messages when updating dynamic overlays in picamera for me. Saw other solutions suggesting switching between two layers with the same image, and alternatingly removing/adding the overlays on updates. This seems way less hacky. Thank you.