Camera output as dmabuf?

Published by mendoku.anson on

New Home Forums 1. Cameras Modules for Raspberry Pi Camera output as dmabuf?

Tagged: 

Viewing 4 reply threads
  • Author
    Posts
    • #71715
      mendoku.anson
      Participant

      1.Which seller did you purchase the product(s) from?

      2.The Model number of the product(s) you have purchased?
      OV2311
      3.Which Platform are you using the product(s) on?
      Raspberry CM4
      4.Which instruction are you following?

      5.Has your product ever worked properly?

      6.What problems are you experiencing?
      Is there any way to access camera output as a dmabuf so I can just pass GPU memory pointer to the next processing software?

      Our use case involves passing data from arducam to a OpenGL processing program, then to the jpeg encoder of the rpi, then to another output program.

      We would like to eliminate as much CPU copying as possible as it’s a big blocker in our pipeline (>90% of the time the program is copying pixel data to and from OpenGL!).

      What we would like to achieve is like what the people at RPi did in this repo, but of course with data passed down from arducam instead of the H264 decoder.

      Relevant lines in the repo FYR:

      Binding textures to an EGLImage constructed from dmabuf: https://github.com/6by9/drm_mmal/blob/96db29374af39be1008b47bdca02fb0ab210d0b1/drm_mmal.c#L554
      Obtaining dmabuf handles:
      https://github.com/6by9/drm_mmal/blob/96db29374af39be1008b47bdca02fb0ab210d0b1/drm_mmal.c#L575

      7.What attempts at troubleshooting have you already made?

      8.How would you like us to help you?

    • #71841
      mendoku.anson
      Participant

      Realized I didn’t fill

      8.How would you like us to help you?

      Here is the answer:

      I would like to know ways to obtaining dmabuf pointers of the camera capture. AFAIK, the only way to obtain camera captures is through callback functions that give us data through CPU memory. Are there any ways to get pointers to GPU memory / are there any plans on implementing this function at ArduCam?

    • #71904
      bin
      Keymaster

      Hello,

      I have not tested the OpenGL now. I am not sure how to connect with our driver.

       

    • #71912
      mendoku.anson
      Participant

      Hello bin,

      For this application, I don’t need integration with opengl. Just need a mmal buffer (dmabuf) as provided by RPI. OpenGL can then bind to the dmabuf through an extension.

    • #71983
      bin
      Keymaster

      Hello,

      I know what you need. We have a demo,which will throw a data buf to the user when the frame is interrupted. You can get the data buf in the callback function. Maybe you can refer to it. https://github.com/ArduCAM/MIPI_Camera/blob/master/RPI/raw_callback.c

      Feel free to let me know if you need more help. What’s more, can you share your source code?

      I am not very clear about the OpenGL.

       

       

Viewing 4 reply threads
  • You must be logged in to reply to this topic.