-
Notifications
You must be signed in to change notification settings - Fork 357
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.exc.PiCameraMMALError: Failed to create MMAL component b'vc.camera_info': I/O error #697
Comments
did you enable the camera yet? you can use |
I have this same problem, but instead of I/O error, I get Function not implemented. This was with a fully working script. apt-get upgrade broke it. I've opened another issue for this. |
I upgrade to bullseye and got in the same situation. Unfortunately it doesn't promising to get fixed soon. https://raspberrypi.stackexchange.com/questions/132145/software-upgrade-broke-camera |
My error is slightly different: pi@raspberrypi3:~ $ ipython3 In [1]: from picamera import PiCamera In [2]: cam = PiCamera()
|
With regard Bullseye (released on 7th November, so TOTALLY unrelated to this issue), the blog post about the release is fairly plain.
|
@6by9 I was going to mention that I got it working after install libcamera-tools and libcamera-apps. So the picamera package has wrong dependencies. |
libcamera-tools and libcamera-apps have no relation to picamera - they will not reinstall the MMAL dependencies which picamera relies on. The legacy camera stack (including picamera) is not officially supported on Bullseye. |
So @6by9 what would be fix for that? I may missed that point. It works via libcamera-tools, but remains complaining w/ "'vc.camera_info': Function not implemented". I can see it is defined at header files: $ grep -r camera_info /usr/include/interface/mmal/ |
So this means that picamera either needs to be rewritten against libcamera or it becomes abandonware. If I understand the announcement correctly, it does imply that if the work were to get done it would mean that picamera would be applicable for platforms beyond the Raspberry Pi because libcamera is apparently a standard facility across multiple Linux variants. |
You can still enable the legacy stack, but the default is now libcamera. https://forums.raspberrypi.com/viewtopic.php?t=323390 Python bindings for libcamera are already in the works. |
@6by9 Thank you for posting the link to the topic in the Raspberry Pi forums. It enabled me to reuse the old stack. I think that this is a big issue which doesn't get enough visibility. Googling for answers does barely yield any useful results, and the news post [0] from the foundation about this changes should give the user hints to how to re-enable the old behavior. There are things the new stack can't do (at this time) which might break old code, in my case it was In any case, I will copy your code into this issue, should the forum become inaccessible:
[0] https://www.raspberrypi.com/news/an-open-source-camera-stack-for-raspberry-pi-using-libcamera/ |
That's not enough. If you attempt this with the current libraspberrypi0/bootloader packages, what you get is "Failed to create MMAL component b'vc.camera_info': Function Not Implemented." You have to backtrack those packages to the 20210831-1 versions for now. |
What does that mean? How do I do that? |
Go to http://archive.raspberrypi.org/debian/pool/main/r/raspberrypi-firmware/ Download libraspberrypi0_1.20210831-1_armhf.deb as root, do "dpkg -i " for all those files. You may need to remove vcdbg or make other package adjustments so that those fit. Afterwards, do "apt-mark hold" for all of them so that future apt upgrades don't overwrite them until that bug gets fixed. |
@nsayer How safe is this downgrading? Does it have side-effects? Also, can it be completely reverted by "unholding" them and then issuing an |
Well, it worked fine for me. And, yes, un-holding and upgrading is sufficient to undo this. |
This is what worked for me:
But I still have a question: doing an
So I'm wondering how safe it is to leave the latter not-upgradeable entries at the newest version, specially In any case, thank you for your help, because now it works. Another question: So, could it be that it is not necessary to compile and install userland as described above ( where |
The default linker option with Bullseye appears to now set as-needed, so as the core doesn't call into mmal_vc_client it is viewed as unnecesary, missing that mmal_vc_client has a constructor that registers functions with the core. Move the registration of the component supplier to the core_init. The linker is therefore satisfied that mmal_vc_client is used, and actually links to it. This allows Picamera to work again. waveform80/picamera#697 Signed-off-by: Dave Stevenson <[email protected]>
The default linker option with Bullseye appears to now set as-needed, so as the core doesn't call into mmal_vc_client it is viewed as unnecesary, missing that mmal_vc_client has a constructor that registers functions with the core. Move the registration of the component supplier to the core_init. The linker is therefore satisfied that mmal_vc_client is used, and actually links to it. This allows Picamera to work again. waveform80/picamera#697 Signed-off-by: Dave Stevenson <[email protected]>
I really don't believe that this is the right way for the RPi Foundation to communicate such a big change, and I understand why many are frustrated with it. There are thousands of scripts and examples out there that reference You can't get away with a random blog post that says "hey guys, FYI we've decided to completely kill the old picamera API, we'll let you know as soon as we have time how you are supposed to migrate your scripts". You can't even expect people to go through blog posts before a dist-upgrade to validate whether anything is going to break upon reboot. This is the best way to get developers pissed, and it has another unfortunate precedent (the way the omxplayer layer has been left to break and rot on its own without viable alternatives). What I would have expected:
We're all happy to see the RPi software finally transition towards a more open-source approach, leaving behind legacy and hard-to-debug software like picamera or omxplayer. But we also expect the alternatives to be properly documented and supported. Many people out there rely on RPi software for stuff like media or camera playback: you can't just break their software without providing and documenting the alternatives. |
Raspberry Pi is becoming low-rent Apple. |
Can we follow progress for this somewhere? Is there a code repo? Thanks! |
UPDATE AS OF 02/08/22* According to https://downloads.raspberrypi.org/raspios_armhf/release_notes.txt the 2022-01-28 release re-added support for the old camera stack ("Legacy camera applications and libraries reinstalled") and raspi-config got a new option to enable the legacy stack raspi-config - add option to switch to legacy camera mode. This means that it is enough to issue a sudo apt update; sudo apt dist-upgrade and after the reboot issue sudo raspi-config to enable the legacy camera stack in the 3 Interface Options-section. If you were holding the old packages you'd need to unhold them before doing the dist-upgrade: sudo apt-mark unhold libraspberrypi0 sudo apt update; sudo apt upgrade Original Post with spelling corrections (thanks @worldofchris) Bro In order to get the piCamera modules not to throw errors I had to manually update my repositories for bullseye this is important to do or else you will get errors like so mmal: mmal_component_create_core: could not find component 'vc.camera_info' To fix this run these commands to update the repositories and remove the vlc errors
Then make sure to reenable the legacy camera interface
Then enable it After this do a reboot
Then send me lots of thanks its quick and dirty but you can run PiCamera on bullseye and then update to Libcamera when they release picamer2 with the python3 bindings!!! be well and hope this helped someone. And I know I know you don't need to use the -get anymore just a habit that's hard to shake. |
@lexodistro I think it fixed the problem for me thank you :) However I am not able to use the VNC desktop anymore. Do you have an idea how I can fix this? It says: "Cannot currently show the desktop" |
@lexodistro thanks |
A million thanks, @lexodistro ! This saved my day :-) I completely agree with BlackLight, btw. |
@lexodistro you have saved the day. I was working against the clock to get something ready for an after school club when I hit this issue. One minor issue. I think you have a typo in your post:
Should it be:
? Thank you SO much though. |
Just a note on @lexodistro 's solution. According to https://downloads.raspberrypi.org/raspios_armhf/release_notes.txt the 2022-01-28 release re-added support for the old camera stack ("Legacy camera applications and libraries reinstalled") and This means that it is enough to issue a If you were holding the old packages you'd need to unhold them before doing the
and then after the reboot issue the |
@worldofchris Goodeye, I should have just copied my terminal history instead of trying to manually retype it here. Yes it should be @danielfaust I just read the update details and this does seem to be the case, I will update my post with your comment, thanks. |
I'm using Raspberry Pi 3 Model B+.
vcgencmd get_camera
gives mesupported=1 detected=1
raspistill -o test.jpg
gives me the test.jpg file but also gives this messageThen, I try to run this python code below, but it gives me this error message
Error:
The text was updated successfully, but these errors were encountered: