This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

[参考译文] AM62P:如何使用 DMA 进行视频流传输

Guru**** 2782445 points

Other Parts Discussed in Thread: AM62P

请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/microcontrollers/arm-based-microcontrollers-group/arm-based-microcontrollers/f/arm-based-microcontrollers-forum/1616134/am62p-how-to-use-dma-for-video-stream-transmission

部件号: AM62P

您好、

我们将在 AM62P 平台上捕获视频流。 但是、当同时传输 4 个视频流时、CPU 使用率极高、几乎完全占用。 因此、我们打算使用 DMA 进行视频流传输、以释放 CPU 资源。 您能建议如何配置基础设备树和驱动程序吗?

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    尊敬的 Ying:

    您能否说明一下媒体流水线的外观以及您尝试卸载到 DMA 的传输部分?

    此外、如果您正在使用 GStreamer 或 TIOVX 等任何框架、请分享这一点。

    此致、
    Jay

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    尊敬的 Jay:

    我最初使用以下命令来获取视频流数据:

    gst-launch-1.0 \
    v4l2src device=/dev/video-imx219-cam%d io-mode=mmap !
    video/x-raw, width=1280, height=960, format=UYVY !
    appsink

    但是、当同时采集 4 个视频流时、CPU 使用率极高。 因此、我尝试通过以下命令使用 DMA 进行传输:

    gst-launch-1.0 \
      v4l2src device=/dev/video0 io-mode=dmabuf-import ! \
      video/x-raw, width=1280, height=960, format=UYVY ! \
      videoconvert ! \
      appsink

    遗憾的是、这导致了错误(详情如下)。 您能否帮助我了解如何优化此设置以降低 CPU 利用率和释放 CPU 资源? 谢谢!

    root@am62pxx-evm:~# gst-launch-1.0   v4l2src device=/dev/video3 io-mode=dmabuf-import !   video/x-raw, width=1280, height=960, format=UYVY !   videoconvert !   appsink
    Setting pipeline to PAUSED ...
    Pipeline is live and does not need PREROLL ...
    Pipeline is PREROLLED ...
    Setting pipeline to PLAYING ...
    New clock: GstSystemClock
    ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: No downstream pool to import from.
    Additional debug info:
    /usr/src/debug/gstreamer1.0-plugins-good/1.22.12/sys/v4l2/gstv4l2object.c(5471): gst_v4l2_object_decide_allocation (): /GstPipeline:pipeline0/GstV4l2Src:v4l2src0:
    When importing DMABUF or USERPTR, we need a pool to import from
    ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Internal data stream error.
    Execution ended after 0:00:00.003532110
    Setting pipeline to NULL ...
    Additional debug info:
    /usr/src/debug/gstreamer1.0/1.22.12/libs/gst/base/gstbasesrc.c(3134): gst_base_src_loop (): /GstPipeline:pipeline0/GstV4l2Src:v4l2src0:
    streaming stopped, reason not-negotiated (-4)
    Freeing pipeline ...
    

    此致

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    尊敬的 Ying:

    您尝试使用哪些输入和输出格式? 视频转换后、我看不到任何 CAP 协商? 从摄像机到设备的实际数据传输应使用 DMA。 您能告诉我、是否在 appsink 之后在应用程序中触发 memcopy? 您也可以尝试使用假链接进行基准测试、以查看问题是否来自 v4l2src 节点。

    此致、
    Jay