PiCapture › capture card stops functioning
January 8, 2020 at 2:21 pm #22733
Eventually the capture card locks up, and will not take more pictures, until the raspberry pi, is rebooted.
I get the error camera can’t be enabled. I sometimes see this on one setup, after a couple days of running. However I have another setup that this will happen in as few as a 5 minutes, but never longer than 4 hours. I’ve swapped the capture cards, and the rpi, it seems to be related to the resolution. Is there a way to reset the camera, without rebooting the whole rpi? Or maybe there is some setting I might have incorrect? Thanks
Here is the error I get
mmal: mmal_vc_component_enable: failed to enable component: ENOSPC
mmal: camera component couldn’t be enabled
mmal: main: Failed to create camera component
mmal: Failed to run camera app. Please check for firmware updates.January 10, 2020 at 10:55 am #22866
It seems most likely that this is an issue happening with the GPU MMAL drivers. One thing we have learned is that they do not deal well with errors and generally cannot recover when one occurs. What capture software are you using? Are the systems identical (including size/make of SD memory card)? Many things can cause interruptions that create errors, but they can be difficult to track down. As one example, the flash memory file system can “pause” when large amounts of data are being stored. We have not found a reliable way to reinitialize the MMAL drivers after an error.January 10, 2020 at 10:55 am #22865
It seems most likely that this is an issue happening with the GPU MMAL drivers. One thing we have learned is that they do not deal well with errors and generally cannot recover when one occurs. What capture software are you using? Are the systems identical (including size/make of SD memory card)? Many things can cause interruptions that create errors, but they can be difficult to track down. As one example, the flash memory file system can “pause” when large amounts of data are being stored. We have not found a reliable way to reinitialize the MMAL drivers after an error.January 10, 2020 at 12:26 pm #22874
The systems are identical. They SD cards are the same, the cards were cloned from the same system. When the error comes up, it doesn’t show the image from the machine. We are using raspistill to take the pictures. Would the file system be used before the picture is taken? The only difference between the two system, is video being recorded. On the system that is unstable it is from a display port output, that is split and converted to hdmi for the capture card. The other system is an hdmi output that is split.January 10, 2020 at 12:54 pm #22875
After capturing 7 pictures over the past 30 minutes. The camera has crashed again. It takes a picture, then several minutes later will take the next one. My GPU_MEM is to 196. The error was different this time.
Camera control callback cmd=0x4f525245mmal: No data recieved from sensor. Check all connections, including the sunny one on the camera board.January 10, 2020 at 1:57 pm #22879
Thanks for the additional information about your application. The guess about SD cards was based on a guess that you were capturing large videos – still snapshots would not have that problem.
Is the video source continuous? The second error message seems to indicate that there was no active video detected by PiCapture at the time raspistill was invoked.
If you could send the software/script you are using we could try to reproduce the problem.January 10, 2020 at 2:03 pm #22880
The machine likes to swap resolutions, when it is booting up. That time it could have been in between video modes. I will have to look for that. Is there anyway to test if it sees video, without locking it up? This is an automated testing tool. It reboots another machine, and takes screen shots at different points, for later analysis.January 10, 2020 at 2:20 pm #22881
It is important that good stable video is detected by the HD1 at the time that raspistill is started. You can use the PiVideo software to check this. You could consider using a simple python program with the PiCamera package as an alternative to raspistill – this might be more stable in a production environment, and the PiVideo library could allow easier error checking.January 13, 2020 at 1:38 pm #23091
I quickly grabbed this code online, listed below. You are suggesting I use this instead?
from time import sleep from picamera import PiCamera camera = PiCamera() camera.resolution = (1024, 768) camera.start_preview() # Camera warm-up time sleep(2) camera.capture('foo.jpg')January 14, 2020 at 9:17 am #23150
That is the package that I would suggest using. One advantage is that the camera initialization is only performed when the object is created and so it is faster and may be more reliable.
Please note that you need to fully initialize the camera properties when using the picamera package, including (most importantly!) the camera mode. For example:
camera.resolution = (1920, 1080)
camera.sensor_mode = 1
camera.exposure_mode = ‘off’
camera.awb_mode = ‘off’
camera.awb_gains = (1.0,1.0)
You can then use the PiVideo module to make sure that video is active/ready before performing the capture, with something along these lines:
sleep(30) # Wait until time for the next capture
while not vid.ready:
print(“Video source is not ready”)
All of this is a suggestion that may help improve stability in a production environment, but there are certainly other approaches.
If you need additional assistance with the script please contact us via email and we will help if we can: email@example.com
- You must be logged in to reply to this topic.