Use small preview buffer for HQ camera, so long exposures can complete with 128MB GPU RAM #638
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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:
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:
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.