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

PiCamera() does not work with hdmi off #120

Closed
ajaborsk opened this Issue Jul 4, 2014 · 2 comments

Comments

Projects
None yet
2 participants
@ajaborsk

ajaborsk commented Jul 4, 2014

I'm using RPi without screen and on batteries, so I'd like to switch off hdmi to save some mW (tvservice -o). But if I do, PiCamera() does not initialize (complains about invalid camera preview format in preview port settings). raspistill works well in the same condition, but I can't tell if a preview is showed or not.

@waveform80

This comment has been minimized.

Owner

waveform80 commented Jul 4, 2014

Yup, confirmed - unfortunately this is not a combination I've ever tested before and there's no easy workaround at the moment other than enabling HDMI. I'll look into this and try to get it fixed for 1.6

@waveform80

This comment has been minimized.

Owner

waveform80 commented Jul 4, 2014

Okay - I know what the issue is here : picamera attempts to be friendly and sets its initial resolution to the display resolution which is determined with bcm_host.graphics_get_display_size. When HDMI is disabled this returns -1 (which we don't check), and leaves the resolution as 0x0 (which naturally fails when we try to configure the preview). I'll add a check for a -1 return code and default the res to something sensible like 720p in that circumstance.

@waveform80 waveform80 closed this in 96dd8fd Jul 7, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment