-
Notifications
You must be signed in to change notification settings - Fork 181
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] Does not run on fkms driver on Bullseye RasPi Lite #339
Comments
Hi, thanks for the question. Perhaps the documentation isn't very clear here, or is assuming too much prior knowledge. The DRM preview can only work when X windows is not running. (You can use Ctrl+Alt+F1 to suspend X windows to try this; use Ctrl+Alt+F7 to return again.) Does that answer the question? |
Hi, I was under the impression X windows was not running on Raspberry Pi OS Lite. Is that not the case? Either way, pressing this key combination changed nothing, so unfortunately this doesn't fix the bug. |
Ok, I did a little more digging into this and it looks like the initial format is XBGR8888 which is unavailable according to some debug printing I added in. I changed it to BGR888 which was an available mode and then it got stuck at I ran the fbset command to show available video modes and here's what it has available.
Perhaps the correct video modes were removed from the fkms driver or something. Maybe you have some more ideas. It might be as simple as adding some kind of parameter to the fkms driver to enable more video modes. |
Hi, sorry that I misunderstood your question initially. I've run through all the different cases and here's what I've discovered.
The reason for this is that the fkms driver has incomplete support for RGB-with-alpha formats. I believe it supports ARGB but not ABGR which (by unlucky coincidence) is the format the Picamera2 often defaults to, and also uses all the time for overlays. The former can be overridden (as you've done), but not the latter which is hard-coded. So in the first instance, obviously I would recommend using kms if you can, and if there's a problem with that we would of course investigate it. Alternatively, you could run your own version of Picamera2. You simply need to clone the repository and list it in your PYTHONPATH environment variable. Then you could edit the overlay format here. I'd be open to PR to make this configurable, though I'd be keen to ensure that all the preview implementations retain identical functionality. |
Ah, ok. No worries. I'm trying to do something with picamera2 that I was able to with the first picamera, which is to show the output on a TFT display that is only connected through SPI. To do that, it is using FBCP, which I'm not sure how long that will work for, but it's the only thing working at this point. When I tried through the KMS driver, I get the same Failed to Reserve Plane error when no HDMI cable is plugged in and it outputs to HDMI only when it is plugged in. So, making this a setting that could be overridden would be super helpful. I'm trying to put the instructions on how to do this into a guide for other folks, so having while having it available only in a custom fork would certainly be an option, it's not ideal because I would like to make this setup as easy for other folks as possible. I would be happy to help with testing out changes for this. By the way, you've done an awesome job with rewriting picamera2 and while it loses some backwards compatibility, it does things in a much better way and I found the code well written that I could follow along for the most part. |
Also, I did try and edit it, but stopped after an error occurred a few lines down for the line |
I'll put this on my list to have a look at, though I have a few other things to do first. In the interim, I'd have thought it would be enough just to replace |
Yes, thank you. I think I tried BGR888 and that's why I got the error. |
I've decided to patch our kernel so that the missing ABGR format is support, it turns out to be a small change. It will take several days for this to filter through to being available via |
Oh awesome. |
So I think all the changes for this should be in place now. You'll need the latest version of Picamera2 ( |
Awesome. I'll try it out when I'm feeling a bit better and am back at my desk. |
Ok I tested this without doing rpi-update and verified picamera2 was at 0.3.5 with |
Please only report one bug per issue!
Describe the bug
With a fresh install of Raspberry Pi OS Lite (Bullseye 64-bit), when attempting to run with the fkms driver it results in an error (see below).
To Reproduce
Fresh install of Raspberry Pi OS Lite (Bullseye 64-bit)
Run update and upgrade
Install python and git
git clone picamera2
Make sure vc4-fkms-v3d is enabled in /boot/config.txt (reboot if changing)
libcamera-hello should work fine
Attempt to run the preview_drm.py example results in error.
Expected behaviour
A preview window should appear
Console Output, Screenshots
Hardware :
Pi 4 8GB
Additional context
The text was updated successfully, but these errors were encountered: