Skip to content
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

Use small preview buffer for HQ camera, so long exposures can complete with 128MB GPU RAM #638

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

chrisruk
Copy link
Contributor

@chrisruk chrisruk commented Jul 28, 2020

With the HQ camera I found to get picamera to take a photo with 128MB GPU RAM for long exposures I had to set the preview buffer size to around 1920x1080, so that it would not run out of resources.

This pull request attempts first to use the maximum preview buffer, if this fails it tries again with 1920x1080 sized preview buffers.

In the process of switching to the smaller preview buffer size, I note the following message is printed:

mmal: mmal_vc_component_enable: failed to enable component: ENOSPC

I am wondering if it may be possible to hide this?

I found from - #627 (comment) that raspistill uses 1080p max preview buffer size.

I noticed when I installed Raspberry Pi OS from scratch and then enabled the camera with raspi-config, /boot/config.txt GPU memory was then set to:

gpu_mem=128

If this argument is removed, the GPU RAM available (found using: vcgencmd get_mem gpu), appeared to be 76MB, which wasn't enough for a long exposure to complete with picamera (even when using a preview resolution of 320x240).

So provided you enable the camera with raspi-config, the gpu_mem field is set programmatically to 128MB.

@chrisruk chrisruk changed the title Use small preview buffer for HQ camera, with default amount of GPU RAM (76MB) Use small preview buffer for HQ camera, so long exposures can complete with 128MB GPU RAM Aug 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant