<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Improvise CPU Performance on mxc_v4l2_vpu_test Application in i.MX Processors</title>
    <link>https://community.nxp.com/t5/i-MX-Processors/Improvise-CPU-Performance-on-mxc-v4l2-vpu-test-Application/m-p/1385198#M184315</link>
    <description>&lt;P&gt;in gstreamer pipeline, you use zero-copy method, vpu test is just direct encoding, you can see the difference as below:&lt;/P&gt;
&lt;P&gt;Type of encode&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Average CPU usage&lt;BR /&gt;Direct encode&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; 102%&lt;BR /&gt;Encode with Dmabuf 15%&lt;/P&gt;
&lt;P&gt;I don't find such patch for unit test, which is just for testing vpu performance, you can keep using gstreamer since this pipeline has lower cpu cost&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sun, 12 Dec 2021 13:37:07 GMT</pubDate>
    <dc:creator>joanxie</dc:creator>
    <dc:date>2021-12-12T13:37:07Z</dc:date>
    <item>
      <title>Improvise CPU Performance on mxc_v4l2_vpu_test Application</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Improvise-CPU-Performance-on-mxc-v4l2-vpu-test-Application/m-p/1380396#M183866</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I am working on i.mx8qxpc0 CPU-based custom board.&lt;/P&gt;&lt;P&gt;It is running LF5.10.35_2.0.0 yocto build.&lt;/P&gt;&lt;P&gt;I am working on VPU encoding part.&lt;/P&gt;&lt;P&gt;My processor is in governor mode as per ,&lt;BR /&gt;&lt;STRONG&gt;$ echo performance &amp;gt; /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Here I have used gstreamer pipline for encoding and have observations as per below,&lt;BR /&gt;&lt;STRONG&gt;$ gst-launch-1.0 -v v4l2src device=/dev/video3 io-mode=dmabuf-import ! 'video/x-raw,format=(string)NV12,width=1280,height=720,framerate=(fraction)30/1' ! queue ! v4l2h264enc output-io-mode=dmabuf ! filesink location=test.h264&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Obersevation(gst):-&lt;BR /&gt;- 30FPS and have CPU load it is 5-7% (from top utlitiy)&lt;BR /&gt;- In dmesg logs I can see logs of windsor driver (encoder)&lt;BR /&gt;&lt;BR /&gt;Now I have moved to application part where I have got mxc_v4l2_vpu_enc.out application and using it as per below,&lt;BR /&gt;&lt;STRONG&gt;$ ./mxc_v4l2_vpu_enc.out camera --key 0 --device /dev/video3 --size 1280 720 --u 4 --fmt nv12 --framerate 30 --framenum 90000 encoder --key 1 --source 0 --size 1280 720 --framerate 30 --bitrate 4194304 --lowlatency 0 ofile --key 2 --source 1 --name camera.h264&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Obervations(with app):-&lt;BR /&gt;- 30FPS and have CPU load it is 100% (from top utlitiy)&lt;BR /&gt;- In logs I can see logs of windsor driver (encoder)&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;VPU LOGS:&lt;BR /&gt;---------&lt;BR /&gt;&lt;STRONG&gt;start : output.camera.h264.2&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;Loop run&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;[ 539.692676] [VPU Encoder] [0:0][ 0], length : 408, ts : 0&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;[ 539.701962] [VPU Encoder] [0:0][ 1], length : 17560, ts : 0&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;[ 539.725587] [VPU Encoder] [0:0][ 2], length : 17559, ts : 0&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;[ 539.751603] [VPU Encoder] [0:0][ 3], length : 85311, ts : 0&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;[ 539.784112] [VPU Encoder] [0:0][ 4], length : 4623, ts : 0&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;[ 539.817450] [VPU Encoder] [0:0][ 5], length : 360, ts : 0&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;[ 539.850815] [VPU Encoder] [0:0][ 6], length : 88, ts : 0&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;[ 539.884952] [VPU Encoder] [0:0][ 7], length : 67992, ts : 0&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;[ 539.917697] [VPU Encoder] [0:0][ 8], length : 4784, ts : 0&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;So now the queries are,&lt;BR /&gt;1. Why there is a diffrence in CPU% utlisation in the case of GST Vs. Application ?&lt;BR /&gt;2. How can I improvise mxc_v4l2_vpu test app to lower down CPU usage&lt;/P&gt;&lt;P&gt;I have seen in the source that it uses V4L2_MEMORY_USERPTR so changing this to V4L2_MEMORY_DMABUF (as in the case of GST) will help ?&lt;/P&gt;&lt;P&gt;Can you advice ?&lt;/P&gt;&lt;P&gt;Any help would be greatly appreciable.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;---&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Fri, 03 Dec 2021 08:18:58 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Improvise-CPU-Performance-on-mxc-v4l2-vpu-test-Application/m-p/1380396#M183866</guid>
      <dc:creator>Ankit_siddhapura</dc:creator>
      <dc:date>2021-12-03T08:18:58Z</dc:date>
    </item>
    <item>
      <title>Re: Improvise CPU Performance on mxc_v4l2_vpu_test Application</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Improvise-CPU-Performance-on-mxc-v4l2-vpu-test-Application/m-p/1385198#M184315</link>
      <description>&lt;P&gt;in gstreamer pipeline, you use zero-copy method, vpu test is just direct encoding, you can see the difference as below:&lt;/P&gt;
&lt;P&gt;Type of encode&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Average CPU usage&lt;BR /&gt;Direct encode&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; 102%&lt;BR /&gt;Encode with Dmabuf 15%&lt;/P&gt;
&lt;P&gt;I don't find such patch for unit test, which is just for testing vpu performance, you can keep using gstreamer since this pipeline has lower cpu cost&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 12 Dec 2021 13:37:07 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Improvise-CPU-Performance-on-mxc-v4l2-vpu-test-Application/m-p/1385198#M184315</guid>
      <dc:creator>joanxie</dc:creator>
      <dc:date>2021-12-12T13:37:07Z</dc:date>
    </item>
  </channel>
</rss>

