-
Notifications
You must be signed in to change notification settings - Fork 190
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
[BUG] "Failed to reserve DRM plane" when running python overlay_drm.py in RPi5 Composite #995
Comments
Hi, thanks for the report. I don't have the right hardware to do any work on this, but am happy to do my best to help if we can establish what it is that needs fixing. Can I assume you have checked out the latest version of Picamera2, and have added your local version to your PYTHONPATH? If you run the most basic example
can you say exactly where it is going wrong, and what the immediate cause of the error is? Thanks! |
Presumably your application is using one of the 32bpp |
Also https://github.com/raspberrypi/rpicam-apps/blob/70894c0c46855955442284aba9dedb66d8d4bfbf/preview/drm_preview.cpp#L90 I also tried to run this code in C++ but I get “No suitable enabled connector found” due to the fact that count_connectors turns out to be empty |
Well, this display works with what the analog output gives it. in this case pal. |
OK, this is totally beyond my understanding (I know basically nothing about DRM or KMS). @6by9 Does any of this mean anything to you? |
We previously talked about this and this is what he wrote to me. |
I tried changing the format in drm_preview.py from AB24 to XB24, but still failed |
As discussed previously, Picamera2 (and rpicam-apps) are assuming they're running against vc4 as the DRM renderer, and hence have a wide choice of formats, scaling, and planes. RP1 for DSI, DPI, and VEC (and also most SPI displays) only have a single primary plane, and only support XRGB8888, XBGR8888, RGB888, BGR888, and RGB565 formats. Asking for any other format or requiring an overlay plane will fail. Picamera2 and rpicam-apps need to fall back to using the primary plane in the absence of a suitable overlay plane, and ensure that their pixel format choice is supported by the DRM device. |
Thanks for that! @ArtemKorr Sounds like either of the 24bpp or 32bpp formats should work then. Do you you want to try replacing |
Hmm, so it seems to be failing to create a @6by9 Does the above sound plausible, do you think? |
It should be happy to import a dmabuf. RP1 has an iommu, so should be able to import any buffer. If we have a simple way to reproduce this, then I can have a look and see why DRM is unhappy. |
OK, that's interesting. I don't have any means of reproducing this behaviour, unfortunately. @ArtemKorr Can you check your image dimensions match the display exactly? |
The previous time I tried it didn’t match. The image is 1280 x 720, I took it from the camera. And the display is 704/432, respectively. |
I guess you're sure that the image actually does contain something? (Perhaps you are able to save it as a JPEG and view it somewhere else?) |
This is a live stream from a camera... but the camera is working. shoots, so the images must contain something exactly |
Great glad it's working! I'd like to get these changes packaged into a PR that can be merged into our code base, so that in future this will "just work" for everyone, and you won't need special code edits of your own. Would you be able to commit your changes and post your tree to a Github fork of Picamera2? Then I can tidy them up a bit and make sure I haven't broken anything else. Then I'll create a PR which can be merged. I'd be extremely grateful if you'd have a moment to test that PR before I finally merge it. Would that be OK? Thanks very much for your help with this issue. |
Of course I can. But everything I did was commented out as you told me. |
Well, I'll make up a PR in the next day or so, and maybe you could give it a try just to check that I've fixed your issue correctly. That would be great! |
FKMS is deprecated. vc4-kms-v3d when rendering through vc4 (the composition hardware for HDMI, DSI, DPI, and VEC on Pi0-4, and for HDMI on Pi5) allows lots of options that currently picamera2 assumes are present. Largely the PR is to make sure that nothing gets missed out from what works for you. I'm trying to get it working on an SPI display at present, but with limited success. |
I've succeeded in getting picamera2 to render to an SPI display (yes the refresh rate sucks!), but it does require jumping through a few hoops in the configuration as well as fixing up drm_preview. I still had to configure things manually in my stream config. It feels like at least the pixel format should be extracted from the preview renderer.
|
Please only report one bug per issue!
I'm attempting to display the output of the Picamera2 on a DRM (Direct Rendering Manager) preview window and then output it to analog video. However, when I launch the application, I encounter the following error:
I previously inquired about this issue in the repository responsible for the kernel. raspberrypi/linux#5948 (comment)
Could you advise on how to resolve this issue and what I might be doing wrong in this scenario?
Describe the bug
I'm having trouble seeing the DRM (Direct Rendering Manager) preview on an RPI5 when using the composite video output.
Hardware :
I'm using Raspberry Pi 5
Console Output, Screenshots
If applicable, any console output or screenshots that show the problem and associated error messages.
Additional context
uname -a
`Linux raspberrypi 6.6.22-v8-16k+ #1747 SMP PREEMPT Wed Mar 27 17:06:56 GMT 2024 aarch64 GNU/Linux
vcgencmd version
The text was updated successfully, but these errors were encountered: