<?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 VPU_DecLoad() always returns VPU_DEC_RET_INVALID_PARAM in i.MX Processors</title>
    <link>https://community.nxp.com/t5/i-MX-Processors/VPU-DecLoad-always-returns-VPU-DEC-RET-INVALID-PARAM/m-p/1603722#M201870</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I am trying to use VPU API on IMX8MM board, but no matter what parameters I add to function VPU_DecLoad() I always get&amp;nbsp;VPU_DEC_RET_INVALID_PARAM return code. What is interesting is that the same parameters, for some reason, work in GStreamer. For example, I hardcoded those parameters (copied from gststreamer debug output):&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;VpuDecOpenParam&lt;/SPAN&gt; &lt;SPAN&gt;open_param&lt;/SPAN&gt;&lt;SPAN&gt;;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;open_param.CodecFormat = 6;&lt;BR /&gt;open_param.nReorderEnable = 1;&lt;BR /&gt;open_param.nChromaInterleave = 1;&lt;BR /&gt;open_param.nMapType = 0;&lt;BR /&gt;open_param.nTiled2LinearEnable = 0;&lt;BR /&gt;open_param.nPicWidth = 1920;&lt;BR /&gt;open_param.nPicHeight = 800;&lt;BR /&gt;open_param.nEnableFileMode = 0;&lt;BR /&gt;open_param.nEnableVideoCompressor = 0;&lt;BR /&gt;open_param.nPixelFormat = 1;&lt;BR /&gt;open_param.nSecureMode = 0;&lt;BR /&gt;open_param.nSecureBufferAllocSize = 0;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;VPU_DecOpen&lt;/SPAN&gt;&lt;SPAN&gt;(&amp;amp;&lt;/SPAN&gt;&lt;SPAN&gt;handle&lt;/SPAN&gt;&lt;SPAN&gt;, &amp;amp;&lt;/SPAN&gt;&lt;SPAN&gt;open_param&lt;/SPAN&gt;&lt;SPAN&gt;, &amp;amp;&lt;/SPAN&gt;&lt;SPAN&gt;mem_info&lt;/SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;);&lt;BR /&gt;&lt;BR /&gt;This will return invalid params return code. mem_info is setup using VPU_DecQueryMem and manually allocating memory in&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN&gt;pVirtAddr and&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;pPhyAddr variables.&lt;BR /&gt;&lt;BR /&gt;Appreciate all the help!&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
    <pubDate>Wed, 22 Feb 2023 13:20:29 GMT</pubDate>
    <dc:creator>PiotrKrygier</dc:creator>
    <dc:date>2023-02-22T13:20:29Z</dc:date>
    <item>
      <title>VPU_DecLoad() always returns VPU_DEC_RET_INVALID_PARAM</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/VPU-DecLoad-always-returns-VPU-DEC-RET-INVALID-PARAM/m-p/1603722#M201870</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I am trying to use VPU API on IMX8MM board, but no matter what parameters I add to function VPU_DecLoad() I always get&amp;nbsp;VPU_DEC_RET_INVALID_PARAM return code. What is interesting is that the same parameters, for some reason, work in GStreamer. For example, I hardcoded those parameters (copied from gststreamer debug output):&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;VpuDecOpenParam&lt;/SPAN&gt; &lt;SPAN&gt;open_param&lt;/SPAN&gt;&lt;SPAN&gt;;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;open_param.CodecFormat = 6;&lt;BR /&gt;open_param.nReorderEnable = 1;&lt;BR /&gt;open_param.nChromaInterleave = 1;&lt;BR /&gt;open_param.nMapType = 0;&lt;BR /&gt;open_param.nTiled2LinearEnable = 0;&lt;BR /&gt;open_param.nPicWidth = 1920;&lt;BR /&gt;open_param.nPicHeight = 800;&lt;BR /&gt;open_param.nEnableFileMode = 0;&lt;BR /&gt;open_param.nEnableVideoCompressor = 0;&lt;BR /&gt;open_param.nPixelFormat = 1;&lt;BR /&gt;open_param.nSecureMode = 0;&lt;BR /&gt;open_param.nSecureBufferAllocSize = 0;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;VPU_DecOpen&lt;/SPAN&gt;&lt;SPAN&gt;(&amp;amp;&lt;/SPAN&gt;&lt;SPAN&gt;handle&lt;/SPAN&gt;&lt;SPAN&gt;, &amp;amp;&lt;/SPAN&gt;&lt;SPAN&gt;open_param&lt;/SPAN&gt;&lt;SPAN&gt;, &amp;amp;&lt;/SPAN&gt;&lt;SPAN&gt;mem_info&lt;/SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;);&lt;BR /&gt;&lt;BR /&gt;This will return invalid params return code. mem_info is setup using VPU_DecQueryMem and manually allocating memory in&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN&gt;pVirtAddr and&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;pPhyAddr variables.&lt;BR /&gt;&lt;BR /&gt;Appreciate all the help!&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 22 Feb 2023 13:20:29 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/VPU-DecLoad-always-returns-VPU-DEC-RET-INVALID-PARAM/m-p/1603722#M201870</guid>
      <dc:creator>PiotrKrygier</dc:creator>
      <dc:date>2023-02-22T13:20:29Z</dc:date>
    </item>
    <item>
      <title>Re: VPU_DecLoad() always returns VPU_DEC_RET_INVALID_PARAM</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/VPU-DecLoad-always-returns-VPU-DEC-RET-INVALID-PARAM/m-p/1603751#M201873</link>
      <description>&lt;P&gt;Found something, that might be related to the issue:&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;pVirtAddr of physical memory is NULL. I have to check, how that happens.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&lt;SPAN&gt;I found out, what's going on:&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;VPU_DecGetMem&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&lt;SPAN&gt;returns a structure, where&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN&gt;nVirtAddr is 0. I have no idea why. Any guesses?&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 22 Feb 2023 14:39:06 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/VPU-DecLoad-always-returns-VPU-DEC-RET-INVALID-PARAM/m-p/1603751#M201873</guid>
      <dc:creator>PiotrKrygier</dc:creator>
      <dc:date>2023-02-22T14:39:06Z</dc:date>
    </item>
    <item>
      <title>Re: VPU_DecLoad() always returns VPU_DEC_RET_INVALID_PARAM</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/VPU-DecLoad-always-returns-VPU-DEC-RET-INVALID-PARAM/m-p/1603850#M201882</link>
      <description>&lt;P&gt;I hate replying to my own requests, but I will do it in case someone else have this problem later:&lt;/P&gt;&lt;P&gt;Be VERY sure that you zero&amp;nbsp;VpuMemDesc structure before assigning size to it and passing to&amp;nbsp;VPU_DecGetMem. It's not stated anywhere in documentation, but correct way to use it is:&lt;/P&gt;&lt;P&gt;VpuMemDesc mem_desc;&lt;/P&gt;&lt;P&gt;memset(&amp;amp;mem_desc, 0, sizeof(VpuMemDesc));&lt;BR /&gt;mem_desc.nSize = &amp;lt;memory size got from VPU_DecQueryMem + alignment taken from the same function&amp;gt;;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;VPU_DecGetMem&lt;/SPAN&gt;&lt;SPAN&gt;(&amp;amp;&lt;/SPAN&gt;&lt;SPAN&gt;mem_desc&lt;/SPAN&gt;&lt;SPAN&gt;);&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Cheers and good luck for anyone using this API.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 22 Feb 2023 16:53:03 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/VPU-DecLoad-always-returns-VPU-DEC-RET-INVALID-PARAM/m-p/1603850#M201882</guid>
      <dc:creator>PiotrKrygier</dc:creator>
      <dc:date>2023-02-22T16:53:03Z</dc:date>
    </item>
  </channel>
</rss>

