picamera icon indicating copy to clipboard operation
picamera copied to clipboard

Preview doesn't display with HDMI monitor

Open Devilmachie opened this issue 6 years ago • 6 comments

Hello,

I have tried to begin with the picamera module and i started with simple scripts such as :

`from time import sleep import picamera

camera = picamera.PiCamera() camera.start_preview() camera.start_recording('/home/pi/Desktop/video.h264') sleep(5) camera.stop_recording() camera.stop_preview()`

The video is well registered and the script doesn't output anykind of error. The problem is that the method start_preview doesn't display anything on my screen. Is there any common explanation for this?

Devilmachie avatar Aug 27 '19 16:08 Devilmachie

Have you enabled the full GL driver? Check for "dtoverlay=vc4-kms-v3d" in /boot/config.txt.

DRM/KMS does not allow multiple rendering clients, and is also totally controller by the Linux kernel, therefore the GPU can not add an extra overlay layer for the preview.

6by9 avatar Aug 28 '19 17:08 6by9

And so how do we solve the problem?

ADFRVH avatar Dec 07 '20 20:12 ADFRVH

And so how do we solve the problem?

You get the OP to answer the question of whether they enabled the full GL driver (in which case you solve it by disabling it to use FKMS or legacy mode), or otherwise provide some diagnostics.

If you have an issue along similar lines, then you need provide some information about it.

6by9 avatar Dec 08 '20 17:12 6by9

I have dtoverlay=vc4-kms-v3d what should it be? @6by9 isn't very clear in remediation, please advise.

optimuspaul avatar Dec 14 '20 23:12 optimuspaul

Remove dtoverlay=vc4-kms-v3d, or replace it with dtoverlay=vc4-fkms-v3d (note the 'f').

Picamera relies on the GPU firmware to be able to add overlays. vc4-kms-v3d switches all control of the rendering pipeline (and 3D) to the Linux kernel via the DRM/KMS APIs, so the GPU is no longer able to do that. vc4-fkms-v3d is a hybrid that emulates the DRM/KMS APIs on top of the firmware controlled rendering pipeline.

6by9 avatar Dec 15 '20 08:12 6by9

thanks, that worked for me

optimuspaul avatar Dec 15 '20 20:12 optimuspaul