[BUG] DRM preview can't find DRM cards

Open
#922 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
linux, python

Research direction

Start with examples/preview_drm.py and follow Picamera2.start_preview in picamera2.py into previews/drm_preview.py, especially the pykms.Card() call in DrmPreview._manager.add. Reproduce on the reported Raspberry Pi setup and determine why no DRM card is found; done means the DRM preview starts without the reported error.

Written by the indexing model from the issue text.

Description


# For use from the login console, when not running X Windows.

import time

from picamera2 import Picamera2, Preview

picam2 = Picamera2()
picam2.start_preview(Preview.DRM, x=100, y=100, width=480, height=320)

preview_config = picam2.create_preview_configuration({"size": (480, 320)})
picam2.configure(preview_config)

picam2.start()
time.sleep(5) 

running the above script (preview_DRM.py from examples) or any snippet that tries to open up a DRM preview I get the following error message:

  File "/home/tsid/picamera2/examples/preview_drm.py", line 10, in <module>
    picam2.start_preview(Preview.DRM, x=100, y=100, width=480, height=320)
  File "/usr/lib/python3/dist-packages/picamera2/picamera2.py", line 569, in start_preview
    preview = preview_table[preview](**kwargs)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/picamera2/previews/drm_preview.py", line 56, in __init__
    self.init_drm(x, y, width, height, transform)
  File "/usr/lib/python3/dist-packages/picamera2/previews/drm_preview.py", line 78, in init_drm
    DrmPreview._manager.add(self)
  File "/usr/lib/python3/dist-packages/picamera2/previews/drm_preview.py", line 19, in add
    self.card = pykms.Card()
                ^^^^^^^^^^^^
RuntimeError: failed to find DRM cards

I'm running a raspberry pi 4B 8gb on 64bit lite OS via SSH from windows
camera used: HQ Camera module
also hooked up on the pi is a Waveshare RPi LCD C 3.5 SPI screen

Dominant language
Python
Stars
1.2k
Forks
258
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from raspberrypi/picamera2

All issues in raspberrypi/picamera2

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.