Skip to main content

Not enough available memory to allocate a buffer for streaming when trying to give the command to start the camera.

Answered

Comments

11 comments

  • Official comment
    TDY_Ifeanyi
    Community team
    Great answers
    Expert (Gold)

    Hello Desenvolvimento,

    Does it work increasing USBFS memory or using small resolution/ROI? With 20MP camera and around 500MB available memory, it could be that camera stream buffer count was very high which is stopping software to allocate enough buffer during intialization. 

    One thing to try is reducing this buffer count before initializing camera. Here is example code snippet that reduce buffer count to min:

             # Retrieve Stream Parameters device nodemap
            s_node_map = cam.GetTLStreamNodeMap()
            
            # Retrieve and modify Stream Buffer Count
            buffer_count = PySpin.CIntegerPtr(s_node_map.GetNode('StreamBufferCountManual'))
            if not PySpin.IsReadable(buffer_count) or not PySpin.IsWritable(buffer_count):
                print('Unable to set Buffer Count (Integer node retrieval). Aborting...\n')
                return False

            # Display Buffer Info
            print('Default Buffer Count: %d' % buffer_count.GetValue())
            print('Maximum Buffer Count: %d' % buffer_count.GetMax())

            buffer_count.SetValue(buffer_count.GetMin())

            print('Buffer count now set to: %d' % buffer_count.GetValue())

    If the above approach did not work, we could do remote session to work through this together via our support ticket https://flir.custhelp.com/app/ask ?

    Thanks,

    Ifeanyi

  • TDY_Ifeanyi
    Community team
    Great answers
    Expert (Gold)

    Hi Desenvolvimento,

    This error means there is not enough space in RAM to allocate required buffer and start the camera. I would recommend closing some software in your pc and/or reboot system to free up space or use another pc with enough space in physical memory. 

    Besides, a quick check in your implementation does not seems camera list is cleared as well as releasing system instance. I would recommend referencing our example code part of spinnaker python package on how to properly implement this.

    Regards,

    Ifeanyi.

    0
  • Desenvolvimento Shinier

    Hello!
    We were concerned about the possibility of there being some error actually related to the computer's memory itself, so we have added this functionality for the program to display memory usage while the error is occurring, and we have not found any reason for this failure to be memory-related, considering that there would still be enough memory to continue running the program smoothly.
    What other approaches do you suggest?

    0
  • TDY_Manuel
    Community team
    Expert (Gold)

    Hello!

    What camera model are you using exactly? If it is a USB3 camera, could you please check if this article helps? https://www.flir.com/support-center/iis/machine-vision/application-note/understanding-usbfs-on-linux/

    Best regards,

    Manuel 

    0
  • Desenvolvimento Shinier

    Hello!
    Yes, it is a USB3 camera, and we have already done this, but the error persists.

    0
  • TDY_Ifeanyi
    Community team
    Great answers
    Expert (Gold)

    Hello Desenvolvimento,

    What is the camera model and how many are connected to this PC? Do you see the same issue running single camera? 

    You may have to summit support ticket here https://flir.custhelp.com/app/ask to take a look via remote session.

    Thanks,

    Ifeanyi

     

    0
  • Desenvolvimento Shinier

    The camera model is the Blackfly S BFS-U3-200S6C, and we have only one camera connected to the PC.

    0
  • Desenvolvimento Shinier

    Hello!
    We have already performed the requested tests, significantly reduced the image resolution, and also implemented the provided code. However, after execution, the buffer count was reduced to 1. We still encounter the same error as always.

    0
  • TDY_Ifeanyi
    Community team
    Great answers
    Expert (Gold)

    Hello Desenvolvimento,

    Please open support ticket by using our contact form at https://flir.custhelp.com/app/ask to take a look.

    Thanks,

    Ifeanyi

    0
  • TDY_Demos
    Community team
    Expert (Gold)

    To summarize the external communication for others who may have a similar issue:

    - Working on a windows PC does not show any issues with the same code
    - If a user is manually setting the number of user buffers, we do not recommend to use less than 3.

    As this works on Windows, this is likely a memory limitation on the ARM board itself.  Spinnaker allocates buffers at full resolution and 24 bits per pixel, regardless of the region of interest you are using.  I do not know why decreasing the number of buffers to 3 still fails, since you seem to have over 800MB free memory and 3 buffers with each taking (20MP x 3 bytes per pixel = 60MB) is less than 200MB of memory.

    If others are running into a similar issue, please let us know your system specs and we can try to debug this further to find the cause.

    We also changed how we allocate memory in newer spinnaker versions, so please try the latest Spinnaker available of the website to see if that behaves better.

    Thank you,

    Demos

    0
  • harshith

    Hi I'm facing the same issue. I'm running on an MacBook Pro (13-inch, 2017) 8GB DDR3 Intel Core i5.

    0

Please sign in to leave a comment.

Powered by Zendesk