PiCapture capture card stops functioning

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #22733
    w.tukis
    Participant

    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.

    #22866
    mwlinder
    Keymaster

    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.

    #22865
    mwlinder
    Keymaster

    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.

    #22874
    w.tukis
    Participant

    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.

    #22875
    w.tukis
    Participant

    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.

    #22879
    mwlinder
    Keymaster

    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.

    #22880
    w.tukis
    Participant

    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.

    #22881
    mwlinder
    Keymaster

    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.

    #23091
    w.tukis
    Participant

    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')
    #23150
    mwlinder
    Keymaster

    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:

    import picamera
    camera=picamera.PiCamera()
    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:

    import pivideo_class
    vid=pivideo_class.PiVideo()
    vid.pivideo_port=’i2c1′
    vid_port=vid.open

    while True:
    sleep(30) # Wait until time for the next capture
    while not vid.ready:
    print(“Video source is not ready”)
    sleep(1)
    camera.capture(“nextframe.jpg”)

    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: contact@lintestsystems.com

Viewing 10 posts - 1 through 10 (of 10 total)
  • You must be logged in to reply to this topic.
w.tukiscapture card stops functioning